Skip to content

Commit

Permalink
Merge pull request #2904 from glemieux/fates-switch-migration
Browse files Browse the repository at this point in the history
ctsm5.3.027: Migrate FATES parameter file switches to the namelist
  • Loading branch information
adrifoster authored Mar 3, 2025
2 parents df92bc5 + 8020236 commit 7af91e9
Show file tree
Hide file tree
Showing 14 changed files with 338 additions and 51 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.81.0_api.37.1.0
fxtag = sci.1.81.1_api.38.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
12 changes: 10 additions & 2 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,11 @@ sub setup_cmdl_fates_mode {
"use_fates_cohort_age_tracking","use_fates_inventory_init","use_fates_fixed_biogeog",
"use_fates_nocomp","use_fates_sp","fates_inventory_ctrl_filename","fates_harvest_mode",
"fates_parteh_mode","use_fates_tree_damage","fates_seeddisp_cadence","use_fates_luh","fluh_timeseries",
"flandusepftdat","use_fates_potentialveg","use_fates_lupft","fates_history_dimlevel" );
"flandusepftdat","use_fates_potentialveg","use_fates_lupft","fates_history_dimlevel",
"use_fates_daylength_factor", "fates_photosynth_acclimation", "fates_stomatal_model",
"fates_stomatal_assimilation", "fates_leafresp_model", "fates_cstarvation_model",
"fates_regeneration_model", "fates_hydro_solver", "fates_radiation_model", "fates_electron_transport_model"
);

# dis-allow fates specific namelist items with non-fates runs
foreach my $var ( @list ) {
Expand Down Expand Up @@ -4707,7 +4711,11 @@ sub setup_logic_fates {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fates_paramfile', 'phys'=>$nl_flags->{'phys'});
my @list = ( "fates_spitfire_mode", "use_fates_planthydro", "use_fates_ed_st3", "use_fates_ed_prescribed_phys",
"use_fates_inventory_init","fates_seeddisp_cadence","fates_history_dimlevel",
"fates_harvest_mode","fates_parteh_mode", "use_fates_cohort_age_tracking","use_fates_tree_damage" );
"fates_harvest_mode","fates_parteh_mode", "use_fates_cohort_age_tracking","use_fates_tree_damage",
"use_fates_daylength_factor", "fates_photosynth_acclimation", "fates_stomatal_model",
"fates_stomatal_assimilation", "fates_leafresp_model", "fates_cstarvation_model",
"fates_regeneration_model", "fates_hydro_solver", "fates_radiation_model", "fates_electron_transport_model"
);

foreach my $var ( @list ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'use_fates'=>$nl_flags->{'use_fates'},
Expand Down
62 changes: 36 additions & 26 deletions bld/namelist_files/namelist_defaults_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,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.37.1.0_14pft_c250214.nc</fates_paramfile>
<fates_paramfile>lnd/clm2/paramdata/fates_params_api.38.0.0_14pft_c250226.nc</fates_paramfile>


<!-- ================================================================== -->
Expand Down Expand Up @@ -2387,31 +2387,41 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2
<use_nitrif_denitrif >.true.</use_nitrif_denitrif>

<!-- ===== FATES DEFAULTS =========== -->
<fates_spitfire_mode use_fates=".true.">0</fates_spitfire_mode>
<fates_harvest_mode use_fates=".true.">no_harvest</fates_harvest_mode>
<use_fates_planthydro use_fates=".true.">.false.</use_fates_planthydro>
<use_fates_tree_damage use_fates=".true.">.false.</use_fates_tree_damage>
<use_fates_cohort_age_tracking use_fates=".true.">.false.</use_fates_cohort_age_tracking>
<use_fates_ed_st3 use_fates=".true.">.false.</use_fates_ed_st3>
<use_fates_ed_prescribed_phys use_fates=".true.">.false.</use_fates_ed_prescribed_phys>
<use_fates_inventory_init use_fates=".true.">.false.</use_fates_inventory_init>
<use_fates_sp use_fates=".true.">.false.</use_fates_sp>
<use_fates_lupft use_fates=".true.">.false.</use_fates_lupft>
<use_fates_potentialveg use_fates=".true.">.false.</use_fates_potentialveg>
<use_fates_luh use_fates=".true." fates_harvest_mode="luhdata_area" >.true.</use_fates_luh>
<use_fates_luh use_fates=".true." fates_harvest_mode="luhdata_mass" >.true.</use_fates_luh>
<use_fates_luh use_fates=".true." use_fates_lupft=".true.">.true.</use_fates_luh>
<use_fates_luh use_fates=".true." use_fates_potentialveg=".true.">.true.</use_fates_luh>
<use_fates_luh use_fates=".true." >.false.</use_fates_luh>
<fates_parteh_mode use_fates=".true.">1</fates_parteh_mode>
<fates_seeddisp_cadence use_fates=".true.">0</fates_seeddisp_cadence>
<use_fates_nocomp use_fates=".true." use_fates_sp=".true." >.true.</use_fates_nocomp>
<use_fates_nocomp use_fates=".true." use_fates_lupft=".true.">.true.</use_fates_nocomp>
<use_fates_nocomp use_fates=".true." >.false.</use_fates_nocomp>
<use_fates_fixed_biogeog use_fates=".true." use_fates_sp=".true." >.true.</use_fates_fixed_biogeog>
<use_fates_fixed_biogeog use_fates=".true." use_fates_lupft=".true.">.true.</use_fates_fixed_biogeog>
<use_fates_fixed_biogeog use_fates=".true." >.false.</use_fates_fixed_biogeog>
<fates_history_dimlevel use_fates=".true.">2,2</fates_history_dimlevel>
<fates_electron_transport_model use_fates=".true.">FvCB1980</fates_electron_transport_model>
<fates_photosynth_acclimation use_fates=".true.">nonacclimating</fates_photosynth_acclimation>
<fates_spitfire_mode use_fates=".true.">0</fates_spitfire_mode>
<fates_harvest_mode use_fates=".true.">no_harvest</fates_harvest_mode>
<fates_stomatal_model use_fates=".true.">ballberry1987</fates_stomatal_model>
<fates_stomatal_assimilation use_fates=".true.">net</fates_stomatal_assimilation>
<fates_leafresp_model use_fates=".true.">ryan1991</fates_leafresp_model>
<fates_cstarvation_model use_fates=".true.">linear</fates_cstarvation_model>
<fates_regeneration_model use_fates=".true.">default</fates_regeneration_model>
<fates_radiation_model use_fates=".true.">norman</fates_radiation_model>
<fates_hydro_solver use_fates=".true.">2D_Picard</fates_hydro_solver>
<use_fates_planthydro use_fates=".true.">.false.</use_fates_planthydro>
<use_fates_tree_damage use_fates=".true.">.false.</use_fates_tree_damage>
<use_fates_cohort_age_tracking use_fates=".true.">.false.</use_fates_cohort_age_tracking>
<use_fates_daylength_factor use_fates=".true.">.true.</use_fates_daylength_factor>
<use_fates_ed_st3 use_fates=".true.">.false.</use_fates_ed_st3>
<use_fates_ed_prescribed_phys use_fates=".true.">.false.</use_fates_ed_prescribed_phys>
<use_fates_inventory_init use_fates=".true.">.false.</use_fates_inventory_init>
<use_fates_sp use_fates=".true.">.false.</use_fates_sp>
<use_fates_lupft use_fates=".true.">.false.</use_fates_lupft>
<use_fates_potentialveg use_fates=".true.">.false.</use_fates_potentialveg>
<use_fates_luh use_fates=".true." fates_harvest_mode="luhdata_area" >.true.</use_fates_luh>
<use_fates_luh use_fates=".true." fates_harvest_mode="luhdata_mass" >.true.</use_fates_luh>
<use_fates_luh use_fates=".true." use_fates_lupft=".true.">.true.</use_fates_luh>
<use_fates_luh use_fates=".true." use_fates_potentialveg=".true.">.true.</use_fates_luh>
<use_fates_luh use_fates=".true." >.false.</use_fates_luh>
<fates_parteh_mode use_fates=".true.">1</fates_parteh_mode>
<fates_seeddisp_cadence use_fates=".true.">0</fates_seeddisp_cadence>
<use_fates_nocomp use_fates=".true." use_fates_sp=".true." >.true.</use_fates_nocomp>
<use_fates_nocomp use_fates=".true." use_fates_lupft=".true.">.true.</use_fates_nocomp>
<use_fates_nocomp use_fates=".true." >.false.</use_fates_nocomp>
<use_fates_fixed_biogeog use_fates=".true." use_fates_sp=".true." >.true.</use_fates_fixed_biogeog>
<use_fates_fixed_biogeog use_fates=".true." use_fates_lupft=".true.">.true.</use_fates_fixed_biogeog>
<use_fates_fixed_biogeog use_fates=".true." >.false.</use_fates_fixed_biogeog>
<fates_history_dimlevel use_fates=".true.">2,2</fates_history_dimlevel>


<!-- ========================================= -->
Expand Down
58 changes: 58 additions & 0 deletions bld/namelist_files/namelist_definition_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,64 @@ Allowed values are:
This option is older than the luhdata options and may be depricated at some point in the future.
</entry>

<entry id="fates_electron_transport_model" type="char*256" category="physics"
group="elm_inparm" valid_values="FvCB1980,JohnsonBerry2021" value="FvCB1980">
Set the FATES electron transport model to either Johnson-Berry 2021 or
Farquhar von Caemmerer and Berry 1980 (FvCB1980).

</entry>

<entry id="fates_radiation_model" type="char*256" category="physics"
group="clm_inparm" valid_values="norman,twostream" value="norman">
Set the FATES radiation model
</entry>

<entry id="fates_hydro_solver" type="char*256" category="physics"
group="clm_inparm" valid_values="1D_Taylor,2D_Picard,2D_Newton" value="1D_Taylor">
Set the FATES hydro solver method
</entry>

<entry id="fates_regeneration_model" type="char*256" category="physics"
group="clm_inparm" valid_values="default,trs,trs_no_seed_dyn" value="default">
Set the FATES seed regeneration model
Valid values:
default: default scheme
trs: Tree Recruitment Scheme (Hanbury-Brown et al., 2022)
trs_no_seed_dyn: Tree Recruitment Scheme (Hanbury-Brown et al., 2022) without seed dynamics
</entry>

<entry id="fates_cstarvation_model" type="char*256" category="physics"
group="clm_inparm" valid_values="linear,exponential" value="linear">
Set the FATES carbon starvation model
</entry>

<entry id="fates_leafresp_model" type="char*256" category="physics"
group="clm_inparm" valid_values="ryan1991,atkin2017" value="ryan1991">
Set the FATES leaf maintenance respiration model
</entry>

<entry id="fates_stomatal_assimilation" type="char*256" category="physics"
group="clm_inparm" valid_values="net,gross" value="net">
Set net or gross asslimiation for the FATES stomatal model
</entry>

<entry id="fates_stomatal_model" type="char*256" category="physics"
group="clm_inparm" valid_values="ballberry1987,medlyn2011" value="ballberry1987">
Set the FATES stomatal conductance model
</entry>

<entry id="fates_photosynth_acclimation" type="char*256" category="physics"
group="clm_inparm" valid_values="nonacclimating,kumarathunge2019" value="nonacclimating">
Set the FATES photosynthesis temperature acclimation model.
(Only relevant if FATES is on)
</entry>

<entry id="use_fates_daylength_factor" type="logical" category="physics"
group="clm_inparm" valid_values="" value=".true.">
If TRUE, enable FATES to utilize the day length factor from the host land model.
(Only relevant if FATES is on)
</entry>

<entry id="use_fates_planthydro" type="logical" category="physics"
group="clm_inparm" valid_values="" value=".false.">
Toggle to turn on plant hydraulics
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
fates_paramfile = '$CASEROOT/fates_params_twostream.nc'
fates_radiation_model = 'twostream'

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
fates_paramfile = '$CASEROOT/fates_params_twostream.nc'
use_fates_fixed_biogeog=.true.
use_fates_fixed_biogeog=.true.
fates_radiation_model = 'twostream'
95 changes: 93 additions & 2 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,95 @@
===============================================================
Tag name: ctsm5.3.027
Originator(s): glemieux (Gregory Lemieux, LBNL, [email protected])
Date: Sun Mar 2 15:27:01 PST 2025
One-line Summary: FATES parameter file switch migration

Purpose and description of changes
----------------------------------

Move global FATES switches from the FATES parameter file to the namelist.


Significant changes to scientifically-supported configurations
--------------------------------------------------------------

Does this tag change answers significantly for any of the following physics configurations?
(Details of any changes will be given in the "Answer changes" section below.)

[Put an [X] in the box for any configuration with significant answer changes.]

[ ] clm6_0

[ ] clm5_0

[ ] ctsm5_0-nwp

[ ] clm4_5

Notes of particular relevance for users
---------------------------------------

Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables):

The following FATES namelist options are now available:
- use_fates_daylength_factor
- fates_photosynth_acclimation
- fates_stomatal_model
- fates_stomatal_assimilation
- fates_leafresp_model
- fates_cstarvation_model
- fates_regeneration_model
- fates_hydro_solver
- fates_radiation_model

The following FATES namelist option is available, but not yet implemented in FATES:
- fates_electron_transport_model

Notes of particular relevance for developers:
---------------------------------------------
Changes to tests or testing:

The FATES two stream tests no longer generation a FATES NetCDF parameter file on-the-fly.
The need to do so is removed as the fates_radiation_model option is controlled by the
namelist.


Testing summary:
----------------

build-namelist tests (if CLMBuildNamelist.pm has changed):

derecho - PASS

regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing):

derecho ----- OK
izumi ------- OK

fates tests: (give name of baseline if different from CTSM tagname, normally fates baselines are fates-<FATES TAG>-<CTSM TAG>)
derecho ----- OK
izumi ------- OK


Answer changes
--------------

Changes answers relative to baseline: No

Other details
-------------

List any git submodules updated (cime, rtm, mosart, cism, fates, etc.):
fates: sci.1.81.0_api.37.1.0 -> sci.1.81.1_api.38.0.0

Pull Requests that document the changes (include PR ids):
(https://github.com/ESCOMP/ctsm/pull)
https://github.com/ESCOMP/CTSM/pull/2904
https://github.com/NGEET/fates/pull/1300
https://github.com/NGEET/fates/pull/1344

===============================================================
===============================================================
Tag name: ctsm5.3.026
Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326)
Date: Wed 26 Feb 2025 09:55:48 AM MST
Expand Down Expand Up @@ -138,8 +229,8 @@ Testing summary:

regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing):

derecho -----
izumi -------
derecho ----- OK
izumi ------- OK

fates tests: (give name of baseline if different from CTSM tagname, normally fates baselines are fates-<FATES TAG>-<CTSM TAG>)
derecho ----- OK
Expand Down
1 change: 1 addition & 0 deletions doc/ChangeSum
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Tag Who Date Summary
============================================================================================================================
ctsm5.3.027 glemieux 03/02/2025 FATES parameter file switch migration
ctsm5.3.026 samrabin 02/26/2025 Merge b4b-dev to master: run_tower updates, reduce log noise
ctsm5.3.025 glemieux 02/20/2025 FATES default parameter file update
ctsm5.3.024 xinchang 02/11/2025 Change choice of pressure in CLMU building energy model
Expand Down
11 changes: 11 additions & 0 deletions src/main/clm_varctl.F90
Original file line number Diff line number Diff line change
Expand Up @@ -331,13 +331,24 @@ module clm_varctl
! see bld/namelist_files/namelist_definition_clm4_5.xml for details
logical, public :: use_fates_tree_damage = .false. ! true => turn on tree damage module
character(len=256), public :: fates_harvest_mode = '' ! five different harvest modes; see namelist definition
character(len=256), public :: fates_stomatal_model = '' ! stomatal conductance model, Ball-berry or Medlyn
character(len=256), public :: fates_stomatal_assimilation = '' ! net or gross assimilation modes
character(len=256), public :: fates_leafresp_model = '' ! Leaf maintenance respiration model, Ryan or Atkin
character(len=256), public :: fates_cstarvation_model = '' ! linear or exponential function
character(len=256), public :: fates_regeneration_model = '' ! default, TRS, or TRS without seed dynamics
character(len=256), public :: fates_radiation_model = '' ! Norman or two-stream radiation model
character(len=256), public :: fates_hydro_solver = '' ! 1D Taylor, 2D Picard, 2D Newton
character(len=256), public :: fates_photosynth_acclimation = '' ! nonacclimating, kumarathunge2019
character(len=256), public :: fates_electron_transport_model = '' ! Johnson-Berry 2021 or Farquhar von Caemmerer and Berry 1980
logical, public :: use_fates_planthydro = .false. ! true => turn on fates hydro
logical, public :: use_fates_cohort_age_tracking = .false. ! true => turn on cohort age tracking
logical, public :: use_fates_ed_st3 = .false. ! true => static stand structure
logical, public :: use_fates_ed_prescribed_phys = .false. ! true => prescribed physiology
logical, public :: use_fates_inventory_init = .false. ! true => initialize fates from inventory
logical, public :: use_fates_fixed_biogeog = .false. ! true => use fixed biogeography mode
logical, public :: use_fates_nocomp = .false. ! true => use no comopetition mode
logical, public :: use_fates_daylength_factor = .false. ! true => enable fates to use host land model daylength factor


! FATES history dimension level
! fates can produce history at either the daily timescale (dynamics)
Expand Down
Loading

0 comments on commit 7af91e9

Please sign in to comment.