Skip to content

Commit

Permalink
Merge pull request ESCOMP#2894 from ekluzek/merge-master-20241126
Browse files Browse the repository at this point in the history
Merge ctsm5.3.013 into b4b-dev
  • Loading branch information
ekluzek authored Nov 26, 2024
2 parents 8758987 + 1d5f4f2 commit 7417668
Show file tree
Hide file tree
Showing 11 changed files with 358 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
[submodule "fates"]
path = src/fates
url = https://github.com/NGEET/fates
fxtag = sci.1.78.3_api.36.1.0
fxtag = sci.1.79.3_api.37.0.0
fxrequired = AlwaysRequired
# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed
fxDONOTUSEurl = https://github.com/NCAR/fates-release
Expand Down
7 changes: 2 additions & 5 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2588,12 +2588,9 @@ sub setup_logic_initial_conditions {
my $finidat = $nl->get_value($var);
$nl_flags->{'excess_ice_on_finidat'} = "unknown";
if ( $nl_flags->{'clm_start_type'} =~ /cold/ ) {
if (defined $finidat ) {
$log->warning("setting $var (either explicitly in your user_nl_clm or by doing a hybrid or branch RUN_TYPE)\n is incomptable with using a cold start" .
if (defined $finidat && !&value_is_true(($nl->get_value('use_fates')))) {
$log->fatal_error("setting $var (either explicitly in your user_nl_clm or by doing a hybrid or branch RUN_TYPE)\n is incompatible with using a cold start" .
" (by setting CLM_FORCE_COLDSTART=on)." );
$log->warning("Overridding input $var file with one specifying that this is a cold start from arbitrary initial conditions." );
my $group = $definition->get_group_name($var);
$nl->set_variable_value($group, $var, "' '" );
}
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl,
$var, 'val'=>"' '", 'no_abspath'=>1);
Expand Down
54 changes: 50 additions & 4 deletions bld/unit_testers/build-namelist_test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1314,10 +1314,6 @@ sub cat_and_create_namelistinfile {

my %warntest = (
# Warnings without the -ignore_warnings option given
"coldwfinidat" =>{ options=>"-envxml_dir . -clm_start_type cold",
namelst=>"finidat = 'testfile.nc'",
phys=>"clm5_0",
},
"bgcspin_w_suplnitro" =>{ options=>"-envxml_dir . -bgc bgc -clm_accelerated_spinup on",
namelst=>"suplnitro='ALL'",
phys=>"clm5_0",
Expand Down Expand Up @@ -1398,6 +1394,56 @@ sub cat_and_create_namelistinfile {
system( "cat $tempfile" );
}

print "\n===============================================================================\n";
print "Ensure cold starts with finidat are handled properly \n";
print "=================================================================================\n";

my %coldwfinidat = (
"bgc" => { options=>"-envxml_dir . -clm_start_type cold",
namelst=>"finidat = 'testfile.nc'",
phys=>"clm5_0",
expected_fail=>1,
},
"fates" => { options=>"-envxml_dir . -clm_start_type cold -bgc fates -no-megan",
namelst=>"finidat = 'testfile.nc', use_fates = .true.",
phys=>"clm5_0",
expected_fail=>0,
},
);
my $finidat;
foreach my $key ( keys(%coldwfinidat) ) {
print( "$key\n" );

my $var;
foreach $var ( "phys" , "options", "namelst", "expected_fail" ) {
if ( not exists $coldwfinidat{$key}{$var} ) {
die "ERROR: Subkey $var does not exist for coldwfinidat $key\nERROR:Check if you spelled $var correctly\n"
}
}

&make_config_cache($coldwfinidat{$key}{"phys"});
my $options = $coldwfinidat{$key}{"options"};
my $namelist = $coldwfinidat{$key}{"namelst"};
my $expected_fail = $coldwfinidat{$key}{"expected_fail"};
my %settings;
&make_env_run( %settings );

# Should fail if expected to, pass otherwise
eval{ system( "$bldnml $options -namelist \"&clmexp $namelist /\" > $tempfile 2>&1 " ); };
is( $? eq 0, $expected_fail eq 0, "coldwfinidat $key run");

if ( $expected_fail ) {
# Now run with -ignore_warnings and make sure it still doesn't work
$options .= " -ignore_warnings";
eval{ system( "$bldnml $options -namelist \"&clmexp $namelist /\" > $tempfile 2>&1 " ); };
isnt( $?, 0, "coldwfinidat $key run -ignore_warnings" );
} else {
# Check that finidat was correctly set
$finidat = `grep finidat lnd_in`;
ok ( $finidat =~ "testfile.nc", "coldwfinidat $key finidat? $finidat" );
}
}

#
# Loop over all physics versions
#
Expand Down
51 changes: 46 additions & 5 deletions cime_config/testdefs/ExpectedTestFails.xml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@
<status>FAIL</status>
<issue>#2454</issue>
</phase>
<phase name="COMPARE_base_rest">
<status>FAIL</status>
<issue>#2325</issue>
</phase>
</test>

<test name="SMS_Lm3_D_Mmpi-serial.1x1_brazil.I2000Clm50FatesCruRsGs.izumi_intel.clm-FatesColdHydro">
Expand All @@ -188,6 +192,13 @@
<issue>#2454</issue>
</phase>
</test>

<test name="ERS_Ld60.f45_f45_mg37.I2000Clm50FatesCruRsGs.derecho_intel.clm-FatesColdST3">
<phase name="RUN">
<status>FAIL</status>
<issue>#2867</issue>
</phase>
</test>

<test name="SMS_Ld10_D_Mmpi-serial.CLM_USRDAT.I1PtClm60Fates.izumi_nag.clm-FatesFireLightningPopDens--clm-NEON-FATES-NIWO">
<phase name="SHAREDLIB_BUILD">
Expand Down Expand Up @@ -270,21 +281,22 @@
</phase>
</test>

<test name="ERS_D_Ld15.f45_f45_mg37.I2000Clm50FatesRs.izumi_nag.clm-FatesColdTwoStream">
<test name="ERS_D_Ld15.f45_f45_mg37.I2000Clm50FatesRs.derecho_gnu.clm-FatesColdTwoStreamNoCompFixedBioGeo">
<phase name="COMPARE_base_rest">
<status>FAIL</status>
<issue>#2325</issue>
</phase>
</test>

<!-- izumi nag failures -->

<test name="ERS_D_Ld15.f45_f45_mg37.I2000Clm50FatesRs.derecho_gnu.clm-FatesColdTwoStreamNoCompFixedBioGeo">
<phase name="COMPARE_base_rest">
<test name="SMS_D.f10_f10_mg37.I1850Clm60BgcCrop.izumi_nag.clm-ciso_soil_matrixcn_only">
<phase name="RUN">
<status>FAIL</status>
<issue>#2325</issue>
<issue>#2861</issue>
</phase>
</test>

<!-- izumi nag failures -->
<test name="ERS_D_Ld5_Mmpi-serial.1x1_vancouverCAN.I1PtClm50SpRs.izumi_nag.clm-CLM1PTStartDate">
<phase name="RUN">
<status>FAIL</status>
Expand Down Expand Up @@ -334,6 +346,12 @@
</phase>
</test>

<test name="SMS_Lm3_D_Mmpi-serial.1x1_brazil.I2000Clm50FatesCruRsGs.izumi_nag.clm-FatesColdHydro">
<phase name="RUN">
<status>FAIL</status>
<issue>#2861</issue>
</phase>
</test>

<test name="SMS_Ld10_D_Mmpi-serial.CLM_USRDAT.I1PtClm60Fates.derecho_intel.clm-FatesFireLightningPopDens--clm-NEON-FATES-NIWO">
<phase name="SHAREDLIB_BUILD">
Expand All @@ -348,6 +366,29 @@
<issue>#2810</issue>
</phase>
</test>

<test name="ERS_D_Mmpi-serial_Ld5.1x1_brazil.I2000Clm50FatesCruRsGs.izumi_nag.clm-FatesCold">
<phase name="RUN">
<status>FAIL</status>
<issue>#2861</issue>
</phase>
</test>


<test name="SMS_Ld10_D_Mmpi-serial.CLM_USRDAT.I1PtClm60Fates.izumi_nag.clm-FatesPRISM--clm-NEON-FATES-YELLO">
<phase name="RUN">
<status>FAIL</status>
<issue>#2861</issue>
</phase>
</test>


<test name="ERS_D_Ld30.f45_f45_mg37.I2000Clm50FatesCruRsGs.izumi_nag.clm-FatesColdLandUse">
<phase name="SHAREDLIB_BUILD">
<status>FAIL</status>
<issue>#2810</issue>
</phase>
</test>

<!-- Other submodule test list failures (MOSART, RTM, etc. -->

Expand Down
4 changes: 2 additions & 2 deletions cime_config/testdefs/testlist_clm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2679,7 +2679,7 @@
<option name="comment" >5x5_amazon grid with FATES and latest CLM</option>
</options>
</test>
<test name="ERS_D_Ld15" grid="f10_f10_mg37" compset="I2000Clm50FatesRs" testmods="clm/FatesColdSeedDisp">
<test name="ERS_D_Ld15" grid="5x5_amazon" compset="I2000Clm50FatesRs" testmods="clm/FatesColdSeedDisp">
<machines>
<machine name="derecho" compiler="gnu" category="fates"/>
</machines>
Expand All @@ -2688,7 +2688,7 @@
<option name="comment" >This test should be converted to an ERP test once the PEM version of this test is passing COMPARE_base_modpes. Also change to 5x5_amazon once ccs_config updated to allow it</option>
</options>
</test>
<test name="PEM_D_Ld15" grid="f10_f10_mg37" compset="I2000Clm50FatesRs" testmods="clm/FatesColdSeedDisp">
<test name="PEM_D_Ld15" grid="5x5_amazon" compset="I2000Clm50FatesRs" testmods="clm/FatesColdSeedDisp">
<machines>
<machine name="derecho" compiler="gnu" category="fates"/>
</machines>
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
use_fates_ed_st3= .true.
hist_fexcl1 = 'FATES_ERROR_EL'
Loading

0 comments on commit 7417668

Please sign in to comment.