Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ctsm5.3.022: Update FATES namelist and build options to avoid Meier2022 #2934

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
8 changes: 6 additions & 2 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2125,10 +2125,14 @@ sub setup_logic_roughness_methods {
$log->fatal_error("$var is incorrect entry for the namelist variable z0param_method; expected Meier2022 or ZengWang2007");
}
my $phys = $physv->as_string();
ekluzek marked this conversation as resolved.
Show resolved Hide resolved
if ( $phys eq "clm4_5" || $phys eq "clm5_0" ) {
if ( $var eq "Meier2022" ) {
if ( $var eq "Meier2022" ) {
if ( $phys eq "clm4_5" || $phys eq "clm5_0" ) {
$log->fatal_error("z0param_method = $var and phys = $phys, but this method has been tested only with clm6_0 and later versions; to use with earlier versions, disable this error, and add Meier2022 parameters to the corresponding params file");
}
# Make sure that fates and meier2022 are not both active due to issue #2932
if ( &value_is_true($nl_flags->{'use_fates'}) ) {
$log->fatal_error("z0param_method = $var and use_fates currently are not compatible. Please update the z0param_method to ZengWang2007. See issue #2932 for more information.")
}
}
}
#-------------------------------------------------------------------------------
Expand Down
4 changes: 3 additions & 1 deletion bld/namelist_files/namelist_defaults_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,9 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<!-- ================================================================== -->

<z0param_method>ZengWang2007</z0param_method>
<z0param_method phys="clm6_0">Meier2022</z0param_method>
<!-- <z0param_method phys="clm6_0">Meier2022</z0param_method> -->
<z0param_method use_fates=".true." phys="clm6_0" >ZengWang2007</z0param_method>
ekluzek marked this conversation as resolved.
Show resolved Hide resolved
<z0param_method use_fates=".false." phys="clm6_0" >Meier2022</z0param_method>

<use_z0m_snowmelt z0param_method="Meier2022" >.true.</use_z0m_snowmelt>
<use_z0m_snowmelt >.false.</use_z0m_snowmelt>
Expand Down
8 changes: 6 additions & 2 deletions bld/unit_testers/build-namelist_test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ sub cat_and_create_namelistinfile {
#
# Figure out number of tests that will run
#
my $ntests = 3263;
my $ntests = 3264;

if ( defined($opts{'compare'}) ) {
$ntests += 1979;
$ntests += 1980;
}
plan( tests=>$ntests );

Expand Down Expand Up @@ -1185,6 +1185,10 @@ sub cat_and_create_namelistinfile {
namelst=>"use_hydrstress=.true.",
phys=>"clm5_0",
},
"useMeierwithFATES" =>{ options=>"-bgc fates -envxml_dir . -no-megan",
namelst=>"z0param_method=Meier2022",
phys=>"clm5_0",
},
"noanthro_w_crop" =>{ options=>"-envxml_dir . -res 0.9x1.25 -bgc bgc -crop -use_case 1850_noanthro_control",
namelst=>"",
phys=>"clm5_0",
Expand Down
6 changes: 5 additions & 1 deletion src/main/clm_initializeMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ subroutine initialize1(dtime)
use clm_varpar , only: clm_varpar_init
use clm_varcon , only: clm_varcon_init
use landunit_varcon , only: landunit_varcon_init
use clm_varctl , only: fsurdat, version
use clm_varctl , only: fsurdat, version, z0param_method
use surfrdMod , only: surfrd_get_num_patches, surfrd_get_nlevurb, surfrd_compat_check
use controlMod , only: control_init, control_print, NLFilename
use ncdio_pio , only: ncd_pio_init
Expand Down Expand Up @@ -108,6 +108,10 @@ subroutine initialize1(dtime)
! number of patches per column. We still use numcft from the surface
! file though...
if(use_fates) then
if (z0param_method == 'Meier2022') then
call endrun(msg='ERROR clm_initializeMod: '//&
'FATES is not compatible with Meier2022')
end if
call CLMFatesGlobals1(actual_numpft, actual_numcft, actual_maxsoil_patches)
end if

Expand Down
Loading