Skip to content

Commit

Permalink
add test, add warning
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdebolskiy committed Aug 22, 2024
1 parent fccc884 commit 822618e
Show file tree
Hide file tree
Showing 2 changed files with 11 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 @@ -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

#-------------------------------------------------------------------------------
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 @@ -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" );
Expand Down

0 comments on commit 822618e

Please sign in to comment.