Skip to content

Commit

Permalink
Merge pull request #2883 from ekluzek/beta05_cleanup_2_5313
Browse files Browse the repository at this point in the history
Update branch to latest master ctsm5.3.012
  • Loading branch information
ekluzek authored Nov 17, 2024
2 parents 3d811ca + 8402d31 commit 8e31637
Show file tree
Hide file tree
Showing 28 changed files with 527 additions and 235 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
21 changes: 2 additions & 19 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2593,12 +2593,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 Expand Up @@ -3607,17 +3604,6 @@ sub setup_logic_luna {
if ( &value_is_true($nl->get_value('lnc_opt') ) && not &value_is_true( $nl_flags->{'use_cn'}) ) {
$log->fatal_error("Cannot turn lnc_opt to true when bgc=sp" );
}
my $var = "jmaxb1";
if ( &value_is_true( $nl_flags->{'use_luna'} ) ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var,
'use_luna'=>$nl_flags->{'use_luna'} );
}
my $val = $nl->get_value($var);
if ( ! &value_is_true( $nl_flags->{'use_luna'} ) ) {
if ( defined($val) ) {
$log->fatal_error("Cannot set $var when use_luna is NOT on" );
}
}
}

#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -4531,8 +4517,6 @@ sub setup_logic_canopyhydrology {
#
my ($opts, $nl_flags, $definition, $defaults, $nl) = @_;

add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'interception_fraction' );
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'maximum_leaf_wetted_fraction' );
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_clm5_fpi' );
}

Expand All @@ -4551,7 +4535,6 @@ sub setup_logic_snowpack {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'wind_dependent_snow_density');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'snow_overburden_compaction_method');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'lotmp_snowdensity_method');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'upplim_destruct_metamorph');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'reset_snow');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'reset_snow_glc');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'reset_snow_glc_ela');
Expand Down
17 changes: 4 additions & 13 deletions bld/namelist_files/namelist_defaults_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -394,11 +394,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case).

<!-- Canopy hydrology namelist defaults -->
<use_clm5_fpi >.true.</use_clm5_fpi>
<interception_fraction >1.0</interception_fraction>
<maximum_leaf_wetted_fraction >0.05</maximum_leaf_wetted_fraction>
<use_clm5_fpi phys="clm4_5" >.false.</use_clm5_fpi>
<interception_fraction phys="clm4_5" >0.25</interception_fraction>
<maximum_leaf_wetted_fraction phys="clm4_5" >1.0</maximum_leaf_wetted_fraction>

<!-- Soilwater movement namelist defaults -->
<soilwater_movement_method >1</soilwater_movement_method>
Expand Down Expand Up @@ -474,9 +470,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<lotmp_snowdensity_method >'Slater2017'</lotmp_snowdensity_method>
<lotmp_snowdensity_method phys="clm4_5" >'TruncatedAnderson1976'</lotmp_snowdensity_method>

<upplim_destruct_metamorph >175.d00</upplim_destruct_metamorph>
<upplim_destruct_metamorph phys="clm4_5" >100.d00</upplim_destruct_metamorph>

<overburden_compress_tfactor>0.08d00</overburden_compress_tfactor>

<reset_snow>.false.</reset_snow>
Expand Down Expand Up @@ -531,9 +524,10 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<!-- The default filenames are given relative to the root directory
for the CLM2 data in the CESM distribution -->
<!-- Plant function types (relative to {csmdata}) -->
<paramfile phys="clm6_0" >lnd/clm2/paramdata/ctsm60_params.c240822.nc</paramfile>
<paramfile phys="clm5_0" >lnd/clm2/paramdata/clm50_params.c240814.nc</paramfile>
<paramfile phys="clm4_5" >lnd/clm2/paramdata/clm45_params.c240814.nc</paramfile>
<paramfile phys="clm6_0" >lnd/clm2/paramdata/ctsm60_params.c241017.nc</paramfile>
<paramfile phys="clm5_1" >lnd/clm2/paramdata/ctsm51_params.c241017.nc</paramfile>
<paramfile phys="clm5_0" >lnd/clm2/paramdata/clm50_params.c241017.nc</paramfile>
<paramfile phys="clm4_5" >lnd/clm2/paramdata/clm45_params.c241017.nc</paramfile>

<!-- ================================================================== -->
<!-- FATES default parameter file -->
Expand Down Expand Up @@ -584,9 +578,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<use_fertilizer >.false.</use_fertilizer>
<use_fertilizer use_crop=".true." >.true.</use_fertilizer>

<!-- Could depend on physics version -->
<jmaxb1 use_luna=".true." >0.17</jmaxb1>

<!-- o3_veg_stress_method-->
<o3_veg_stress_method>unset</o3_veg_stress_method>

Expand Down
20 changes: 0 additions & 20 deletions bld/namelist_files/namelist_definition_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -404,21 +404,11 @@ Max number of iterations used in subr. CanopyFluxes. For many years, 40 was the
<default>Default: 40</default>
</entry>

<entry id="interception_fraction" type="real" category="clm_physics"
group="clm_canopyhydrology_inparm" valid_values="" >
Fraction of intercepted precipitation
</entry>

<entry id="use_clm5_fpi" type="logical" category="clm_physics"
group="clm_canopyhydrology_inparm" valid_values="" >
If TRUE use clm5 equation for fraction of intercepted precipitation
</entry>

<entry id="maximum_leaf_wetted_fraction" type="real" category="clm_physics"
group="clm_canopyhydrology_inparm" valid_values="" >
Maximum fraction of leaf that may be wet prior to drip occuring
</entry>

<entry id="baseflow_scalar" type="real" category="clm_physics"
group="soilhydrology_inparm" valid_values="" >
Scalar multiplier for base flow rate
Expand Down Expand Up @@ -712,11 +702,6 @@ Scalar of leaf respiration to vcmax
The maximum value to use for zeta under stable conditions
</entry>

<entry id="Jmaxb1" type="real" category="clm_physics"
group="luna" >
baseline proportion of nitrogen allocated for electron transport (J)
</entry>

<entry id="use_fates" type="logical" category="physics"
group="clm_inparm" valid_values="" value=".false.">
Toggle to turn on the FATES model
Expand Down Expand Up @@ -2844,11 +2829,6 @@ TruncatedAnderson1976 -- Truncate the Anderson-1976 equation at the value for -1
Slater2017 ------------- Use equation from Slater that increases snow density for very cold temperatures (Arctic, Antarctic)
</entry>

<entry id="upplim_destruct_metamorph" type="real" category="clm_physics"
group="clm_snowhydrology_inparm" >
Upper Limit on Destructive Metamorphism Compaction [kg/m3]
</entry>

<entry id="overburden_compress_Tfactor" type="real" category="clm_physics"
group="clm_snowhydrology_inparm" >
Snow compaction overburden exponential factor (1/K)
Expand Down
58 changes: 50 additions & 8 deletions bld/unit_testers/build-namelist_test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1265,10 +1265,6 @@ sub cat_and_create_namelistinfile {
namelst=>"use_luna=.true., lnc_opt=.true.",
phys=>"clm5_0",
},
"NOlunabutsetJmaxb1" =>{ options=>"-envxml_dir . -bgc sp",
namelst=>"use_luna=.false., jmaxb1=1.0",
phys=>"clm5_0",
},
"envxml_not_dir" =>{ options=>"-envxml_dir myuser_nl_clm",
namelst=>"",
phys=>"clm5_0",
Expand Down Expand Up @@ -1348,10 +1344,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 @@ -1432,6 +1424,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
12 changes: 2 additions & 10 deletions cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,8 @@ def buildnml(case, caseroot, compname):
clm_accelerated_spinup = case.get_value("CLM_ACCELERATED_SPINUP")
comp_interface = case.get_value("COMP_INTERFACE")
lilac_mode = case.get_value("LILAC_MODE")
if comp_interface == "nuopc":
yr_start = case.get_value("DATM_YR_START")
yr_end = case.get_value("DATM_YR_END")
else:
yr_start = case.get_value("DATM_CLMNCEP_YR_START")
yr_end = case.get_value("DATM_CLMNCEP_YR_END")

if yr_start != None and yr_start < 0:
yr_start = case.get_value("DATM_CPLHIST_YR_START")
yr_end = case.get_value("DATM_CPLHIST_YR_END")
yr_start = case.get_value("DATM_YR_START")
yr_end = case.get_value("DATM_YR_END")

# For LILAC
if yr_start == None or lilac_mode == "on":
Expand Down
100 changes: 96 additions & 4 deletions cime_config/testdefs/ExpectedTestFails.xml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,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 @@ -191,6 +195,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 @@ -273,17 +284,75 @@
</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>

<test name="ERS_D_Ld5_Mmpi-serial.1x1_vancouverCAN.I1PtClm50SpRs.izumi_nag.clm-CLM1PTStartDate">
<phase name="RUN">
<status>FAIL</status>
<issue>#2861</issue>
</phase>
</test>

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

<test name="SMS_D_Ld1_Mmpi-serial.f45_f45_mg37.I2000Clm50SpRs.izumi_nag.clm-ptsRLA">
<phase name="RUN">
<status>FAIL</status>
<issue>#2861</issue>
</phase>
</test>

<test name="SMS_D_Mmpi-serial_Ld5.5x5_amazon.I2000Clm60FatesRs.izumi_nag.clm-FatesCold">
<phase name="RUN">
<status>FAIL</status>
<issue>#2861</issue>
</phase>
</test>

<test name="SMS_Ld10_D_Mmpi-serial.CLM_USRDAT.I1PtClm60Bgc.izumi_nag.clm-default--clm-NEON-HARV">
<phase name="RUN">
<status>FAIL</status>
<issue>#2861</issue>
</phase>
</test>

<test name="SMS_Ld10_D_Mmpi-serial.CLM_USRDAT.I1PtClm60SpRs.izumi_nag.clm-default--clm-NEON-TOOL">
<phase name="RUN">
<status>FAIL</status>
<issue>#2861</issue>
</phase>
</test>

<test name="ERP_D_Ld5_P48x1.f10_f10_mg37.I1850Clm60Bgc.izumi_nag.clm-ciso">
<phase name="RUN">
<status>FAIL</status>
<issue>#2861</issue>
</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>

Expand All @@ -300,6 +369,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
Loading

0 comments on commit 8e31637

Please sign in to comment.