Skip to content

Commit

Permalink
Merge tag 'ctsm5.1.dev133' into fates-luh2
Browse files Browse the repository at this point in the history
FATES API update to facilitate fates refactor

This updates a number of FATES type names and module use statements
which correspond with a refactoring effort that moves FATES
patches and cohorts into their own respective modules.

With the FATES update is a minor science update, so there are
changes to answers for FATES.

This also incorporates a minor update to a more recent version
of the ccs config external.
  • Loading branch information
glemieux committed Aug 14, 2023
2 parents 90b6050 + 942de5c commit 9ce4ed9
Show file tree
Hide file tree
Showing 120 changed files with 10,509 additions and 2,007 deletions.
5 changes: 5 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@ e44dc469439e02e9ee582dab274d890ebdfab104
b88e1cd1b28e3609684c79a2ec0e88f26cfc362b
51c102c5df2e0ef971b5f8eeeb477567899af63a
7dacad70e74e2ec97f6492d4e7a3cb5dd498bcd7
b771971e3299c4fa56534b93421f7a2b9c7282fd
9de88bb57ea9855da408cbec1dc8acb9079eda47
8bc4688e52ea23ef688e283698f70a44388373eb
# Ran SystemTests and python/ctsm through black python formatter
5364ad66eaceb55dde2d3d598fe4ce37ac83a93c
4 changes: 2 additions & 2 deletions Externals.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ hash = 34723c2
required = True

[ccs_config]
tag = ccs_config_cesm0.0.64
tag = ccs_config_cesm0.0.65
protocol = git
repo_url = https://github.com/ESMCI/ccs_config_cesm.git
local_path = ccs_config
Expand All @@ -44,7 +44,7 @@ required = True
local_path = cime
protocol = git
repo_url = https://github.com/ESMCI/cime
tag = cime6.0.108
tag = cime6.0.125
required = True

[cmeps]
Expand Down
2 changes: 1 addition & 1 deletion Externals_CLM.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
local_path = src/fates
protocol = git
repo_url = https://github.com/NGEET/fates
tag = sci.1.65.3_api.25.4.0
tag = sci.1.67.1_api.26.0.0
required = True

[externals_description]
Expand Down
233 changes: 187 additions & 46 deletions bld/CLMBuildNamelist.pm

Large diffs are not rendered by default.

26 changes: 25 additions & 1 deletion bld/namelist_files/namelist_defaults_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<!-- FATES default parameter file -->
<!-- ================================================================== -->

<fates_paramfile>lnd/clm2/paramdata/fates_params_api.25.4.0_12pft_c230327.nc</fates_paramfile>
<fates_paramfile>lnd/clm2/paramdata/fates_params_api.25.5.0_12pft_c230628.nc</fates_paramfile>

<!-- ======================================================================================== -->
<!-- clm 5.0 BGC nitrogen model -->
Expand Down Expand Up @@ -562,6 +562,8 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<min_critical_dayl_method use_cn=".true." phys="clm5_1" >DependsOnLat</min_critical_dayl_method>
<onset_thresh_depends_on_veg >.false.</onset_thresh_depends_on_veg>
<min_critical_dayl_method >Constant</min_critical_dayl_method>
<generate_crop_gdds >.false.</generate_crop_gdds>
<use_mxmat >.true.</use_mxmat>

<!-- use additional stress deciduous onset trigger -->
<constrain_stress_deciduous_onset phys="clm4_5" >.false.</constrain_stress_deciduous_onset>
Expand Down Expand Up @@ -1670,10 +1672,16 @@ use_crop=".true.">lnd/clm2/surfdata_map/ctsm5.1.dev052/landuse.timeseries_mpasa1
<lai_mapalgo hgrid="1x1_asphaltjungleNJ" >nn</lai_mapalgo>
<lai_mapalgo hgrid="5x5_amazon" >nn</lai_mapalgo>

<!-- crop calendar streams namelist defaults -->
<stream_year_first_cropcal >1850</stream_year_first_cropcal>
<stream_year_last_cropcal >2100</stream_year_last_cropcal>
<model_year_align_cropcal >1850</model_year_align_cropcal>

<!-- lightning streams namelist defaults -->

<light_res use_cn=".false." >none</light_res>
<light_res use_cn=".true." fire_method="nofire" >none</light_res>
<light_res use_cn=".true." neon=".true." >106x174</light_res>
<light_res use_cn=".true." phys="clm4_5" >94x192</light_res>
<light_res use_cn=".true." phys="clm5_0" >94x192</light_res>
<light_res use_cn=".true." phys="clm5_1" >360x720</light_res>
Expand All @@ -1684,12 +1692,18 @@ use_crop=".true.">lnd/clm2/surfdata_map/ctsm5.1.dev052/landuse.timeseries_mpasa1
<light_res use_fates=".true." fates_spitfire_mode="3" >360x720</light_res>
<light_res use_fates=".true." fates_spitfire_mode="4" >360x720</light_res>
<light_res use_fates=".true." fates_spitfire_mode="5" >360x720</light_res>
<light_res use_fates=".true." fates_spitfire_mode="2" neon=".true.">106x174</light_res>
<light_res use_fates=".true." fates_spitfire_mode="3" neon=".true.">106x174</light_res>
<light_res use_fates=".true." fates_spitfire_mode="4" neon=".true.">106x174</light_res>
<light_res use_fates=".true." fates_spitfire_mode="5" neon=".true.">106x174</light_res>

<stream_year_first_lightng >0001</stream_year_first_lightng>
<stream_year_last_lightng >0001</stream_year_last_lightng>

<stream_fldfilename_lightng hgrid="94x192" >atm/datm7/NASA_LIS/clmforc.Li_2012_climo1995-2011.T62.lnfm_Total_c140423.nc</stream_fldfilename_lightng>
<stream_meshfile_lightng hgrid="94x192" >atm/datm7/NASA_LIS/clmforc.Li_2012_climo1995-2011.T62_ESMFmesh_cdf5_110621.nc</stream_meshfile_lightng>
<stream_fldfilename_lightng hgrid="106x174" >atm/datm7/NASA_LIS/clmforc.Li_2016_climo1995-2013.360x720.lnfm_Total_NEONarea_c210625.nc</stream_fldfilename_lightng>
<stream_meshfile_lightng hgrid="106x174" >atm/datm7/NASA_LIS/ESMF_MESH.Li_2016.360x720.NEONarea_cdf5_c221104.nc</stream_meshfile_lightng>
<stream_fldfilename_lightng hgrid="360x720" >atm/datm7/NASA_LIS/clmforc.Li_2016_climo1995-2013.360x720.lnfm_Total_c160825.nc</stream_fldfilename_lightng>
<stream_meshfile_lightng hgrid="360x720" >atm/datm7/NASA_LIS/clmforc.Li_2016_climo1995-2013.360x720_ESMFmesh_cdf5_150621.nc</stream_meshfile_lightng>

Expand Down Expand Up @@ -2705,4 +2719,14 @@ use_crop=".true.">lnd/clm2/surfdata_map/ctsm5.1.dev052/landuse.timeseries_mpasa1

<init_interp_method>general</init_interp_method>

<!-- ========================================= -->
<!-- Defaults for excess ice -->
<!-- ========================================= -->

<use_excess_ice>.false.</use_excess_ice>

<stream_fldfilename_exice use_excess_ice=".true.">lnd/clm2/paramdata/exice_init_0.125x0.125_c20220516.nc</stream_fldfilename_exice>
<stream_meshfile_exice use_excess_ice=".true.">lnd/clm2/paramdata/exice_init_0.125x0.125_ESMFmesh_cdf5_c20220802.nc</stream_meshfile_exice>
<stream_mapalgo_exice use_excess_ice=".true.">bilinear</stream_mapalgo_exice>

</namelist_defaults>
91 changes: 85 additions & 6 deletions bld/namelist_files/namelist_definition_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1107,20 +1107,20 @@ Toggle to turn on the 1-year grain product pool in the crop model
</entry>

<entry id="baset_mapping" type="char*20" category="physics"
group="crop" valid_values="constant,varytropicsbylat" value="constant">
group="crop_inparm" valid_values="constant,varytropicsbylat" value="constant">
Type of mapping to use for base temperature for prognostic crop model
constant = Just use baset from the PFT parameter file
varytropicsbylat = Vary the tropics by latitude
</entry>

<entry id="baset_latvary_slope" type="real" category="physics"
group="crop" valid_values="" value="0.4d00">
group="crop_inparm" valid_values="" value="0.4d00">
Only used when baset_mapping == varytropicsbylat
Slope with latitude in degrees to vary tropical baset by
</entry>

<entry id="baset_latvary_intercept" type="real" category="physics"
group="crop" valid_values="" value="12.0d00">
group="crop_inparm" valid_values="" value="12.0d00">
Only used when baset_mapping == varytropicsbylat
Intercept at zero latitude to add to baset from the PFT parameter file
</entry>
Expand All @@ -1146,6 +1146,16 @@ Phenology onset depends on the vegetation type
(only used when CN is on)
</entry>

<entry id="generate_crop_gdds" type="logical" category="physics"
group="cnphenology" valid_values="" value=".false.">
Set to .true. in order to override crop harvesting logic and to instead harvest the day before the next sowing date. Used to generate growing-degree day outputs that can be used with an external script to generate new GDD requirement ("cultivar") files.
</entry>

<entry id="use_mxmat" type="logical" category="physics"
group="cnphenology" valid_values="" value=".true.">
Set to .false. in order to ignore crop PFT parameter for maximum growing season length (mxmat). Must be set to .false. when generate_crop_gdds is .true.
</entry>

<entry id="min_critical_dayl_method" type="char*25" category="physics"
group="cnphenology" valid_values="Constant,DependsOnLat,DependsOnVeg,DependsOnLatAndVeg">
Method for determining what the minimum critical day length for seasonal decidious leaf offset depends on
Expand Down Expand Up @@ -1822,6 +1832,41 @@ Mapping method from LAI input file to the model resolution
copy = copy using the same indices
</entry>

<!-- ======================================================================================== -->
<!-- cropcal_streams streams Namelist -->
<!-- ======================================================================================== -->

<!-- Crop calendars -->
<entry id="stream_year_first_cropcal" type="integer" category="datasets"
group="cropcal_streams" valid_values="" >
First year to loop over for crop calendar data
</entry>

<entry id="stream_year_last_cropcal" type="integer" category="datasets"
group="cropcal_streams" valid_values="" >
Last year to loop over for crop calendar data
</entry>

<entry id="model_year_align_cropcal" type="integer" category="datasets"
group="cropcal_streams" valid_values="" >
Simulation year that aligns with stream_year_first_cropcal value
</entry>

<entry id="stream_fldfilename_sdate" type="char*256(30)" category="datasets"
input_pathname="abs" group="cropcal_streams" valid_values="" >
Filename of input stream data for sowing dates
</entry>

<entry id="stream_fldfilename_cultivar_gdds" type="char*256(30)" category="datasets"
input_pathname="abs" group="cropcal_streams" valid_values="" >
Filename of input stream data for cultivar growing degree-day targets
</entry>

<entry id="stream_meshfile_cropcal" type="char*256" category="datasets"
input_pathname="abs" group="cropcal_streams" valid_values="" >
Filename of input stream data for crop calendar inputs
</entry>

<!-- ======================================================================================== -->
<!-- light_streams streams Namelist (when CN an CLM4_5 is active) -->
<!-- ======================================================================================== -->
Expand Down Expand Up @@ -2009,9 +2054,9 @@ to use for methane model
</entry>

<entry id="light_res" type="char*10" category="default_settings"
group="default_settings" valid_values="none,360x720,94x192">
Resolution of Lightning dataset to use for CN fire model
(only applies when CN and the CN fire model are turned on)
group="default_settings" valid_values="none,360x720,106x174,94x192">
Resolution of Lightning dataset to use for CN or FATES fire model
(only applies when CN or FATES and the fire model is turned on)
</entry>

<entry id="chk_res" type="integer" category="default_settings"
Expand Down Expand Up @@ -2820,4 +2865,38 @@ use case.)

</entry>

<!-- ======================================================================================== -->
<!-- Namelist options related to excess ice -->
<!-- ======================================================================================== -->
<entry id="use_excess_ice" type="logical" category="clm_physics"
group="clm_inparm" valid_values="" >
If TRUE turn on the excess ice physics, (Lee et al., 2014; Cai et al., 2020)
</entry>

<entry id="use_excess_ice_streams" type="logical" category="clm_physics"
group="exice_streams" valid_values="" >
If TRUE and use_excess_ice is TRUE, use the excess ice stream to determine the initial values of the excess ice field
if FALSE and use_excess_ice is TRUE, expect excess ice to come from the initial conditions or restart file
Expect to be FALSE is use_excess_ice is FALSE
</entry>

<entry id="stream_fldfilename_exice" type="char*256(30)" category="datasets"
input_pathname="abs" group="exice_streams" valid_values="" >
Filename of input stream data for excess ice data
</entry>

<entry id="stream_meshfile_exice" type="char*256" category="datasets"
input_pathname="abs" group="exice_streams" valid_values="" >
mesh filename of input stream data for excess ice
</entry>

<entry id="stream_mapalgo_exice" type="char*256" category="datasets"
group="exice_streams" valid_values="bilinear,nn,none" >
Mapping method from excess ice input stream data to the model resolution
bilinear = bilinear interpolation
nn = nearest neighbor
none = no interpolation
</entry>


</namelist_definition>
57 changes: 53 additions & 4 deletions bld/unit_testers/build-namelist_test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ sub cat_and_create_namelistinfile {
#
# Figure out number of tests that will run
#
my $ntests = 1958;
my $ntests = 1992;
if ( defined($opts{'compare'}) ) {
$ntests += 1335;
$ntests += 1353;
}
plan( tests=>$ntests );

Expand Down Expand Up @@ -323,6 +323,8 @@ sub cat_and_create_namelistinfile {
"-res 0.9x1.25 -structure fast",
"-res 0.9x1.25 -namelist '&a irrigate=.true./'", "-res 0.9x1.25 -verbose", "-res 0.9x1.25 -ssp_rcp SSP1-2.6", "-res 0.9x1.25 -test", "-res 0.9x1.25 -sim_year 1850",
"-res 0.9x1.25 -namelist '&a use_lai_streams=.true.,use_soil_moisture_streams=.true./'",
"-res 0.9x1.25 -namelist '&a use_excess_ice=.true. use_excess_ice_streams=.true./'",
"-res 0.9x1.25 -namelist '&a use_excess_ice=.true. use_excess_ice_streams=.false./'",
"-res 0.9x1.25 -use_case 1850_control",
"-res 1x1pt_US-UMB -clm_usr_name 1x1pt_US-UMB -namelist '&a fsurdat=\"/dev/null\"/'",
"-res 1x1_brazil",
Expand All @@ -337,6 +339,10 @@ sub cat_and_create_namelistinfile {
my $base_options = "-envxml_dir . -driver $driver";
if ( $driver eq "mct" ) {
$base_options = "$base_options -lnd_frac $DOMFILE";
# Skip the MCT test for excess ice streams
if ( $options =~ /use_excess_ice_streams=.true./ ) {
next;
}
} else {
$base_options = "$base_options -namelist '&a force_send_to_atm = .false./'";
}
Expand Down Expand Up @@ -466,6 +472,9 @@ sub cat_and_create_namelistinfile {
"-bgc bgc -use_case 2000_control -namelist \"&a fire_method='nofire'/\" -crop",
"-res 0.9x1.25 -bgc sp -use_case 1850_noanthro_control -drydep -fire_emis",
"-res 0.9x1.25 -bgc bgc -use_case 1850_noanthro_control -drydep -fire_emis -light_res 360x720",
"--bgc bgc --light_res none --namelist \"&a fire_method='nofire'/\"",
"--bgc fates --light_res 360x720 --no-megan --namelist \"&a fates_spitfire_mode=2/\"",
"--bgc fates --light_res none --no-megan --namelist \"&a fates_spitfire_mode=1/\"",
) {
my $file = $startfile;
&make_env_run();
Expand Down Expand Up @@ -521,8 +530,33 @@ sub cat_and_create_namelistinfile {
GLC_TWO_WAY_COUPLING=>"FALSE",
phys=>"clm4_5",
},
"soilm_stream wo use" =>{ options=>"-res 0.9x1.25 -envxml_dir .",
namelst=>"use_soil_moisture_streams = .false.,stream_fldfilename_soilm='missing_file'",
"soilm_stream off w file" =>{ options=>"-res 0.9x1.25 -envxml_dir .",
namelst=>"use_soil_moisture_streams = .false.,stream_fldfilename_soilm='file_provided_when_off'",
GLC_TWO_WAY_COUPLING=>"FALSE",
phys=>"clm5_0",
},
"exice_stream off w file" =>{ options=>"-res 0.9x1.25 -envxml_dir .",
namelst=>"use_excess_ice=.true., use_excess_ice_streams = .false.,stream_fldfilename_exice='file_provided_when_off'",
GLC_TWO_WAY_COUPLING=>"FALSE",
phys=>"clm5_0",
},
"exice_stream off w mesh" =>{ options=>"-res 0.9x1.25 -envxml_dir .",
namelst=>"use_excess_ice=.true., use_excess_ice_streams = .false.,stream_meshfile_exice='file_provided_when_off'",
GLC_TWO_WAY_COUPLING=>"FALSE",
phys=>"clm5_0",
},
"exice off, but stream on" =>{ options=>"-res 0.9x1.25 -envxml_dir .",
namelst=>"use_excess_ice=.false., use_excess_ice_streams = .true.,stream_fldfilename_exice='file_provided', stream_meshfile_exice='file_provided'",
GLC_TWO_WAY_COUPLING=>"FALSE",
phys=>"clm5_0",
},
"exice stream off, but setmap"=>{ options=>"-res 0.9x1.25 -envxml_dir .",
namelst=>"use_excess_ice=.true., use_excess_ice_streams = .false.,stream_mapalgo_exice='bilinear'",
GLC_TWO_WAY_COUPLING=>"FALSE",
phys=>"clm5_0",
},
"exice stream on, but mct" =>{ options=>"--res 0.9x1.25 --envxml_dir . --driver mct --lnd_frac $DOMFILE ",
namelst=>"use_excess_ice=.true., use_excess_ice_streams=.true.",
GLC_TWO_WAY_COUPLING=>"FALSE",
phys=>"clm5_0",
},
Expand Down Expand Up @@ -686,6 +720,11 @@ sub cat_and_create_namelistinfile {
GLC_TWO_WAY_COUPLING=>"FALSE",
phys=>"clm5_0",
},
"NEONlightresButGlobal" =>{ options=>"--res 4x5 --bgc bgc --envxml_dir . --light_res 106x740",
namelst=>"",
GLC_TWO_WAY_COUPLING=>"FALSE",
phys=>"clm5_1",
},
"spno-fire" =>{ options=>"-bgc sp -envxml_dir . -use_case 2000_control",
namelst=>"fire_method='nofire'",
GLC_TWO_WAY_COUPLING=>"FALSE",
Expand Down Expand Up @@ -971,6 +1010,11 @@ sub cat_and_create_namelistinfile {
GLC_TWO_WAY_COUPLING=>"FALSE",
phys=>"clm5_1",
},
"FATESwspitfireOffLigtOn" =>{ options=>"-bgc fates -envxml_dir . -no-megan -light_res 360x720",
namelst=>"fates_spitfire_mode=0",
GLC_TWO_WAY_COUPLING=>"FALSE",
phys=>"clm5_1",
},
"FireNoneButBGCfireon" =>{ options=>"-bgc bgc -envxml_dir . -light_res none",
namelst=>"fire_method='li2021gswpfrc'",
GLC_TWO_WAY_COUPLING=>"FALSE",
Expand Down Expand Up @@ -1227,6 +1271,11 @@ sub cat_and_create_namelistinfile {
GLC_TWO_WAY_COUPLING=>"FALSE",
phys=>"clm5_1",
},
"NotNEONbutNEONlightres" =>{ options=>"--res CLM_USRDAT --clm_usr_name regional --envxml_dir . --bgc bgc --light_res 106x174",
namelst=>"fsurdat='build-namelist_test.pl'",
GLC_TWO_WAY_COUPLING=>"FALSE",
phys=>"clm5_1",
},
);
foreach my $key ( keys(%warntest) ) {
print( "$key\n" );
Expand Down
Empty file.
Loading

0 comments on commit 9ce4ed9

Please sign in to comment.