@@ -82,6 +82,12 @@ module FatesHistoryInterfaceMod
8282
8383 ! Indices to site by size-class by pft variables
8484 integer , private :: ih_nplant_si_scag
85+ integer , private :: ih_nplant_canopy_si_scag
86+ integer , private :: ih_nplant_understory_si_scag
87+ integer , private :: ih_ddbh_canopy_si_scag
88+ integer , private :: ih_ddbh_understory_si_scag
89+ integer , private :: ih_mortality_canopy_si_scag
90+ integer , private :: ih_mortality_understory_si_scag
8591
8692 ! Indices to (site) variables
8793 integer , private :: ih_nep_si
@@ -169,6 +175,8 @@ module FatesHistoryInterfaceMod
169175 integer , private :: ih_trimming_understory_si_scls
170176 integer , private :: ih_crown_area_canopy_si_scls
171177 integer , private :: ih_crown_area_understory_si_scls
178+ integer , private :: ih_ddbh_canopy_si_scls
179+ integer , private :: ih_ddbh_understory_si_scls
172180
173181 ! lots of non-default diagnostics for understanding canopy versus understory carbon balances
174182 integer , private :: ih_rdark_canopy_si_scls
@@ -1186,6 +1194,8 @@ subroutine update_history_dyn(this,nc,nsites,sites)
11861194 hio_nplant_understory_si_scpf = > this% hvars(ih_nplant_understory_si_scpf)% r8 2d, &
11871195 hio_ddbh_canopy_si_scpf = > this% hvars(ih_ddbh_canopy_si_scpf)% r8 2d, &
11881196 hio_ddbh_understory_si_scpf = > this% hvars(ih_ddbh_understory_si_scpf)% r8 2d, &
1197+ hio_ddbh_canopy_si_scls = > this% hvars(ih_ddbh_canopy_si_scls)% r8 2d, &
1198+ hio_ddbh_understory_si_scls = > this% hvars(ih_ddbh_understory_si_scls)% r8 2d, &
11891199 hio_gpp_canopy_si_scpf = > this% hvars(ih_gpp_canopy_si_scpf)% r8 2d, &
11901200 hio_gpp_understory_si_scpf = > this% hvars(ih_gpp_understory_si_scpf)% r8 2d, &
11911201 hio_ar_canopy_si_scpf = > this% hvars(ih_ar_canopy_si_scpf)% r8 2d, &
@@ -1258,7 +1268,13 @@ subroutine update_history_dyn(this,nc,nsites,sites)
12581268 hio_cwd_bg_out_si_cwdsc = > this% hvars(ih_cwd_bg_out_si_cwdsc)% r8 2d, &
12591269 hio_crownarea_si_cnlf = > this% hvars(ih_crownarea_si_cnlf)% r8 2d, &
12601270 hio_crownarea_si_can = > this% hvars(ih_crownarea_si_can)% r8 2d, &
1261- hio_nplant_si_scag = > this% hvars(ih_nplant_si_scag)% r8 2d)
1271+ hio_nplant_si_scag = > this% hvars(ih_nplant_si_scag)% r8 2d, &
1272+ hio_nplant_canopy_si_scag = > this% hvars(ih_nplant_canopy_si_scag)% r8 2d, &
1273+ hio_nplant_understory_si_scag = > this% hvars(ih_nplant_understory_si_scag)% r8 2d, &
1274+ hio_ddbh_canopy_si_scag = > this% hvars(ih_ddbh_canopy_si_scag)% r8 2d, &
1275+ hio_ddbh_understory_si_scag = > this% hvars(ih_ddbh_understory_si_scag)% r8 2d, &
1276+ hio_mortality_canopy_si_scag = > this% hvars(ih_mortality_canopy_si_scag)% r8 2d, &
1277+ hio_mortality_understory_si_scag = > this% hvars(ih_mortality_understory_si_scag)% r8 2d)
12621278
12631279
12641280 ! ---------------------------------------------------------------------------------
@@ -1450,13 +1466,18 @@ subroutine update_history_dyn(this,nc,nsites,sites)
14501466
14511467 ! update SCPF/SCLS- and canopy/subcanopy- partitioned quantities
14521468 if (ccohort% canopy_layer .eq. 1 ) then
1469+ hio_nplant_canopy_si_scag(io_si,iscag) = hio_nplant_canopy_si_scag(io_si,iscag) + ccohort% n
1470+ hio_mortality_canopy_si_scag(io_si,iscag) = hio_mortality_canopy_si_scag(io_si,iscag) + &
1471+ (ccohort% bmort + ccohort% hmort + ccohort% cmort + ccohort% fmort) * ccohort% n
1472+ hio_ddbh_canopy_si_scag(io_si,iscag) = hio_ddbh_canopy_si_scag(io_si,iscag) + &
1473+ ccohort% ddbhdt* ccohort% n
14531474 hio_bstor_canopy_si_scpf(io_si,scpf) = hio_bstor_canopy_si_scpf(io_si,scpf) + &
14541475 ccohort% bstore * ccohort% n
14551476 hio_bleaf_canopy_si_scpf(io_si,scpf) = hio_bleaf_canopy_si_scpf(io_si,scpf) + &
14561477 ccohort% bl * ccohort% n
14571478 hio_canopy_biomass_pa(io_pa) = hio_canopy_biomass_pa(io_pa) + n_density * ccohort% b * g_per_kg
14581479 hio_mortality_canopy_si_scpf(io_si,scpf) = hio_mortality_canopy_si_scpf(io_si,scpf)+ &
1459- (ccohort% bmort + ccohort% hmort + ccohort% cmort + ccohort% imort + ccohort % fmort) * ccohort% n
1480+ (ccohort% bmort + ccohort% hmort + ccohort% cmort + ccohort% fmort) * ccohort% n
14601481 hio_nplant_canopy_si_scpf(io_si,scpf) = hio_nplant_canopy_si_scpf(io_si,scpf) + ccohort% n
14611482 hio_nplant_canopy_si_scls(io_si,scls) = hio_nplant_canopy_si_scls(io_si,scls) + ccohort% n
14621483 hio_trimming_canopy_si_scls(io_si,scls) = hio_trimming_canopy_si_scls(io_si,scls) + &
@@ -1470,11 +1491,13 @@ subroutine update_history_dyn(this,nc,nsites,sites)
14701491 ! growth increment
14711492 hio_ddbh_canopy_si_scpf(io_si,scpf) = hio_ddbh_canopy_si_scpf(io_si,scpf) + &
14721493 ccohort% ddbhdt* ccohort% n
1494+ hio_ddbh_canopy_si_scls(io_si,scls) = hio_ddbh_canopy_si_scls(io_si,scls) + &
1495+ ccohort% ddbhdt* ccohort% n
14731496 ! sum of all mortality
14741497 hio_mortality_canopy_si_scls(io_si,scls) = hio_mortality_canopy_si_scls(io_si,scls) + &
1475- (ccohort% bmort + ccohort% hmort + ccohort% cmort + ccohort% imort + ccohort % fmort) * ccohort% n
1498+ (ccohort% bmort + ccohort% hmort + ccohort% cmort + ccohort% fmort) * ccohort% n
14761499 hio_canopy_mortality_carbonflux_si(io_si) = hio_canopy_mortality_carbonflux_si(io_si) + &
1477- (ccohort% bmort + ccohort% hmort + ccohort% cmort + ccohort% imort + ccohort % fmort) * &
1500+ (ccohort% bmort + ccohort% hmort + ccohort% cmort + ccohort% fmort) * &
14781501 ccohort% b * ccohort% n * g_per_kg * days_per_sec * years_per_day * ha_per_m2
14791502 !
14801503 hio_leaf_md_canopy_si_scls(io_si,scls) = hio_leaf_md_canopy_si_scls(io_si,scls) + &
@@ -1509,13 +1532,18 @@ subroutine update_history_dyn(this,nc,nsites,sites)
15091532 hio_yesterdaycanopylevel_canopy_si_scls(io_si,scls) + &
15101533 ccohort% canopy_layer_yesterday * ccohort% n
15111534 else
1535+ hio_nplant_understory_si_scag(io_si,iscag) = hio_nplant_understory_si_scag(io_si,iscag) + ccohort% n
1536+ hio_mortality_understory_si_scag(io_si,iscag) = hio_mortality_understory_si_scag(io_si,iscag) + &
1537+ (ccohort% bmort + ccohort% hmort + ccohort% cmort + ccohort% fmort) * ccohort% n
1538+ hio_ddbh_understory_si_scag(io_si,iscag) = hio_ddbh_understory_si_scag(io_si,iscag) + &
1539+ ccohort% ddbhdt* ccohort% n
15121540 hio_bstor_understory_si_scpf(io_si,scpf) = hio_bstor_understory_si_scpf(io_si,scpf) + &
15131541 ccohort% bstore * ccohort% n
15141542 hio_bleaf_understory_si_scpf(io_si,scpf) = hio_bleaf_understory_si_scpf(io_si,scpf) + &
15151543 ccohort% bl * ccohort% n
15161544 hio_understory_biomass_pa(io_pa) = hio_understory_biomass_pa(io_pa) + n_density * ccohort% b * g_per_kg
15171545 hio_mortality_understory_si_scpf(io_si,scpf) = hio_mortality_understory_si_scpf(io_si,scpf)+ &
1518- (ccohort% bmort + ccohort% hmort + ccohort% cmort + ccohort% imort + ccohort % fmort) * ccohort% n
1546+ (ccohort% bmort + ccohort% hmort + ccohort% cmort + ccohort% fmort) * ccohort% n
15191547 hio_nplant_understory_si_scpf(io_si,scpf) = hio_nplant_understory_si_scpf(io_si,scpf) + ccohort% n
15201548 hio_nplant_understory_si_scls(io_si,scls) = hio_nplant_understory_si_scls(io_si,scls) + ccohort% n
15211549 hio_trimming_understory_si_scls(io_si,scls) = hio_trimming_understory_si_scls(io_si,scls) + &
@@ -1529,11 +1557,13 @@ subroutine update_history_dyn(this,nc,nsites,sites)
15291557 ! growth increment
15301558 hio_ddbh_understory_si_scpf(io_si,scpf) = hio_ddbh_understory_si_scpf(io_si,scpf) + &
15311559 ccohort% ddbhdt* ccohort% n
1560+ hio_ddbh_understory_si_scls(io_si,scls) = hio_ddbh_understory_si_scls(io_si,scls) + &
1561+ ccohort% ddbhdt* ccohort% n
15321562 ! sum of all mortality
15331563 hio_mortality_understory_si_scls(io_si,scls) = hio_mortality_understory_si_scls(io_si,scls) + &
1534- (ccohort% bmort + ccohort% hmort + ccohort% cmort + ccohort% imort + ccohort % fmort) * ccohort% n
1564+ (ccohort% bmort + ccohort% hmort + ccohort% cmort + ccohort% fmort) * ccohort% n
15351565 hio_understory_mortality_carbonflux_si(io_si) = hio_understory_mortality_carbonflux_si(io_si) + &
1536- (ccohort% bmort + ccohort% hmort + ccohort% cmort + ccohort% imort + ccohort % fmort) * &
1566+ (ccohort% bmort + ccohort% hmort + ccohort% cmort + ccohort% fmort) * &
15371567 ccohort% b * ccohort% n * g_per_kg * days_per_sec * years_per_day * ha_per_m2
15381568 !
15391569 hio_leaf_md_understory_si_scls(io_si,scls) = hio_leaf_md_understory_si_scls(io_si,scls) + &
@@ -1569,6 +1599,17 @@ subroutine update_history_dyn(this,nc,nsites,sites)
15691599 ccohort% canopy_layer_yesterday * ccohort% n
15701600 endif
15711601 !
1602+ ! consider imort as understory mortality even if it happens in cohorts that may have been promoted as part of the patch creation...
1603+ hio_mortality_understory_si_scpf(io_si,scpf) = hio_mortality_understory_si_scpf(io_si,scpf)+ &
1604+ (ccohort% imort) * ccohort% n
1605+ hio_mortality_understory_si_scls(io_si,scls) = hio_mortality_understory_si_scls(io_si,scls) + &
1606+ (ccohort% imort) * ccohort% n
1607+ hio_understory_mortality_carbonflux_si(io_si) = hio_understory_mortality_carbonflux_si(io_si) + &
1608+ (ccohort% imort) * &
1609+ ccohort% b * ccohort% n * g_per_kg * days_per_sec * years_per_day * ha_per_m2
1610+ hio_mortality_understory_si_scag(io_si,iscag) = hio_mortality_understory_si_scag(io_si,iscag) + &
1611+ (ccohort% imort) * ccohort% n
1612+ !
15721613 ccohort% canopy_layer_yesterday = real (ccohort% canopy_layer, r8 )
15731614
15741615 end associate
@@ -2912,6 +2953,36 @@ subroutine define_history_vars(this, initialize_variables)
29122953 avgflag= ' A' , vtype= site_scag_r8 , hlms= ' CLM:ALM' , flushval= 0.0_r8 , &
29132954 upfreq= 1 , ivar= ivar, initialize= initialize_variables, index = ih_nplant_si_scag )
29142955
2956+ call this% set_history_var(vname= ' NPLANT_CANOPY_SCAG' ,units = ' plants/ha' , &
2957+ long= ' number of plants per hectare in canopy in each size x age class' , use_default= ' inactive' , &
2958+ avgflag= ' A' , vtype= site_scag_r8 , hlms= ' CLM:ALM' , flushval= 0.0_r8 , &
2959+ upfreq= 1 , ivar= ivar, initialize= initialize_variables, index = ih_nplant_canopy_si_scag )
2960+
2961+ call this% set_history_var(vname= ' NPLANT_UNDERSTORY_SCAG' ,units = ' plants/ha' , &
2962+ long= ' number of plants per hectare in understory in each size x age class' , use_default= ' inactive' , &
2963+ avgflag= ' A' , vtype= site_scag_r8 , hlms= ' CLM:ALM' , flushval= 0.0_r8 , &
2964+ upfreq= 1 , ivar= ivar, initialize= initialize_variables, index = ih_nplant_understory_si_scag )
2965+
2966+ call this% set_history_var(vname= ' DDBH_CANOPY_SCAG' ,units = ' cm/yr/ha' , &
2967+ long= ' growth rate of canopy plantsnumber of plants per hectare in canopy in each size x age class' , use_default= ' inactive' , &
2968+ avgflag= ' A' , vtype= site_scag_r8 , hlms= ' CLM:ALM' , flushval= 0.0_r8 , &
2969+ upfreq= 1 , ivar= ivar, initialize= initialize_variables, index = ih_ddbh_canopy_si_scag )
2970+
2971+ call this% set_history_var(vname= ' DDBH_UNDERSTORY_SCAG' ,units = ' cm/yr/ha' , &
2972+ long= ' growth rate of understory plants in each size x age class' , use_default= ' inactive' , &
2973+ avgflag= ' A' , vtype= site_scag_r8 , hlms= ' CLM:ALM' , flushval= 0.0_r8 , &
2974+ upfreq= 1 , ivar= ivar, initialize= initialize_variables, index = ih_ddbh_understory_si_scag )
2975+
2976+ call this% set_history_var(vname= ' MORTALITY_CANOPY_SCAG' ,units = ' plants/ha/yr' , &
2977+ long= ' mortality rate of canopy plants in each size x age class' , use_default= ' inactive' , &
2978+ avgflag= ' A' , vtype= site_scag_r8 , hlms= ' CLM:ALM' , flushval= 0.0_r8 , &
2979+ upfreq= 1 , ivar= ivar, initialize= initialize_variables, index = ih_mortality_canopy_si_scag )
2980+
2981+ call this% set_history_var(vname= ' MORTALITY_UNDERSTORY_SCAG' ,units = ' plants/ha/yr' , &
2982+ long= ' mortality rate of understory plantsin each size x age class' , use_default= ' inactive' , &
2983+ avgflag= ' A' , vtype= site_scag_r8 , hlms= ' CLM:ALM' , flushval= 0.0_r8 , &
2984+ upfreq= 1 , ivar= ivar, initialize= initialize_variables, index = ih_mortality_understory_si_scag )
2985+
29152986
29162987 ! Carbon Flux (grid dimension x scpf) (THESE ARE DEFAULT INACTIVE!!!
29172988 ! (BECAUSE THEY TAKE UP SPACE!!!
@@ -3152,6 +3223,16 @@ subroutine define_history_vars(this, initialize_variables)
31523223
31533224 ! size-class only variables
31543225
3226+ call this% set_history_var(vname= ' DDBH_CANOPY_SCLS' , units = ' cm/yr/ha' , &
3227+ long= ' diameter growth increment by pft/size' ,use_default= ' inactive' , &
3228+ avgflag= ' A' , vtype= site_size_r8 , hlms= ' CLM:ALM' , flushval= 0.0_r8 , &
3229+ upfreq= 1 , ivar= ivar, initialize= initialize_variables, index = ih_ddbh_canopy_si_scls )
3230+
3231+ call this% set_history_var(vname= ' DDBH_UNDERSTORY_SCLS' , units = ' cm/yr/ha' , &
3232+ long= ' diameter growth increment by pft/size' ,use_default= ' inactive' , &
3233+ avgflag= ' A' , vtype= site_size_r8 , hlms= ' CLM:ALM' , flushval= 0.0_r8 , &
3234+ upfreq= 1 , ivar= ivar, initialize= initialize_variables, index = ih_ddbh_understory_si_scls )
3235+
31553236 call this% set_history_var(vname= ' YESTERDAYCANLEV_CANOPY_SCLS' , units = ' indiv/ha' , &
31563237 long= ' Yesterdays canopy level for canopy plants by size class' , use_default= ' inactive' , &
31573238 avgflag= ' A' , vtype= site_size_r8 , hlms= ' CLM:ALM' , flushval= 0.0_r8 , &
0 commit comments