Skip to content

Commit

Permalink
Merge tag 'ctsm5.2.017' into CLM5_MEGAN_ISOP
Browse files Browse the repository at this point in the history
Dust emissions control moved to cmeps

Remove the dust emissions namelist items from CTSM and use the namelist in the drv_flds_in for CMEPS.

This updates CTSM to use the namelist control in CMEPS (in ESCOMP/CMEPS#429). So the CMEPS external needs to be updated, and the
namelist control in CTSM changed to use CMEPS rather than the internal CTSM control settings and the CTSM ones removed.

The new XML variable:

   LND_SETS_DUST_EMIS_DRV_FLDS

controls whether dust emission settings are set by CTSM or by CAM. Only one or the other can set them, and it's required so when CAM
and CTSM are running together they need to know which one will select.

This required some changes for LILAC. The drv_flds_in namelist file is now required for LILAC, and read for dust emissions
(and dust emissions only) at the LILAC lnd_comp_esmf.F90 level.

Add a unit test for the CMEPS code to make sure it's working correctly. This validates the code both for CAM and CTSM.

Fix the cidinahoBR test in the build-namelist unit tester.
  • Loading branch information
slevis-lmwg committed Aug 1, 2024
2 parents 0f147f8 + e7626f8 commit 793678f
Show file tree
Hide file tree
Showing 164 changed files with 17,470 additions and 1,652 deletions.
4 changes: 4 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ d866510188d26d51bcd6d37239283db690af7e82
0dcd0a3c1abcaffe5529f8d79a6bc34734b195c7
e096358c832ab292ddfd22dd5878826c7c788968
475831f0fb0e31e97f630eac4e078c886558b61c
fd5f177131d63d39e79a13918390bdfb642d781e
# Ran SystemTests and python/ctsm through black python formatter
5364ad66eaceb55dde2d3d598fe4ce37ac83a93c
8056ae649c1b37f5e10aaaac79005d6e3a8b2380
Expand All @@ -36,6 +37,7 @@ e096358c832ab292ddfd22dd5878826c7c788968
6fccf682eaf718615407d9bacdd3903b8786a03d
2500534eb0a83cc3aff94b30fb62e915054030bf
78d05967c2b027dc9776a884716597db6ef7f57c
47839a77229c61555e3b8932927bb54cdc511b27
a0d014fae9550dd9ffbc934abd29ef16176f8208
c7b7ca1d94ac19abb9ecea9fb5b712ddbdd6645d
b565b55ce7a9f8d812a573d716a5fd3d78cfea81
Expand All @@ -46,4 +48,6 @@ aa04d1f7d86cc2503b98b7e2b2d84dbfff6c316b
6c6f57e948bfa31e60b383536cc21663fedb8b70
9660667b1267dcd4150889f5f39db540158be74a
665cf86102e09b4c4c5a140700676dca23bc55a9
1a49e547ba3c48fa483f9ae81a8f05adcd6b888c
045d90f1d80f713eb3ae0ac58f6c2352937f1eb0
753fda3ff0147837231a73c9c728dd9ce47b5997
12 changes: 6 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -28,31 +28,31 @@
[submodule "fates"]
path = src/fates
url = https://github.com/NGEET/fates
fxtag = sci.1.73.0_api.35.0.0
fxtag = sci.1.77.1_api.36.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

[submodule "cism"]
path = components/cism
url = https://github.com/ESCOMP/CISM-wrapper
fxtag = cismwrap_2_2_001
fxtag = cismwrap_2_2_002
fxrequired = ToplevelRequired
# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed
fxDONOTUSEurl = https://github.com/ESCOMP/CISM-wrapper

[submodule "rtm"]
path = components/rtm
url = https://github.com/ESCOMP/RTM
fxtag = rtm1_0_79
fxtag = rtm1_0_80
fxrequired = ToplevelRequired
# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed
fxDONOTUSEurl = https://github.com/ESCOMP/RTM

[submodule "mosart"]
path = components/mosart
url = https://github.com/ESCOMP/MOSART
fxtag = mosart1_0_49
fxtag = mosart1.1.02
fxrequired = ToplevelRequired
# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed
fxDONOTUSEurl = https://github.com/ESCOMP/MOSART
Expand All @@ -68,7 +68,7 @@ fxDONOTUSEurl = https://github.com/ESCOMP/mizuRoute
[submodule "ccs_config"]
path = ccs_config
url = https://github.com/ESMCI/ccs_config_cesm.git
fxtag = ccs_config_cesm0.0.106
fxtag = ccs_config_cesm1.0.0
fxrequired = ToplevelRequired
# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed
fxDONOTUSEurl = https://github.com/ESMCI/ccs_config_cesm.git
Expand All @@ -84,7 +84,7 @@ fxDONOTUSEurl = https://github.com/ESMCI/cime
[submodule "cmeps"]
path = components/cmeps
url = https://github.com/ESCOMP/CMEPS.git
fxtag = cmeps0.14.63
fxtag = cmeps0.14.77
fxrequired = ToplevelRequired
# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed
fxDONOTUSEurl = https://github.com/ESCOMP/CMEPS.git
Expand Down
605 changes: 488 additions & 117 deletions bld/CLMBuildNamelist.pm

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions bld/env_run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Sample env_run.xml file that allows build-namelist to be run for testing in this
-->
<entry id="DIN_LOC_ROOT" value="MYDINLOCROOT" />
<entry id="GLC_TWO_WAY_COUPLING" value="FALSE" />
<entry id="LND_SETS_DUST_EMIS_DRV_FLDS" value="TRUE" />
<entry id="NEONSITE" value="" />

</config_definition>
134 changes: 105 additions & 29 deletions bld/namelist_files/namelist_defaults_ctsm.xml

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions bld/namelist_files/namelist_defaults_dust_emis.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0"?>

<?xml-stylesheet type="text/xsl" href="namelist_defaults.xsl"?>

<namelist_defaults>

<!--
Values to use by default for creation of CLM model driver namelists.
The element names are the same as the corresponding namelist
variables. Values that depend on the model configuration use
attributes to express the dependency. The recognized attributes
are: RESOLUTION, defaults, mask, ic_ymd, ic_tod, sim_year and all configuration
attributes from the config_cache.xml file (with keys converted to upper-case).
-->

<!-- Defaults for dust_emis_inparm namelist -->
<dust_emis_method>Zender_2003</dust_emis_method>

<zender_soil_erod_source>atm</zender_soil_erod_source>

</namelist_defaults>
2 changes: 2 additions & 0 deletions bld/namelist_files/namelist_defaults_overall.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ determine default values for namelists.
<res sitespf_pt="1x1_urbanc_alpha" >1x1_urbanc_alpha</res>
<res sitespf_pt="1x1_numaIA" >1x1_numaIA</res>
<res sitespf_pt="1x1_smallvilleIA" >1x1_smallvilleIA</res>
<res sitespf_pt="1x1_cidadinhoBR" >1x1_cidadinhoBR</res>

<!-- Default simulation year -->
<sim_year>2000</sim_year>
Expand Down Expand Up @@ -110,6 +111,7 @@ determine default values for namelists.
<mask hgrid="1x1_urbanc_alpha" >test</mask>
<mask hgrid="1x1_numaIA" >navy</mask>
<mask hgrid="1x1_smallvilleIA" >test</mask>
<mask hgrid="1x1_cidadinhoBR" >test</mask>
<mask >gx1v7</mask>

<!-- Default glacier model options -->
Expand Down
182 changes: 152 additions & 30 deletions bld/namelist_files/namelist_definition_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -734,10 +734,17 @@ Toggle to turn on no competition mode (only relevant if FATES is being used).
Toggle to turn on FATES satellite phenology mode (only relevant if FATES is being used).
</entry>

<entry id="use_fates_logging" type="logical" category="physics"
group="clm_inparm" valid_values="" value=".false.">
Toggle to turn on the logging module
(Only relevant if FATES is on)
<entry id="fates_harvest_mode" type="char*18" category="physics"
group="clm_inparm" valid_values="no_harvest,event_code,landuse_timeseries,luhdata_area,luhdata_mass">
Set FATES harvesting mode by setting fates_harvest_mode to a valid string option.
Allowed values are:
no_harvest: no fates harvesting of any kind
event_code: fates logging via fates logging event codes (see fates parameter file) only
landuse_timeseries: fates harvest driven by CLM flanduse_timeseries file (dynHarvestMod)**
luhdata_area: fates harvest driven by LUH2 raw harvest data, area-based (dynFATESLandUseChangeMod)
luhdata_mass: fates harvest driven by LUH2 raw harvest data, mass-based (dynFATESLandUseChangeMod)
**Note that the landuse_timeseries option is not the same as the FATES fluh_timeseries data file.
This option is older than the luhdata options and may be depricated at some point in the future.
</entry>

<entry id="use_fates_planthydro" type="logical" category="physics"
Expand Down Expand Up @@ -794,9 +801,27 @@ Full pathname to the inventory initialization control file.
<entry id="use_fates_luh" type="logical" category="physics"
group="clm_inparm" valid_values="" >
If TRUE, enable use of land use harmonization (LUH) state and transition data from luh_timeseries file.
This is enabled by default if fates_harvest_mode is set to use the raw LUH2 harvest data
(Also, only valid for use_fates = true and is incompatible with transient runs currently.)
</entry>

<entry id="use_fates_lupft" type="logical" category="physics"
group="clm_inparm" valid_values="" value=".false.">
If TRUE, enable use of FATES land use with no competition and fixed biogeography. This mode
requires the use of the land use x pft association static data map file. See the
flandusepftdat definition entry in this file for more information.
(Only valid for use_fates = true and is incompatible with transient runs currently.)
</entry>

<entry id="use_fates_potentialveg" type="logical" category="physics"
group="clm_inparm" valid_values="" >
If TRUE, ignore the land-use state vector and transitions, and assert that all lands
are primary, and that there is no harvest. This mode is only relevant for FATES
spin-up workflows that are intending to use the spin-up restart output to start a
FATES land use transient case using the use_fates_lupft namelist option. The option
should be set to true for the spin-up case and false for the transient case.
</entry>

<!-- This could eventually be included in the "dynamic_subgrid" -->
<entry id="fluh_timeseries" type="char*256" category="datasets"
input_pathname="abs" group="clm_inparm" valid_values="" >
Expand All @@ -806,6 +831,18 @@ types to vary over time.
(Only relevant if FATES is on).
</entry>

<entry id="flandusepftdat" type="char*256" category="datasets"
input_pathname="abs" group="clm_inparm" valid_values="" >
Full pathname of fates landuse x pft association static data map.
The file associates land use types with pfts across a static global map.
This file is necessary for running FATES with use_fates_luh,
use_fates_nocomp, and use_fates_fixedbiogeo engaged (note that use_fates_lupft
is provided as a namelist option to engage all necessary options). The file is output
by the FATES land use data tool (https://github.com/NGEET/tools-fates-landusedata)
which processes the raw land use data from the THEMIS tool data sets
(https://doi.org/10.5065/29s7-7b41)
</entry>

<entry id="use_luna" type="logical" category="physics"
group="clm_inparm" valid_values="" value=".false.">
Toggle to turn on the LUNA model, to effect Photosynthesis by leaf Nitrogen
Expand All @@ -829,7 +866,7 @@ Toggle to turn on surface water routing in the hillslope hydrology model
</entry>

<entry id="hillslope_fsat_equals_zero" type="logical" category="physics"
group="clm_inparm" valid_values="" value=".true.">
group="clm_inparm" valid_values="" value=".false.">
If true, set fsat to zero for hillslope columns
</entry>

Expand Down Expand Up @@ -1146,6 +1183,50 @@ e.g., because we have integrated AgSys and have tests of it that make
these software infrastructure tests obsolete.
</entry>

<!-- ======================================================================================== -->
<!-- CN Matrix solution -->
<!-- ======================================================================================== -->
<entry id="use_matrixcn" type="logical" category="bgc"
group="clm_inparm" valid_values="" value=".false.">
Turn on the Matrix solution for above ground biogeochemistry, requires CN to be on
</entry>

<entry id="use_soil_matrixcn" type="logical" category="bgc"
group="clm_inparm" valid_values="" value=".false.">
Turn on the Matrix solution for soil biogeochemistry
</entry>

<entry id="hist_wrt_matrixcn_diag" type="logical" category="bgc"
group="clm_inparm" valid_values="" value=".false.">
Turn on extra output for the matrix solution
</entry>

<entry id="spinup_matrixcn" type="logical" category="bgc"
group="clm_inparm" valid_values="" value=".false.">
Turn on semi-analytic spinup solution for the CN/Soil matrix, requires soil matrix to be on
This will drive the solution to equilibrium
</entry>

<entry id="nyr_forcing" type="integer" category="bgc"
group="clm_inparm" valid_values="" value="1">
Number of years to average the storage capacitance over for the soil Matrix solution during semi-analytic spinup (spinup_matrixcn=T)
Normally should be the same as the number of years the atmospheric forcing is run over
</entry>

<entry id="nyr_sasu" type="integer" category="bgc"
group="clm_inparm" valid_values="" value="1">
length of each semi-analytic solution. eg. nyr_SASU=5, analytic solutions will be calculated every five years.
nyr_SASU=1: the fastest SASU, but inaccurate; nyr_SASU=nyr_forcing(eg. 20): the lowest SASU but accurate
</entry>

<entry id="iloop_avg" type="integer" category="bgc"
group="clm_inparm" valid_values="" value="-999">
The restart file will be based on the average of all analytic solutions within the iloop_avg^th loop.
eg. if nyr_forcing = 20, iloop_avg = 8, the restart file in yr 160 will be based on analytic solutions from yr 141 to 160.
The number of the analytic solutions within one loop depends on ratio between nyr_forcing and nyr_SASU.
eg. if nyr_forcing = 20, nyr_SASU = 5, number of analytic solutions is 20/5=4
</entry>

<!-- ======================================================================================== -->
<!-- Former CPP tokens -->
<!-- ======================================================================================== -->
Expand Down Expand Up @@ -1617,20 +1698,6 @@ Mapping method from Nitrogen deposition input file to the model resolution
<!-- Dust namelist and Zender soil erodibility stream -->
<!-- ======================================================================================== -->

<entry id="dust_emis_method" type="char*12" category="physics"
group="clm_inparm" valid_values="Zender_2003,Leung_2023" >
Which dust emission method is going to be used. Either the Zender 2003 scheme or the Leung 2023
scheme.
(NOTE: The Leung 2023 method is NOT currently available)
</entry>

<entry id="zender_soil_erod_source" type="char*3" category="physics"
group="zendersoilerod" valid_values="lnd,atm" >
Option only applying for the Zender_2003 method for whether the soil erodibility file is handled
here in CTSM, or in the ATM model.
(only used when dust_emis_method is Zender_2003)
</entry>

<entry id="zendersoilerod_mapalgo" type="char*256" category="physics"
group="zendersoilerod" valid_values="bilinear,nn,nnoni,nnonj,spval,copy" >
Option only applying for the Zender_2003 method for whether the soil erodibility file is handled
Expand Down Expand Up @@ -1778,19 +1845,44 @@ Mapping method from LAI input file to the model resolution
<!-- ======================================================================================== -->

<!-- Crop calendars -->
<entry id="stream_year_first_cropcal" type="integer" category="datasets"
<entry id="cropcals_rx" type="logical" category="datasets"
group="cropcal_streams" valid_values="" >
Flag to enable prescribed crop calendars (sowing window dates and maturity requirement)
</entry>

<entry id="cropcals_rx_adapt" type="logical" category="datasets"
group="cropcal_streams" valid_values="" >
Flag to enable prescribed crop calendars (sowing window dates and maturity requirement), with maturity requirement adaptive based on recent climate
</entry>

<entry id="stream_year_first_cropcal_swindows" type="integer" category="datasets"
group="cropcal_streams" valid_values="" >
First year to loop over for crop sowing windows
</entry>

<entry id="stream_year_last_cropcal_swindows" type="integer" category="datasets"
group="cropcal_streams" valid_values="" >
Last year to loop over for crop sowing windows
</entry>

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

<entry id="stream_year_first_cropcal_cultivar_gdds" type="integer" category="datasets"
group="cropcal_streams" valid_values="" >
First year to loop over for crop calendar data
First year to loop over for crop maturity requirements
</entry>

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

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

<entry id="allow_invalid_swindow_inputs" type="logical" category="datasets"
Expand All @@ -1813,6 +1905,36 @@ Filename of input stream data for date (day of year) of end of sowing window. Ce
Filename of input stream data for cultivar growing degree-day targets
</entry>

<entry id="stream_fldFileName_gdd20_baseline" type="char*256(30)" category="datasets"
input_pathname="abs" group="cropcal_streams" valid_values="" >
Filename of input stream data for baseline GDD20 values
</entry>

<entry id="stream_gdd20_seasons" type="logical" category="datasets"
group="cropcal_streams" valid_values="" >
Set this to true to read gdd20 accumulation season start and end dates from stream files, rather than using hard-coded hemisphere-specific "warm seasons."
</entry>

<entry id="flush_gdd20" type="logical" category="datasets"
group="clm_inparm" valid_values="" >
Set this to true to flush the accumulated GDD20 variables as soon as possible.
</entry>

<entry id="allow_invalid_gdd20_season_inputs" type="logical" category="datasets"
group="cropcal_streams" valid_values="" >
By default, a value in stream_fldFileName_gdd20_season_start or _end outside the range [1, 365] (or 366 in leap years) will cause the run to fail. Set this to .true. to instead have such cells fall back to the hard-coded hemisphere-specific "warm seasons."
</entry>

<entry id="stream_fldFileName_gdd20_season_start" type="char*256(30)" category="datasets"
input_pathname="abs" group="cropcal_streams" valid_values="" >
Filename of input stream data for date (day of year) of start of gdd20 accumulation season.
</entry>

<entry id="stream_fldFileName_gdd20_season_end" type="char*256(30)" category="datasets"
input_pathname="abs" group="cropcal_streams" valid_values="" >
Filename of input stream data for date (day of year) of end of gdd20 accumulation season.
</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
Expand Down Expand Up @@ -2101,21 +2223,21 @@ How close in years to use when looking for an initial condition file (finidat) i
Simulation years you can look for in initial condition files (finidat) if interpolation is turned on (use_init_interp is .true.)
</entry>

<entry id="clm_accelerated_spinup" type="char*3" category="default_settings"
group="default_settings" valid_values="on,off" >
<entry id="clm_accelerated_spinup" type="char*4" category="default_settings"
group="default_settings" valid_values="on,sasu,off" >
Command line argument for setting up your simulation in a mode for faster
throughput. By default turns off some options, and sets up for a lower level
of output. When bgc_mode is some level of prognostic BGC (so NOT Satellite Phenology)
it also sets up for accelerated decomposition.
it also sets up for accelerated decomposition. The "sasu" mode sets up
for using the CN-matrix mode with Semi-Analytic Spin Up.
NOTE: THIS CORRESPONDS DIRECTLY TO THE env_run.xml VARIABLE OF THE SAME NAME.
Set the env_run variable, rather than setting this directly.
</entry>

<entry id="bgc_mode" type="char*5" category="default_settings"
group="default_settings" valid_values="sp,cn,bgc,fates" >
group="default_settings" valid_values="sp,bgc,fates" >
Command line arguement for biogeochemistry mode for CLM4.5
sp = Satellitte Phenology
cn = Carbon Nitrogen model
bgc = CLM4.5 BGC model with:
CENTURY model pools
Nitrification/De-nitrification
Expand Down
Loading

0 comments on commit 793678f

Please sign in to comment.