Skip to content

Commit f1e0f23

Browse files
authored
Merge pull request ESCOMP#3910 from mvdebolskiy/add-fates-switch
ctsm5.4.039: add new fates namelist switch for dbh init when nocomp is on
2 parents e1f563b + 4212124 commit f1e0f23

15 files changed

Lines changed: 125 additions & 5 deletions

File tree

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
[submodule "fates"]
2929
path = src/fates
3030
url = https://github.com/NGEET/fates
31-
fxtag = sci.1.92.4_api.45.0.0
31+
fxtag = sci.1.92.5_api.46.0.0
3232
fxrequired = AlwaysRequired
3333
# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed
3434
fxDONOTUSEurl = https://github.com/NGEET/fates

bld/CLMBuildNamelist.pm

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ sub setup_cmdl_fates_mode {
816816
} else {
817817
# dis-allow fates specific namelist items with non-fates runs
818818
my @list = ( "fates_spitfire_mode", "use_fates_planthydro", "use_fates_ed_st3", "use_fates_ed_prescribed_phys",
819-
"use_fates_cohort_age_tracking","use_fates_inventory_init","use_fates_fixed_biogeog",
819+
"use_fates_cohort_age_tracking","use_fates_inventory_init","use_fates_dbh_init","use_fates_fixed_biogeog",
820820
"use_fates_nocomp","use_fates_sp","fates_inventory_ctrl_filename","fates_harvest_mode",
821821
"fates_parteh_mode","use_fates_tree_damage","fates_seeddisp_cadence","use_fates_luh","fluh_timeseries",
822822
"flandusepftdat","use_fates_potentialveg","use_fates_lupft","fates_history_dimlevel",
@@ -4896,7 +4896,7 @@ sub setup_logic_fates {
48964896
if (&value_is_true( $nl_flags->{'use_fates'}) ) {
48974897
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fates_paramfile', 'phys'=>$nl_flags->{'phys'});
48984898
my @list = ( "use_fates_planthydro", "use_fates_ed_st3", "use_fates_ed_prescribed_phys",
4899-
"use_fates_inventory_init","fates_seeddisp_cadence","fates_history_dimlevel",
4899+
"use_fates_inventory_init","use_fates_dbh_init","fates_seeddisp_cadence","fates_history_dimlevel",
49004900
"fates_harvest_mode","fates_parteh_mode", "use_fates_cohort_age_tracking","use_fates_tree_damage",
49014901
"use_fates_daylength_factor", "fates_photosynth_acclimation", "fates_stomatal_model",
49024902
"fates_stomatal_assimilation", "fates_leafresp_model", "fates_cstarvation_model",
@@ -4961,6 +4961,10 @@ sub setup_logic_fates {
49614961
}
49624962
}
49634963
}
4964+
my $var = "use_fates_dbh_init";
4965+
if ( &value_is_true($nl->get_value($var)) && ( !&value_is_true($nl->get_value("use_fates_nocomp")))) {
4966+
$log->fatal_error("$var can only be .true. use_fates_nocomp is .true." );
4967+
}
49644968
# make sure that fates landuse x pft mode has the necessary run mode configurations
49654969
my $var = "use_fates_lupft";
49664970
if ( defined($nl->get_value($var)) ) {

bld/namelist_files/namelist_defaults_ctsm.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2715,6 +2715,7 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.4.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2
27152715
<use_fates_ed_st3 use_fates=".true.">.false.</use_fates_ed_st3>
27162716
<use_fates_ed_prescribed_phys use_fates=".true.">.false.</use_fates_ed_prescribed_phys>
27172717
<use_fates_inventory_init use_fates=".true.">.false.</use_fates_inventory_init>
2718+
<use_fates_dbh_init use_fates=".true.">.false.</use_fates_dbh_init>
27182719
<use_fates_sp use_fates=".true.">.false.</use_fates_sp>
27192720
<use_fates_lupft use_fates=".true.">.false.</use_fates_lupft>
27202721
<use_fates_potentialveg use_fates=".true.">.false.</use_fates_potentialveg>

bld/namelist_files/namelist_definition_ctsm.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,14 @@ Full pathname to the inventory initialization control file.
881881
(Only relevant if FATES is on).
882882
</entry>
883883

884+
885+
<entry id="use_fates_dbh_init" type="logical" category="physics"
886+
group="clm_inparm" valid_values="" value=".false.">
887+
Initialize cohorts at coldstart with diameter at breast height instead of density
888+
(Applies only if use_fates_nocomp=.true.)
889+
(Only relevant if FATES is on).
890+
</entry>
891+
884892
<entry id="fates_history_dimlevel" type="integer(2)" category="physics"
885893
group="clm_inparm" valid_values="0,1,2" >
886894
Setting for what types of FATES history to be allocate and

bld/unit_testers/build-namelist_test.pl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ sub cat_and_create_namelistinfile {
165165
#
166166
# Figure out number of tests that will run
167167
#
168-
my $ntests = 3406;
168+
my $ntests = 3407;
169169

170170
if ( defined($opts{'compare'}) ) {
171171
$ntests += 2061;
@@ -1239,6 +1239,10 @@ sub cat_and_create_namelistinfile {
12391239
namelst=>"use_fates_sp=T,use_fates_nocomp=F",
12401240
phys=>"clm5_0",
12411241
},
1242+
"useFATESDBHInitWONoComp" =>{ options=>"-bgc fates -envxml_dir . -no-megan",
1243+
namelst=>"use_fates_dbh_init=T,use_fates_nocomp=F",
1244+
phys=>"clm6_0",
1245+
},
12421246
"useFATESSPwithLUH" =>{ options=>"-bgc fates -envxml_dir . -no-megan",
12431247
namelst=>"use_fates_sp=T,use_fates_luh=T",
12441248
phys=>"clm5_0",

cime_config/testdefs/testlist_clm.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4104,6 +4104,14 @@
41044104
<option name="wallclock">00:40:00</option>
41054105
</options>
41064106
</test>
4107+
<test name="ERS_D_Ld10" grid="f45_f45_mg37" compset="I2000Clm50FatesCruRsGs" testmods="clm/FatesColdNoCompInitDbh">
4108+
<machines>
4109+
<machine name="derecho" compiler="intel" category="fates"/>
4110+
</machines>
4111+
<options>
4112+
<option name="wallclock">00:40:00</option>
4113+
</options>
4114+
</test>
41074115
<test name="SMS_D" grid="1x1_brazil" compset="I2000Clm60FatesSpCruRsGs" testmods="clm/FatesColdSatPhen">
41084116
<machines>
41094117
<machine name="derecho" compiler="intel" category="ctsm_sci"/>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../FatesColdNoComp
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
SRCDIR=`./xmlquery SRCROOT --value`
2+
CASEDIR=`./xmlquery CASEROOT --value`
3+
FATESDIR=$SRCDIR/src/fates/
4+
FATESPARAMFILE=$CASEDIR/fates_params_init_dbh.json
5+
6+
cp $FATESDIR/parameter_files/fates_params_default.json $FATESPARAMFILE
7+
8+
$FATESDIR/tools/modify_fates_paramfile.py --overwrite --fin $FATESPARAMFILE --param fates_recruit_init_seed --values 0.01 --indices all
9+
10+
echo "fates_paramfile = '$FATESPARAMFILE'" >> $CASEDIR/user_nl_clm
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use_fates_dbh_init = .true.

doc/ChangeLog

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,73 @@
1+
==============================================================
2+
Tag name: ctsm5.4.039
3+
Originator(s): mvdebolskiy (Matvey Debolskiy, University of Oslo, matvey.debolskiy@geo.uio.no)
4+
Date: Thu May 14 01:07:45 PM MDT 2026
5+
One-line Summary: Add FATES namelist option to initialize cohorts with diameter at breast height (DBH)
6+
7+
Purpose and description of changes
8+
----------------------------------
9+
10+
FATES allows for the ability to initialize seedling by density or DBH. Prior to this change,
11+
the user would update the `fates_recruit_init_density` parameter to use a negative value to
12+
initalize by DBH. This pull request removes this global switch behavior and creates a namelist
13+
option for the user. The FATES parameter file and behavior has been updated to include a new
14+
parameter for users to set the initial DBH by plant functional type.
15+
16+
Notes of particular relevance for users
17+
---------------------------------------
18+
19+
Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables):
20+
New namelist option to control FATES:
21+
use_fates_dbh_init
22+
23+
Changes made to namelist defaults (e.g., changed parameter values):
24+
Sets the default for use_fates_dbh_init to false
25+
26+
Changes to the parameter file (output of tools/param_utils/compare_paramfiles):
27+
Adds fates_recruit_init_dbh to the FATES parameter file
28+
29+
Notes of particular relevance for developers:
30+
---------------------------------------------
31+
32+
Caveats for developers (e.g., code that is duplicated that requires double maintenance):
33+
- Note that this option currently is only applicable with use_fates_nocomp
34+
35+
Changes to tests or testing:
36+
Added test module FatesColdNoCompInitDbh
37+
38+
Testing summary:
39+
----------------
40+
41+
build-namelist tests (if CLMBuildNamelist.pm has changed):
42+
43+
derecho - OK (2 expected fails)
44+
45+
regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing):
46+
47+
derecho ----- OK
48+
izumi ------- OK
49+
50+
fates tests: (baseline comparison against fates-sci.1.92.4_api.45.0.0-ctsm5.4.037)
51+
derecho ----- OK
52+
izumi ------- OK
53+
54+
Answer changes
55+
--------------
56+
57+
Changes answers relative to baseline: No
58+
59+
Other details
60+
-------------
61+
62+
List any git submodules updated (cime, rtm, mosart, cism, fates, etc.):
63+
fates: sci.1.92.4_api.45.0.0 -> sci.1.92.5_api.46.0.0
64+
65+
Pull Requests that document the changes (include PR ids):
66+
(https://github.com/ESCOMP/ctsm/pull)
67+
https://github.com/ESCOMP/CTSM/pull/3910
68+
https://github.com/NGEET/fates/pull/1550
69+
70+
===============================================================
171
===============================================================
272
Tag name: ctsm5.4.038
373
Originator(s): slevis (Samuel Levis,UCAR/TSS,303-665-1310)

0 commit comments

Comments
 (0)