Skip to content

Commit 17e2acb

Browse files
authored
Merge pull request #1874 from rgknox/fates_v2nutr_compatability
compatabiilty with FATES v2 nutrient API
2 parents fe0fa29 + 8dd3a2c commit 17e2acb

File tree

10 files changed

+117
-17
lines changed

10 files changed

+117
-17
lines changed

Externals_CLM.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
local_path = src/fates
33
protocol = git
44
repo_url = https://github.com/NGEET/fates
5-
tag = sci.1.59.7_api.24.1.0
5+
tag = sci.1.61.0_api.25.0.0
66
required = True
77

88
[externals_description]

bld/namelist_files/namelist_defaults_ctsm.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
492492
<!-- FATES default parameter file -->
493493
<!-- ================================================================== -->
494494

495-
<fates_paramfile>lnd/clm2/paramdata/fates_params_api.24.0.0_12pft_c220608.nc</fates_paramfile>
495+
<fates_paramfile>lnd/clm2/paramdata/fates_params_api.25.0.0_12pft_c221128.nc</fates_paramfile>
496496

497497
<!-- ======================================================================================== -->
498498
<!-- clm 5.0 BGC nitrogen model -->

cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ hist_fincl1 = 'FATES_NCOHORTS', 'FATES_TRIMMING', 'FATES_AREA_PLANTS',
1515
'FATES_FUEL_AMOUNT', 'FATES_LITTER_IN', 'FATES_LITTER_OUT',
1616
'FATES_SEED_BANK', 'FATES_SEEDS_IN', 'FATES_STOREC', 'FATES_VEGC',
1717
'FATES_SAPWOODC', 'FATES_LEAFC', 'FATES_FROOTC', 'FATES_REPROC',
18-
'FATES_CEFFLUX', 'FATES_STRUCTC', 'FATES_NONSTRUCTC', 'FATES_VEGC_ABOVEGROUND',
18+
'FATES_STRUCTC', 'FATES_NONSTRUCTC', 'FATES_VEGC_ABOVEGROUND',
1919
'FATES_CANOPY_VEGC', 'FATES_USTORY_VEGC', 'FATES_PRIMARY_PATCHFUSION_ERR',
2020
'FATES_DISTURBANCE_RATE_P2P', 'FATES_DISTURBANCE_RATE_P2S',
2121
'FATES_DISTURBANCE_RATE_S2S', 'FATES_DISTURBANCE_RATE_FIRE',

cime_config/testdefs/testmods_dirs/clm/FatesColdAllVars/user_nl_clm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,4 @@ hist_fincl1 = 'FATES_CROWNAREA_PF', 'FATES_CANOPYCROWNAREA_PF',
7070
'FATES_CROOTMAINTAR_USTORY_SZ', 'FATES_FROOTMAINTAR_USTORY_SZ',
7171
'FATES_GROWAR_USTORY_SZ', 'FATES_MAINTAR_USTORY_SZ', 'FATES_VEGC_SZPF',
7272
'FATES_LEAFC_SZPF', 'FATES_FROOTC_SZPF', 'FATES_SAPWOODC_SZPF',
73-
'FATES_STOREC_SZPF', 'FATES_REPROC_SZPF', 'FATES_CEFFLUX_SZPF'
73+
'FATES_STOREC_SZPF', 'FATES_REPROC_SZPF'
Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1-
fates_parteh_mode = 2
1+
fates_parteh_mode = 2
2+
hist_fincl1 = 'FATES_L2FR','FATES_L2FR_CANOPY_REC_PF','FATES_L2FR_USTORY_REC_PF',
3+
'FATES_NH4UPTAKE_SZPF','FATES_NO3UPTAKE_SZPF','FATES_NEFFLUX_SZPF',
4+
'FATES_NDEMAND_SZPF','FATES_NFIX_SYM_SZPF','FATES_NH4UPTAKE','FATES_NO3UPTAKE',
5+
'FATES_NEFFLUX','FATES_NDEMAND','FATES_NFIX_SYM','FATES_STOREN','FATES_STOREN_TF',
6+
'FATES_VEGN','FATES_SAPWOODN','FATES_LEAFN','FATES_FROOTN','FATES_REPRON','FATES_VEGN_SZPF',
7+
'FATES_LEAFN_SZPF','FATES_FROOTN_SZPF','FATES_SAPWOODN_SZPF','FATES_STOREN_SZPF','FATES_STOREN_TF_CANOPY_SZPF',
8+
'FATES_STOREN_TF_USTORY_SZPF','FATES_REPRON_SZPF','FATES_STOREP','FATES_STOREP_TF','FATES_VEGP','FATES_SAPWOODP',
9+
'FATES_LEAFP','FATES_FROOTP','FATES_REPROP','FATES_PUPTAKE','FATES_PEFFLUX','FATES_PDEMAND',
10+
'FATES_VEGP_SZPF','FATES_LEAFP_SZPF','FATES_FROOTP_SZPF','FATES_SAPWOODP_SZPF','FATES_STOREP_SZPF',
11+
'FATES_STOREP_TF_CANOPY_SZPF','FATES_STOREP_TF_USTORY_SZPF','FATES_REPROP_SZPF','FATES_PUPTAKE_SZPF',
12+
'FATES_PEFFLUX_SZPF','FATES_PDEMAND_SZPF'

cime_config/usermods_dirs/fates_sp/user_nl_clm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ hist_fexcl1 = 'FATES_TRIMMING', 'FATES_COLD_STATUS', 'FATES_DROUGHT_STATUS', 'FA
1818
'FATES_FUEL_AMOUNT_AP', 'FATES_FUEL_BURNT_BURNFRAC_FC', 'FATES_LITTER_IN', 'FATES_LITTER_OUT', 'FATES_SEED_BANK',
1919
'FATES_SEEDS_IN', 'FATES_LITTER_IN_EL', 'FATES_LITTER_OUT_EL', 'FATES_SEED_BANK_EL', 'FATES_SEEDS_IN_LOCAL_EL',
2020
'FATES_SEEDS_IN_EXTERN_EL', 'FATES_SEED_GERM_EL', 'FATES_SEED_DECAY_EL', 'FATES_STOREC', 'FATES_VEGC',
21-
'FATES_SAPWOODC', 'FATES_FROOTC', 'FATES_REPROC', 'FATES_CEFFLUX', 'FATES_STRUCTC', 'FATES_NONSTRUCTC',
21+
'FATES_SAPWOODC', 'FATES_FROOTC', 'FATES_REPROC', 'FATES_STRUCTC', 'FATES_NONSTRUCTC',
2222
'FATES_VEGC_ABOVEGROUND', 'FATES_CANOPY_VEGC', 'FATES_USTORY_VEGC', 'FATES_PRIMARY_PATCHFUSION_ERR',
2323
'FATES_DISTURBANCE_RATE_P2P', 'FATES_DISTURBANCE_RATE_P2S', 'FATES_DISTURBANCE_RATE_S2S',
2424
'FATES_DISTURBANCE_RATE_FIRE', 'FATES_DISTURBANCE_RATE_LOGGING', 'FATES_DISTURBANCE_RATE_TREEFALL',

doc/ChangeLog

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,81 @@
11
===============================================================
2+
Tag name: ctsm5.1.dev115
3+
Originator(s): rgknox (Ryan Knox)
4+
Date: Fri Dec 2 15:45:32 MST 2022
5+
One-line Summary: API compatability with FATES V2 nutrient dynamics
6+
7+
Purpose and description of changes
8+
----------------------------------
9+
10+
This set of changes allows CTSM to continue API compatability with changes to the FATES API. FATES has updated its nutrient dynamics routine, and required a modification to the test environment, some minor updates to variable dimensions in the history, and a call to a new FATES history routine. Implicitly, the updating of the FATES tag introduces new content in the FATES model since the last API update (mostly bug fixes).
11+
12+
13+
Significant changes to scientifically-supported configurations
14+
--------------------------------------------------------------
15+
16+
17+
The changes here will only affect FATES simulations. Any FATES simulation will be affected. Carbon-only FATES simulations will not have qualitatively different results since the last API update (but will have bit-for-bit differences). Nutrient enabled FATES simulations (not fully coupled to CLM, only via prognosed plant N,P boundaries), and FATES-Hydro simulations (bug fix) will be different.
18+
19+
Bugs fixed or introduced
20+
------------------------
21+
22+
See the descriptions in FATES tags between sci.1.57.4_api.24.0.0 to sci.1.60.0_api.25.0.0 for details on FATES changes in this tag.
23+
24+
CTSM issues fixed (include CTSM Issue #): None
25+
26+
Externals issues fixed (include issue #): None
27+
28+
Known bugs introduced in this tag (include issue #): None
29+
30+
Known bugs found since the previous tag (include issue #): None
31+
32+
33+
Notes of particular relevance for users
34+
---------------------------------------
35+
36+
This set of changes comes with an updated FATES parameter file. This includes format changes only. No changes to variable values were introduced. Format changes are relegated to new parameters and/or name changes only. These changes are encapsulated in: fates/parameter_files/archive/apichange_24.2to25.xml
37+
38+
39+
Notes of particular relevance for developers:
40+
---------------------------------------------
41+
42+
Nothing of note regarding changes for developers.
43+
44+
Changes to tests or testing: New history variables were added to the FATES PRT2 user_nl_clm.
45+
46+
47+
Testing summary:
48+
----------------
49+
50+
regular
51+
52+
regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing):
53+
54+
cheyenne ---- nominal: /glade/scratch/rgknox/tests_1201-121507ch
55+
izumi ------- nominal: /scratch/cluster/rgknox/tests_1201-122133iz
56+
57+
fates tests: (give name of baseline if different from CTSM tagname, normally fates baselines are fates-<FATES TAG>-<CTSM TAG>)
58+
cheyenne ---- nominal against ctsm5.1_dev112 /glade/scratch/rgknox/tests_1130-082657ch
59+
izumi ------- NA
60+
61+
Answer changes
62+
--------------
63+
64+
Changes answers relative to baseline: FATES answers changed relative to base. Explanation already provided (nutrient and hydro changes are qualitative).
65+
66+
67+
Other details
68+
-------------
69+
70+
FATES external was updated.
71+
72+
Pull Requests that document the changes (include PR ids):
73+
74+
https://github.com/ESCOMP/CTSM/pull/1874
75+
https://github.com/NGEET/fates/pull/880
76+
77+
===============================================================
78+
===============================================================
279
Tag name: ctsm5.1.dev114
380
Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326)/@wwieder/@olyson/@ka7eh
481
Date: Sat Nov 19 18:11:15 MST 2022

doc/ChangeSum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Tag Who Date Summary
22
============================================================================================================================
3+
ctsm5.1.dev115 rgknox 12/02/2022 API compatability with FATES V2 nutrient dynamics
34
ctsm5.1.dev114 multiple 11/19/2022 Some NEON updates fixing AG sites, update MOSART, small fixes
45
ctsm5.1.dev113 multiple 10/28/2022 Fix some compsets; add only clauses for ESMF use statements
56
ctsm5.1.dev112 multiple 10/15/2022 Rework fates test definitions and add new fates tests

src/main/histFileMod.F90

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2468,6 +2468,7 @@ subroutine htape_create (t, histrest)
24682468
call ncd_defdim(lnfid, 'fates_levelcwd', num_elements_fates * ncwd, dimid)
24692469
call ncd_defdim(lnfid, 'fates_levelage', num_elements_fates * nlevage, dimid)
24702470
call ncd_defdim(lnfid, 'fates_levagefuel', nlevage * nfsc, dimid)
2471+
call ncd_defdim(lnfid, 'fates_levclscpf', nclmax*nlevsclass*numpft_fates, dimid)
24712472
end if
24722473

24732474
if ( .not. lhistrest )then
@@ -5512,6 +5513,8 @@ subroutine hist_addfld2d (fname, type2d, units, avgflag, long_name, type1d_out,
55125513
num2d = num_elements_fates*nlevage
55135514
case ('fates_levagefuel')
55145515
num2d = nlevage*nfsc
5516+
case('fates_levclscpf')
5517+
num2d = nclmax * nclmax * numpft_fates
55155518
case('cft')
55165519
if (cft_size > 0) then
55175520
num2d = cft_size

src/utils/clmfates_interfaceMod.F90

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,6 +1014,7 @@ subroutine dynamics_driv(this, nc, bounds_clump, &
10141014
! ---------------------------------------------------------------------------------
10151015
call fates_hist%flush_hvars(nc,upfreq_in=1)
10161016

1017+
call fates_hist%flush_hvars(nc,upfreq_in=5)
10171018

10181019
! ---------------------------------------------------------------------------------
10191020
! Part II: Call the FATES model now that input boundary conditions have been
@@ -1088,7 +1089,8 @@ subroutine dynamics_driv(this, nc, bounds_clump, &
10881089
! ---------------------------------------------------------------------------------
10891090
call fates_hist%update_history_dyn( nc, &
10901091
this%fates(nc)%nsites, &
1091-
this%fates(nc)%sites)
1092+
this%fates(nc)%sites, &
1093+
this%fates(nc)%bc_in)
10921094

10931095
if (masterproc) then
10941096
write(iulog, *) 'clm: leaving fates model', bounds_clump%begg, &
@@ -1659,12 +1661,13 @@ subroutine restart( this, bounds_proc, ncid, flag, waterdiagnosticbulk_inst, &
16591661
! ------------------------------------------------------------------------
16601662
call fates_hist%flush_hvars(nc,upfreq_in=1)
16611663
do s = 1,this%fates(nc)%nsites
1662-
call fates_hist%zero_site_hvars(this%fates(nc)%sites(s), &
1664+
call fates_hist%zero_site_hvars(this%fates(nc)%sites(s), &
16631665
upfreq_in=1)
16641666
end do
1665-
call fates_hist%update_history_dyn( nc, &
1666-
this%fates(nc)%nsites, &
1667-
this%fates(nc)%sites)
1667+
call fates_hist%update_history_dyn( nc, &
1668+
this%fates(nc)%nsites, &
1669+
this%fates(nc)%sites, &
1670+
this%fates(nc)%bc_in)
16681671

16691672

16701673
end if
@@ -1831,12 +1834,13 @@ subroutine init_coldstart(this, waterstatebulk_inst, waterdiagnosticbulk_inst, &
18311834
! ------------------------------------------------------------------------
18321835
call fates_hist%flush_hvars(nc,upfreq_in=1)
18331836
do s = 1,this%fates(nc)%nsites
1834-
call fates_hist%zero_site_hvars(this%fates(nc)%sites(s), &
1837+
call fates_hist%zero_site_hvars(this%fates(nc)%sites(s), &
18351838
upfreq_in=1)
18361839
end do
1837-
call fates_hist%update_history_dyn( nc, &
1838-
this%fates(nc)%nsites, &
1839-
this%fates(nc)%sites)
1840+
call fates_hist%update_history_dyn( nc, &
1841+
this%fates(nc)%nsites, &
1842+
this%fates(nc)%sites, &
1843+
this%fates(nc)%bc_in)
18401844

18411845

18421846

@@ -2745,7 +2749,7 @@ subroutine init_history_io(this,bounds_proc)
27452749
use FatesIOVariableKindMod, only : site_can_r8, site_cnlf_r8, site_cnlfpft_r8
27462750
use FatesIOVariableKindMod, only : site_height_r8, site_elem_r8, site_elpft_r8
27472751
use FatesIOVariableKindMod, only : site_elcwd_r8, site_elage_r8, site_agefuel_r8
2748-
use FatesIOVariableKindMod, only : site_cdpf_r8, site_cdsc_r8
2752+
use FatesIOVariableKindMod, only : site_cdpf_r8, site_cdsc_r8, site_clscpf_r8
27492753
use FatesIODimensionsMod, only : fates_bounds_type
27502754

27512755

@@ -2844,7 +2848,7 @@ subroutine init_history_io(this,bounds_proc)
28442848

28452849
case(site_soil_r8, site_size_pft_r8, site_size_r8, site_pft_r8, &
28462850
site_age_r8, site_height_r8, site_coage_r8,site_coage_pft_r8, &
2847-
site_fuel_r8, site_cwdsc_r8, &
2851+
site_fuel_r8, site_cwdsc_r8, site_clscpf_r8, &
28482852
site_can_r8,site_cnlf_r8, site_cnlfpft_r8, site_scag_r8, &
28492853
site_scagpft_r8, site_agepft_r8, site_elem_r8, site_elpft_r8, &
28502854
site_elcwd_r8, site_elage_r8, site_agefuel_r8, &
@@ -3227,6 +3231,10 @@ subroutine hlm_bounds_to_fates_bounds(hlm, fates)
32273231

32283232
fates%cdam_begin = 1
32293233
fates%cdam_end = nlevdamage
3234+
3235+
fates%clscpf_begin = 1
3236+
fates%clscpf_end = numpft_fates * nlevsclass * nclmax
3237+
32303238

32313239
call t_stopf('fates_hlm2fatesbnds')
32323240

0 commit comments

Comments
 (0)