Skip to content

Commit

Permalink
Remove more use_z0mg_2d
Browse files Browse the repository at this point in the history
  • Loading branch information
ekluzek committed Oct 18, 2022
1 parent ed9610b commit 0badb30
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 109 deletions.
2 changes: 0 additions & 2 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4156,8 +4156,6 @@ sub setup_logic_z0param {
my $z0param_method = remove_leading_and_trailing_quotes($nl->get_value('z0param_method' ));
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_z0m_snowmelt',
'z0param_method'=>$z0param_method );
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_z0mg_2d',
'z0param_method'=>$z0param_method );
}

#-------------------------------------------------------------------------------
Expand Down
6 changes: 0 additions & 6 deletions bld/namelist_files/namelist_defaults_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -501,12 +501,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<use_z0m_snowmelt z0param_method="ZengWang2007" >.false.</use_z0m_snowmelt>
<use_z0m_snowmelt >.false.</use_z0m_snowmelt>

<use_z0mg_2d z0param_method="Meier2022" >.true.</use_z0mg_2d>
<use_z0mg_2d z0param_method="ZengWang2007" >.false.</use_z0mg_2d>
<use_z0mg_2d >.true.</use_z0mg_2d>



<!-- ======================================================================================== -->
<!-- clm 5.0 BGC nitrogen model -->
<!-- ======================================================================================== -->
Expand Down
6 changes: 0 additions & 6 deletions bld/namelist_files/namelist_definition_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2777,12 +2777,6 @@ If TRUE use parameterization of snow z0m as a function of accumulated
snow melt of Brock et al. (2006)
</entry>

<entry id="use_z0mg_2d" type="logical" category="clm_physics"
group="clm_inparm" valid_values="" >
If FALSE use constant ground z0m
If TRUE use spatially explicit ground z0m from Prigent et al. (2005)
</entry>

<!-- ======================================================================================== -->
<!-- Namelist options related to initInterp -->
<!-- ======================================================================================== -->
Expand Down
7 changes: 0 additions & 7 deletions cime_config/testdefs/ExpectedTestFails.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,6 @@
</phase>
</test>

<test name="SMS.hcru_hcru.I2000Clm51Bgc.cheyenne_intel.clm-Meier2022_surf_rough_all_hcruNonCrop">
<phase name="RUN">
<status>FAIL</status>
<issue>Half degree resolution issue</issue>
</phase>
</test>

<test name="SMS.f10_f10_mg37.I2000Clm50BgcCrop.izumi_pgi.clm-crop">
<phase name="MODEL_BUILD">
<status>FAIL</status>
Expand Down
18 changes: 0 additions & 18 deletions cime_config/testdefs/testlist_clm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1315,24 +1315,6 @@
<option name="comment" >Exact restart short DEBUG SP test with Meier surface roughness</option>
</options>
</test>
<test name="ERP_D_Ly3" grid="f09_f09_mg17" compset="I2000Clm51Bgc" testmods="clm/Meier2022_surf_rough_all_f09NonCrop">
<machines>
<machine name="cheyenne" compiler="intel" category="aux_clm"/>
</machines>
<options>
<option name="wallclock">00:20:00</option>
<option name="comment" >Exact restart DEBUG on test with Meier surface roughness at f09</option>
</options>
</test>
<test name="SMS" grid="hcru_hcru" compset="I2000Clm51Bgc" testmods="clm/Meier2022_surf_rough_all_hcruNonCrop">
<machines>
<machine name="cheyenne" compiler="intel" category="aux_clm"/>
</machines>
<options>
<option name="wallclock">00:20:00</option>
<option name="comment" >Short production test with Meier surface roughness at half degree</option>
</options>
</test>
<test name="ERS_Ly6_Mmpi-serial" grid="1x1_smallvilleIA" compset="IHistClm50BgcCropQianRs" testmods="clm/cropMonthOutput">
<machines>
<machine name="cheyenne" compiler="intel" category="aux_clm"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
z0param_method = 'Meier2022'
use_z0m_snowmelt = .true.
use_z0mg_2d = .false.
calc_human_stress_indices = 'NONE' ! Currently dies when turned on because of a negative humidity (about -31) in Wet Bulb calculation
paramfile = '$DIN_LOC_ROOT/lnd/clm2/paramdata/ctsm51_params.RMz0.c220304.nc'

68 changes: 2 additions & 66 deletions src/biogeophys/FrictionVelocityMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module FrictionVelocityMod
use decompMod , only : bounds_type
use abortutils , only : endrun
use clm_varcon , only : spval
use clm_varctl , only : use_cn, use_luna, z0param_method, use_z0mg_2d, use_z0m_snowmelt
use clm_varctl , only : use_cn, use_luna, z0param_method, use_z0m_snowmelt
use LandunitType , only : lun
use ColumnType , only : col
use PatchType , only : patch
Expand Down Expand Up @@ -95,7 +95,6 @@ module FrictionVelocityMod
procedure, private :: InitCold
procedure, private :: ReadNamelist
procedure, private :: ReadParams
procedure, private :: ReadZ0M
procedure, private, nopass :: StabilityFunc1 ! Stability function for rib < 0.
procedure, private, nopass :: StabilityFunc2 ! Stability function for rib < 0.

Expand All @@ -121,10 +120,6 @@ subroutine Init(this, bounds, NLFilename, params_ncid)
call this%ReadNamelist(NLFilename)
call this%ReadParams(params_ncid)

if(use_z0mg_2d) then
call this%ReadZ0M(bounds)
end if

end subroutine Init

!------------------------------------------------------------------------
Expand Down Expand Up @@ -414,57 +409,6 @@ subroutine ReadParams( this, params_ncid )

end subroutine ReadParams

!-----------------------------------------------------------------------
subroutine ReadZ0M(this, bounds)
!
! !DESCRIPTION:
! Initialize module time constant variables
!
! !USES:
use shr_log_mod, only : errMsg => shr_log_errMsg
use fileutils , only : getfil
use ncdio_pio , only : file_desc_t, ncd_defvar, ncd_io, ncd_pio_openfile, ncd_pio_closefile
use spmdMod , only : masterproc
use clm_varcon , only : grlnd
use clm_varctl , only : fsurdat
use ncdio_pio , only : ncd_io
use clm_varctl , only : iulog

!
! !ARGUMENTS:
class(frictionvel_type) :: this
type(bounds_type), intent(in) :: bounds
!
! !LOCAL VARIABLES:
integer :: c,g ! indices
type(file_desc_t) :: ncid ! netcdf id
character(len=256) :: locfn ! local filename
integer :: ier ! error status
logical :: readvar
real(r8), pointer :: z0mg2d (:) ! read in - ground z0m
!---------------------------------------------------------------------

! Allocate module variable for ground z0m


call getfil (fsurdat, locfn, 0)
call ncd_pio_openfile (ncid, locfn, 0)


allocate(z0mg2d(bounds%begg:bounds%endg))
call ncd_io(ncid=ncid, varname='Z0MG_2D', flag='read', data=z0mg2d, dim1name=grlnd, readvar=readvar)
if (.not. readvar) then
call endrun(msg=' ERROR: Z0MG_2D NOT on surfdata file'//errMsg(sourcefile, __LINE__))
end if
write(iulog,*) 'Writing z0mg2d'
do c = bounds%begc, bounds%endc
g = col%gridcell(c)
this%z0mg_2D_col(c) = max(1.e-4_r8,z0mg2d(g))
end do
deallocate(z0mg2d)

end subroutine ReadZ0M

!------------------------------------------------------------------------
subroutine Restart(this, bounds, ncid, flag)
!
Expand Down Expand Up @@ -637,12 +581,7 @@ subroutine SetRoughnessLengthsAndForcHeightsNonLake(this, bounds, &
z0mg(c) = this%zsno
end if
else
if(use_z0mg_2d) then
z0mg(c) = z0mg_2D(c)
else
z0mg(c) = this%zlnd
end if

z0mg(c) = this%zlnd
end if
case ('Meier2022') ! Bare ground and ice have a different value
l = col%landunit(c)
Expand All @@ -664,9 +603,6 @@ subroutine SetRoughnessLengthsAndForcHeightsNonLake(this, bounds, &


else
if(use_z0mg_2d) then
z0mg(c) = z0mg_2D(c)
else
z0mg(c) = this%zlnd

end if
Expand Down
1 change: 0 additions & 1 deletion src/main/clm_varctl.F90
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ module clm_varctl

character(len=64), public :: z0param_method
logical, public :: use_z0m_snowmelt = .false. ! true => use snow z0m parameterization of Brock2006
logical, public :: use_z0mg_2d = .false. ! true => use 2D ground z0m of Prigent2005


!----------------------------------------------------------
Expand Down
3 changes: 1 addition & 2 deletions src/main/controlMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ subroutine control_init(dtime)
soil_layerstruct_userdefined_nlevsoi, use_subgrid_fluxes, snow_cover_fraction_method, &
irrigate, run_zero_weight_urban, all_active, &
crop_fsat_equals_zero, for_testing_run_ncdiopio_tests, &
z0param_method, use_z0m_snowmelt, use_z0mg_2d
z0param_method, use_z0m_snowmelt

! vertical soil mixing variables
namelist /clm_inparm/ &
Expand Down Expand Up @@ -784,7 +784,6 @@ subroutine control_spmd()
call mpi_bcast (snow_cover_fraction_method , len(snow_cover_fraction_method), MPI_CHARACTER, 0, mpicom, ier)
call mpi_bcast (z0param_method , len(z0param_method), MPI_CHARACTER, 0, mpicom, ier)
call mpi_bcast (use_z0m_snowmelt, 1, MPI_LOGICAL, 0, mpicom, ier)
call mpi_bcast (use_z0mg_2d, 1, MPI_LOGICAL, 0, mpicom, ier)
call mpi_bcast (single_column,1, MPI_LOGICAL, 0, mpicom, ier)
call mpi_bcast (scmlat, 1, MPI_REAL8,0, mpicom, ier)
call mpi_bcast (scmlon, 1, MPI_REAL8,0, mpicom, ier)
Expand Down

0 comments on commit 0badb30

Please sign in to comment.