From 822618e669f08af5e4338f4d29e4a9d0ac54a74a Mon Sep 17 00:00:00 2001 From: mvdebolskiy Date: Thu, 15 Aug 2024 13:10:57 -0600 Subject: [PATCH 1/2] add test, add warning --- bld/CLMBuildNamelist.pm | 7 +++++++ bld/unit_testers/build-namelist_test.pl | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index b99be288e7..b5e74af000 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -2725,6 +2725,13 @@ SIMYR: foreach my $sim_yr ( @sim_years ) { $log->fatal_error("$useinitvar is being set for you but a $var was not found, so $useinitvar, init_interp_attributes, and finidat must not be set correctly for this configuration in the namelist_default file" ); } } + + # this check has to be here and not earlier since use_init_interp is set here and hillslope is already set above in setup_logic_hillslope + if ( &value_is_true($nl->get_value($useinitvar)) && value_is_true($nl->get_value("use_hillslope")) ) { + $log->warning("WARNING: You have set use_hillslope while $useinitvar is TRUE.\n This means all hillslope columns in a gridcell will read identical values" . + " from initial conditions. If you are sure you want this behaviour:") + } + } # end initial conditions #------------------------------------------------------------------------------- diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index c51b0b0cb3..074fdec814 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -1284,6 +1284,10 @@ sub cat_and_create_namelistinfile { namelst=>"fsurdat='build-namelist_test.pl'", phys=>"clm6_0", }, + "hillslope with init_interp"=>{ options=>"-bgc bgc -envxml_dir .", + namelst=>"use_init_interp=.true.,use_hillslope=.true.", + phys=>"clm6_0", + }, ); foreach my $key ( keys(%warntest) ) { print( "$key\n" ); From e205e2ef8ed005aa3bb7743ba5ea8061bbd22498 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 13 Sep 2024 11:38:56 -0600 Subject: [PATCH 2/2] Ignore warnings in Hillslope tests. --- .../testdefs/testmods_dirs/clm/Hillslope/shell_commands | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands b/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands index 6f3602d2e6..a2759b51b4 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands @@ -2,3 +2,6 @@ DIN_LOC_ROOT=$(./xmlquery --value DIN_LOC_ROOT) meshfile=$DIN_LOC_ROOT/lnd/clm2/testdata/ESMFmesh_10x15_synthetic_cosphill_1.0.nc ./xmlchange ATM_DOMAIN_MESH=${meshfile},LND_DOMAIN_MESH=${meshfile} + +# -ignore_warnings is needed as long as we don't allow use_hillslope and use_init_interp together +./xmlchange --append CLM_BLDNML_OPTS=-ignore_warnings