diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index ab0aab0cc5..93004ad1c4 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -2118,17 +2118,21 @@ sub setup_logic_roughness_methods { my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'z0param_method', - 'phys'=>$nl_flags->{'phys'} ); + 'phys'=>$nl_flags->{'phys'} , 'use_fates'=>$nl_flags->{'use_fates'}); my $var = remove_leading_and_trailing_quotes( $nl->get_value("z0param_method") ); if ( $var ne "Meier2022" && $var ne "ZengWang2007" ) { $log->fatal_error("$var is incorrect entry for the namelist variable z0param_method; expected Meier2022 or ZengWang2007"); } my $phys = $physv->as_string(); - 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.") + } } } #------------------------------------------------------------------------------- diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index cee72ca5cf..64e00527fe 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -540,7 +540,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ZengWang2007 -Meier2022 +Meier2022 .true. .false. diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index d42487cfdb..a3630f3286 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -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 ); @@ -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", diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index e8121519aa..c07909c67e 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -518,6 +518,11 @@ subroutine control_init(dtime) errMsg(sourcefile, __LINE__)) end if + if (z0param_method == 'Meier2022') then + call endrun(msg=' ERROR: Surface roughness parameterization Meier2022 is not compatible with FATES.'//& + errMsg(sourcefile, __LINE__)) + end if + else ! These do default to false anyway, but this emphasizes they