Skip to content

Commit

Permalink
Merge tag 'ctsm5.1.dev142' into hillslope_hydrology-ssr
Browse files Browse the repository at this point in the history
b4b changes to Python scripts, history lists, tech note, and clm_time_manager.

* Add system and unit tests for making fsurdat with all crops everywhere (ESCOMP#2081)
* Rework master_list* files etc. (ESCOMP#2087)
* Fixes to methane Tech Note (ESCOMP#2091)
* Add is_doy_in_interval() function (ESCOMP#2158)
* Avoid using subprocess.run() in FSURDATMODIFYCTSM (ESCOMP#2125)

Closes issues:
* Add unit test for making fsurdat with all crops everywhere (ESCOMP#2079)
* Rework master_list_(no)?fates.rst? (ESCOMP#2083)
* conda run -n can fail if a conda environment is already active (ESCOMP#2109)
* conda fails to load for SystemTests (ESCOMP#2111)
  • Loading branch information
samsrabin committed Oct 4, 2023
2 parents 5924c68 + 2e2434d commit 595d95d
Show file tree
Hide file tree
Showing 170 changed files with 16,269 additions and 6,620 deletions.
12 changes: 12 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Ran python directory through black python formatter
d229b5c6689efc4c2a6cef077515c4ccd5c18ff6
4cd83cb3ee6d85eb909403487abf5eeaf4d98911
0aa2957c1f8603c63fa30b11295c06cfddff44a5
2cdb380febb274478e84cd90945aee93f29fa2e6
Expand All @@ -7,3 +8,14 @@ e44dc469439e02e9ee582dab274d890ebdfab104
b88e1cd1b28e3609684c79a2ec0e88f26cfc362b
51c102c5df2e0ef971b5f8eeeb477567899af63a
7dacad70e74e2ec97f6492d4e7a3cb5dd498bcd7
b771971e3299c4fa56534b93421f7a2b9c7282fd
9de88bb57ea9855da408cbec1dc8acb9079eda47
8bc4688e52ea23ef688e283698f70a44388373eb
0a5a9e803b56ec1bbd6232eff1c99dbbeef25eb7
810cb346f05ac1aabfff931ab1a2b7b584add241
5933b0018f8e29413e30dda9b906370d147bad45
# Ran SystemTests and python/ctsm through black python formatter
5364ad66eaceb55dde2d3d598fe4ce37ac83a93c
8056ae649c1b37f5e10aaaac79005d6e3a8b2380
540b256d1f3382f4619d7b0877c32d54ce5c40b6
8a168bb0895f4f2421608dd2589398e13a6663e6
18 changes: 17 additions & 1 deletion .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,22 @@ jobs:
# Use options and version identical to the conda environment
# Using pyproject.toml makes sure this testing is consistent with our python directory testing
options: "--check --config python/pyproject.toml"
src: "./python"
src: "./python"
# Version should be coordinated with the ctsm_pylib conda environment under the python directory
version: "22.3.0"
# Actions identical to above for each directory and source file we need to check (arrays aren't allowed for src: field)
- uses: psf/black@stable
with:
options: "--check --config python/pyproject.toml"
src: "./cime_config/SystemTests"
version: "22.3.0"
- uses: psf/black@stable
with:
options: "--check --config python/pyproject.toml"
src: "./cime_config/buildlib"
version: "22.3.0"
- uses: psf/black@stable
with:
options: "--check --config python/pyproject.toml"
src: "./cime_config/buildnml"
version: "22.3.0"
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.66.1_api.25.5.0
tag = sci.1.67.2_api.27.0.0
required = True

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

Large diffs are not rendered by default.

39 changes: 35 additions & 4 deletions bld/namelist_files/namelist_defaults_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<for_testing_use_repr_structure_pool>.false.</for_testing_use_repr_structure_pool>
<for_testing_no_crop_seed_replenishment>.false.</for_testing_no_crop_seed_replenishment>

<!-- Set to .true. in namelist to write hist fields master list file -->
<hist_master_list_file>.false.</hist_master_list_file>
<!-- Set to .true. in namelist to write file with all history fields -->
<hist_fields_list_file>.false.</hist_fields_list_file>

<!-- In accelerated spinup mode reduce the amount of history output -->
<hist_empty_htapes clm_accelerated_spinup="on">.true.</hist_empty_htapes>
Expand Down Expand Up @@ -146,7 +146,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case).

<!-- Supplmental Nitrogen mode -->
<suplnitro use_cn=".true." >NONE</suplnitro>
<suplnitro use_fates=".true." >NONE</suplnitro>
<suplnitro use_fates=".true." >ALL</suplnitro>

<!-- Albedo for glaciers -->
<albice phys="clm5_1" >0.50,0.30</albice>
Expand Down Expand Up @@ -213,7 +213,8 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<zetamaxstable use_biomass_heat_storage=".true." >2.0d00</zetamaxstable>
<zetamaxstable phys="clm4_5" >2.0d00</zetamaxstable>
<zetamaxstable phys="clm5_0" >0.5d00</zetamaxstable>
<zetamaxstable phys="clm5_1" >0.5d00</zetamaxstable>
<zetamaxstable phys="clm5_1" z0param_method="ZengWang2007" >0.5d00</zetamaxstable>
<zetamaxstable phys="clm5_1" z0param_method="Meier2022" >2.0d00</zetamaxstable>

<!-- atm2lnd defaults -->
<repartition_rain_snow phys="clm5_1" >.true.</repartition_rain_snow>
Expand Down Expand Up @@ -324,6 +325,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<itmax_canopy_fluxes structure="standard">40</itmax_canopy_fluxes>
<itmax_canopy_fluxes structure="fast" >3</itmax_canopy_fluxes>


<!-- Canopy hydrology namelist defaults -->
<use_clm5_fpi phys="clm5_1" >.true.</use_clm5_fpi>
<interception_fraction phys="clm5_1" >1.0</interception_fraction>
Expand Down Expand Up @@ -495,6 +497,15 @@ attributes from the config_cache.xml file (with keys converted to upper-case).

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

<!-- ================================================================== -->
<!-- Default surface roughness parameterization -->
<!-- ================================================================== -->

<z0param_method>ZengWang2007</z0param_method>

<use_z0m_snowmelt z0param_method="Meier2022" >.true.</use_z0m_snowmelt>
<use_z0m_snowmelt >.false.</use_z0m_snowmelt>

<!-- ======================================================================================== -->
<!-- clm 5.0 BGC nitrogen model -->
<!-- ======================================================================================== -->
Expand All @@ -510,6 +521,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<use_luna phys="clm5_0" >.true.</use_luna>
<use_luna phys="clm5_0" use_fates=".true." >.false.</use_luna>
<use_luna phys="clm4_5" >.false.</use_luna>
<use_luna phys="clm4_5" use_fates=".true." >.false.</use_luna>

<!-- Flexible CN options -->
<MM_Nuptake_opt use_flexibleCN=".true." >.true.</MM_Nuptake_opt>
Expand Down Expand Up @@ -562,6 +574,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 @@ -1138,6 +1152,8 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_C24_hist_78pfts_CMIP6_simyr2000
lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_0.9x1.25_hist_78pfts_CMIP6_simyr2000_c190214.nc</fsurdat>
<fsurdat hgrid="1.9x2.5" sim_year="2000" use_crop=".true." use_vichydro=".false.">
lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1.9x2.5_hist_78pfts_CMIP6_simyr2000_c190304.nc</fsurdat>
<fsurdat hgrid="hcru_hcru" sim_year="2000">
lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_360x720cru_78pfts_CMIP6_simyr2000_c170824.nc</fsurdat>
<fsurdat hgrid="0.125x0.125" sim_year="2000" use_crop=".true." >
lnd/clm2/surfdata_map/release-clm5.0.24/surfdata_0.125x0.125_hist_78pfts_CMIP6_simyr2005_c190624.nc</fsurdat>
<fsurdat hgrid="10x15" sim_year="2000" use_crop=".true." use_vichydro=".false.">
Expand Down Expand Up @@ -1677,6 +1693,11 @@ 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>
Expand Down Expand Up @@ -2718,4 +2739,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>
107 changes: 102 additions & 5 deletions bld/namelist_files/namelist_definition_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -799,9 +799,9 @@ SNICAR (SNow, ICe, and Aerosol Radiative model) optical data file name
SNICAR (SNow, ICe, and Aerosol Radiative model) snow aging data file name
</entry>

<entry id="hist_master_list_file" type="logical" category="history"
<entry id="hist_fields_list_file" type="logical" category="history"
group="clm_inparm" valid_values="" value=".false.">
If TRUE, write master field list to separate file for documentation purposes
If TRUE, write list of all output fields to separate file for documentation purposes
</entry>

<entry id="hist_avgflag_pertape" type="char*10(10)" category="history"
Expand Down Expand Up @@ -1125,20 +1125,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 @@ -1164,6 +1164,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 @@ -1840,6 +1850,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 @@ -2778,6 +2823,24 @@ the related bulk quantities.
If .true., run with water isotopes
</entry>

<!-- ======================================================================================== -->
<!-- Namelist options related to surface roughness -->
<!-- ======================================================================================== -->

<entry id="z0param_method" type="char*64" category="clm_physics"
group="clm_inparm" valid_values="ZengWang2007,Meier2022" >
Parameterization/parameters to use for surface roughness
ZengWang2007: Zeng and Wang 2007
Meier2022: Meier et al. in prep. 2022
</entry>

<entry id="use_z0m_snowmelt" type="logical" category="clm_physics"
group="clm_inparm" valid_values="" >
If FALSE use constant snow z0m
If TRUE use parameterization of snow z0m as a function of accumulated
snow melt of Brock et al. (2006)
</entry>

<!-- ======================================================================================== -->
<!-- Namelist options related to initInterp -->
<!-- ======================================================================================== -->
Expand Down Expand Up @@ -2832,4 +2895,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>
Loading

0 comments on commit 595d95d

Please sign in to comment.