Skip to content

Commit

Permalink
Merge pull request ESCOMP#2703 from mvdebolskiy/hs-uii
Browse files Browse the repository at this point in the history
Add a namelist warning when hillslope hydrology is used with initial interpolation.
  • Loading branch information
samsrabin committed Sep 17, 2024
2 parents e707519 + 149ffda commit a1ee963
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2743,6 +2743,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

#-------------------------------------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions bld/unit_testers/build-namelist_test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1301,6 +1301,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" );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a1ee963

Please sign in to comment.