Skip to content

Commit 5dbff93

Browse files
committed
Merge resolution with master, resolved kmax_rsurf1 name change in EDParamsMod.
2 parents 7042533 + f1d4bc5 commit 5dbff93

18 files changed

+1034
-646
lines changed

biogeochem/EDCohortDynamicsMod.F90

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ module EDCohortDynamicsMod
1414
use FatesConstantsMod , only : itrue,ifalse
1515
use FatesConstantsMod , only : fates_unset_r8
1616
use FatesConstantsMod , only : nearzero
17+
use FatesConstantsMod , only : calloc_abs_error
1718
use FatesInterfaceMod , only : hlm_days_per_year
1819
use FatesInterfaceMod , only : nleafage
1920
use EDPftvarcon , only : EDPftvarcon_inst
@@ -47,6 +48,10 @@ module EDCohortDynamicsMod
4748
use FatesSizeAgeTypeIndicesMod, only : sizetype_class_index
4849
use FatesAllometryMod , only : bleaf
4950
use FatesAllometryMod , only : bfineroot
51+
use FatesAllometryMod , only : bsap_allom
52+
use FatesAllometryMod , only : bagw_allom
53+
use FatesAllometryMod , only : bbgw_allom
54+
use FatesAllometryMod , only : bdead_allom
5055
use FatesAllometryMod , only : h_allom
5156
use FatesAllometryMod , only : carea_allom
5257
use FatesAllometryMod , only : ForceDBH
@@ -93,6 +98,7 @@ module EDCohortDynamicsMod
9398
public :: count_cohorts
9499
public :: InitPRTCohort
95100
public :: UpdateCohortBioPhysRates
101+
public :: EvaluateAndCorrectDBH
96102

97103
logical, parameter :: debug = .false. ! local debug flag
98104

@@ -1706,4 +1712,90 @@ end subroutine UpdateCohortBioPhysRates
17061712

17071713
! ============================================================================
17081714

1715+
1716+
subroutine EvaluateAndCorrectDBH(currentCohort,delta_dbh,delta_hite)
1717+
1718+
! -----------------------------------------------------------------------------------
1719+
! If the current diameter of a plant is somehow less than what is allometrically
1720+
! consistent with stuctural biomass (or, in the case of grasses, leaf biomass)
1721+
! then correct (increase) the dbh to match that.
1722+
! -----------------------------------------------------------------------------------
1723+
1724+
! argument
1725+
type(ed_cohort_type),intent(inout) :: currentCohort
1726+
real(r8),intent(out) :: delta_dbh
1727+
real(r8),intent(out) :: delta_hite
1728+
1729+
! locals
1730+
real(r8) :: dbh
1731+
real(r8) :: canopy_trim
1732+
integer :: ipft
1733+
real(r8) :: sapw_area
1734+
real(r8) :: target_sapw_c
1735+
real(r8) :: target_agw_c
1736+
real(r8) :: target_bgw_c
1737+
real(r8) :: target_struct_c
1738+
real(r8) :: target_leaf_c
1739+
real(r8) :: struct_c
1740+
real(r8) :: hite_out
1741+
real(r8) :: leaf_c
1742+
1743+
dbh = currentCohort%dbh
1744+
ipft = currentCohort%pft
1745+
canopy_trim = currentCohort%canopy_trim
1746+
1747+
delta_dbh = 0._r8
1748+
delta_hite = 0._r8
1749+
1750+
if( EDPftvarcon_inst%woody(ipft) == itrue) then
1751+
1752+
struct_c = currentCohort%prt%GetState(struct_organ, all_carbon_elements)
1753+
1754+
! Target sapwood biomass according to allometry and trimming [kgC]
1755+
call bsap_allom(dbh,ipft,canopy_trim,sapw_area,target_sapw_c)
1756+
1757+
! Target total above ground biomass in woody/fibrous tissues [kgC]
1758+
call bagw_allom(dbh,ipft,target_agw_c)
1759+
1760+
! Target total below ground biomass in woody/fibrous tissues [kgC]
1761+
call bbgw_allom(dbh,ipft,target_bgw_c)
1762+
1763+
! Target total dead (structrual) biomass [kgC]
1764+
call bdead_allom( target_agw_c, target_bgw_c, target_sapw_c, ipft, target_struct_c)
1765+
1766+
! ------------------------------------------------------------------------------------
1767+
! If structure is larger than target, then we need to correct some integration errors
1768+
! by slightly increasing dbh to match it.
1769+
! For grasses, if leaf biomass is larger than target, then we reset dbh to match
1770+
! -----------------------------------------------------------------------------------
1771+
1772+
if( (struct_c - target_struct_c ) > calloc_abs_error ) then
1773+
call ForceDBH( ipft, canopy_trim, dbh, hite_out, bdead=struct_c )
1774+
delta_dbh = dbh - currentCohort%dbh
1775+
delta_hite = hite_out - currentCohort%hite
1776+
currentCohort%dbh = dbh
1777+
currentCohort%hite = hite_out
1778+
end if
1779+
1780+
else
1781+
1782+
! This returns the sum of leaf carbon over all (age) bins
1783+
leaf_c = currentCohort%prt%GetState(leaf_organ, all_carbon_elements)
1784+
1785+
! Target leaf biomass according to allometry and trimming
1786+
call bleaf(dbh,ipft,canopy_trim,target_leaf_c)
1787+
1788+
if( ( leaf_c - target_leaf_c ) > calloc_abs_error ) then
1789+
call ForceDBH( ipft, canopy_trim, dbh, hite_out, bl=leaf_c )
1790+
delta_dbh = dbh - currentCohort%dbh
1791+
delta_hite = hite_out - currentCohort%hite
1792+
currentCohort%dbh = dbh
1793+
currentCohort%hite = hite_out
1794+
end if
1795+
1796+
end if
1797+
return
1798+
end subroutine EvaluateAndCorrectDBH
1799+
1800+
17091801
end module EDCohortDynamicsMod

biogeochem/EDLoggingMortalityMod.F90

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ module EDLoggingMortalityMod
5959

6060
character(len=*), parameter, private :: sourcefile = &
6161
__FILE__
62+
63+
64+
real(r8), public, parameter :: logging_export_frac = 0.8_r8
6265

6366
public :: LoggingMortality_frac
6467
public :: logging_litter_fluxes
@@ -170,6 +173,8 @@ subroutine LoggingMortality_frac( pft_i, dbh, canopy_layer, lmort_direct, &
170173
real(r8), parameter :: adjustment = 1.0 ! adjustment for mortality rates
171174

172175
if (logging_time) then
176+
177+
173178
if(EDPftvarcon_inst%woody(pft_i) == 1)then ! only set logging rates for trees
174179

175180
! Pass logging rates to cohort level
@@ -192,8 +197,14 @@ subroutine LoggingMortality_frac( pft_i, dbh, canopy_layer, lmort_direct, &
192197

193198
! Collateral damage to smaller plants below the canopy layer
194199
! will be applied via "understory_death" via the disturbance algorithm
200+
! Important: Degredation rates really only have an impact when
201+
! applied to the canopy layer. So we don't add to degredation
202+
! for collateral damage, even understory collateral damage.
203+
195204
if (canopy_layer .eq. 1) then
196205
lmort_collateral = logging_collateral_frac * adjustment
206+
else
207+
lmort_collateral = 0._r8
197208
endif
198209

199210
else
@@ -202,6 +213,7 @@ subroutine LoggingMortality_frac( pft_i, dbh, canopy_layer, lmort_direct, &
202213
lmort_infra = 0.0_r8
203214
l_degrad = 0.0_r8
204215
end if
216+
205217
else
206218
lmort_direct = 0.0_r8
207219
lmort_collateral = 0.0_r8
@@ -309,10 +321,19 @@ subroutine logging_litter_fluxes(currentSite, currentPatch, newPatch, patch_site
309321
(currentCohort%lmort_collateral + currentCohort%lmort_infra)
310322

311323
else
324+
325+
! This routine is only called during disturbance. The litter
326+
! fluxes from non-disturbance generating mortality are
327+
! handled in EDPhysiology. Disturbance generating mortality
328+
! are those cohorts in the top canopy layer, or those
329+
! plants that were impacted. Thus, no direct dead can occur
330+
! here, and indirect are impacts.
331+
312332
if(EDPftvarcon_inst%woody(currentCohort%pft) == 1)then
313333
direct_dead = 0.0_r8
314-
indirect_dead = logging_coll_under_frac * currentCohort%n * &
315-
(patch_site_areadis/currentPatch%area) !kgC/site/day
334+
indirect_dead = logging_coll_under_frac * &
335+
(1._r8-currentPatch%fract_ldist_not_harvested) * currentCohort%n * &
336+
(patch_site_areadis/currentPatch%area) !kgC/site/day
316337
else
317338
! If the cohort of interest is grass, it will not experience
318339
! any mortality associated with the logging disturbance

biogeochem/EDMortalityFunctionsMod.F90

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,15 +200,18 @@ subroutine Mortality_Derivative( currentSite, currentCohort, bc_in)
200200
currentCohort%lmort_infra, &
201201
currentCohort%l_degrad)
202202

203+
204+
205+
203206
if (currentCohort%canopy_layer > 1)then
204-
205207
! Include understory logging mortality rates not associated with disturbance
206208
dndt_logging = (currentCohort%lmort_direct + &
207209
currentCohort%lmort_collateral + &
208210
currentCohort%lmort_infra)/hlm_freq_day
209-
210211
currentCohort%dndt = -1.0_r8 * (cmort+hmort+bmort+frmort+dndt_logging) * currentCohort%n
211212
else
213+
! Mortality from logging in the canopy is ONLY disturbance generating, don't
214+
! update number densities via non-disturbance inducing death
212215
currentCohort%dndt = -(1.0_r8 - fates_mortality_disturbance_fraction) &
213216
* (cmort+hmort+bmort+frmort) * currentCohort%n
214217
endif

biogeochem/EDPatchDynamicsMod.F90

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ module EDPatchDynamicsMod
2020
use EDTypesMod , only : dtype_ilog
2121
use EDTypesMod , only : dtype_ifire
2222
use EDTypesMod , only : ican_upper
23+
use EDTypesMod , only : lg_sf
2324
use FatesInterfaceMod , only : hlm_use_planthydro
2425
use FatesInterfaceMod , only : hlm_numSWb
2526
use FatesInterfaceMod , only : bc_in_type
@@ -151,7 +152,7 @@ subroutine disturbance_rates( site_in, bc_in)
151152
call LoggingMortality_frac(currentCohort%pft, currentCohort%dbh, currentCohort%canopy_layer, &
152153
lmort_direct,lmort_collateral,lmort_infra,l_degrad )
153154

154-
currentCohort%lmort_direct = lmort_direct
155+
currentCohort%lmort_direct = lmort_direct
155156
currentCohort%lmort_collateral = lmort_collateral
156157
currentCohort%lmort_infra = lmort_infra
157158
currentCohort%l_degrad = l_degrad
@@ -186,7 +187,7 @@ subroutine disturbance_rates( site_in, bc_in)
186187

187188
! Logging Disturbance Rate
188189
currentPatch%disturbance_rates(dtype_ilog) = currentPatch%disturbance_rates(dtype_ilog) + &
189-
min(1.0_r8, currentCohort%lmort_direct + &
190+
min(1.0_r8, currentCohort%lmort_direct + &
190191
currentCohort%lmort_collateral + &
191192
currentCohort%lmort_infra + &
192193
currentCohort%l_degrad ) * &
@@ -226,7 +227,7 @@ subroutine disturbance_rates( site_in, bc_in)
226227
! to still diagnose and track the non-disturbance rate
227228
! ------------------------------------------------------------------------------------------
228229

229-
230+
! DISTURBANCE IS LOGGING
230231
if (currentPatch%disturbance_rates(dtype_ilog) > currentPatch%disturbance_rates(dtype_ifall) .and. &
231232
currentPatch%disturbance_rates(dtype_ilog) > currentPatch%disturbance_rates(dtype_ifire) ) then
232233

@@ -245,7 +246,7 @@ subroutine disturbance_rates( site_in, bc_in)
245246
currentCohort => currentCohort%taller
246247
enddo !currentCohort
247248

248-
! DISTURBANCE IS FIRE
249+
! DISTURBANCE IS FIRE
249250
elseif (currentPatch%disturbance_rates(dtype_ifire) > currentPatch%disturbance_rates(dtype_ifall) .and. &
250251
currentPatch%disturbance_rates(dtype_ifire) > currentPatch%disturbance_rates(dtype_ilog) ) then
251252

@@ -275,7 +276,7 @@ subroutine disturbance_rates( site_in, bc_in)
275276
currentCohort => currentCohort%taller
276277
enddo !currentCohort
277278

278-
else ! If fire and loggin are not greater than treefall, just set disturbance rate to tree-fall
279+
else ! If fire and logging are not greater than treefall, just set disturbance rate to tree-fall
279280
! which is most likely a 0.0
280281

281282
currentPatch%disturbance_rate = currentPatch%disturbance_rates(dtype_ifall)
@@ -477,6 +478,8 @@ subroutine spawn_patches( currentSite, bc_in)
477478

478479
call logging_litter_fluxes(currentSite, currentPatch, new_patch, patch_site_areadis)
479480

481+
if(debug) write(fates_log(),*) "Logging disturbance generated:",patch_site_areadis
482+
480483
elseif ((currentPatch%disturbance_rates(dtype_ifire) > &
481484
currentPatch%disturbance_rates(dtype_ifall)) .and. &
482485
(currentPatch%disturbance_rates(dtype_ifire) > &
@@ -681,7 +684,7 @@ subroutine spawn_patches( currentSite, bc_in)
681684
nc%lmort_infra = currentCohort%lmort_infra
682685

683686

684-
! Logging is the dominant disturbance
687+
! Logging is the dominant disturbance
685688
elseif ((currentPatch%disturbance_rates(dtype_ilog) > &
686689
currentPatch%disturbance_rates(dtype_ifall)) .and. &
687690
(currentPatch%disturbance_rates(dtype_ilog) > &
@@ -756,7 +759,7 @@ subroutine spawn_patches( currentSite, bc_in)
756759
! LOGGING SURVIVORSHIP OF UNDERSTORY PLANTS IS SET AS A NEW PARAMETER
757760
! in the fatesparameter files
758761
nc%n = nc%n * (1.0_r8 - &
759-
currentPatch%fract_ldist_not_harvested * logging_coll_under_frac)
762+
(1.0_r8-currentPatch%fract_ldist_not_harvested) * logging_coll_under_frac)
760763

761764
! Step 3: Reduce the number count of cohorts in the
762765
! original/donor/non-disturbed patch to reflect the area change
@@ -1085,7 +1088,7 @@ subroutine fire_litter_fluxes(currentSite, cp_target, new_patch_target, patch_si
10851088
!************************************/
10861089
do c = 1,ncwd
10871090
burned_litter = new_patch%cwd_ag(c) * patch_site_areadis/new_patch%area * &
1088-
currentPatch%burnt_frac_litter(c+1) !kG/m2/day
1091+
currentPatch%burnt_frac_litter(c) !kG/m2/day
10891092
new_patch%cwd_ag(c) = new_patch%cwd_ag(c) - burned_litter
10901093
currentSite%flux_out = currentSite%flux_out + burned_litter * new_patch%area !kG/site/day
10911094
currentSite%total_burn_flux_to_atm = currentSite%total_burn_flux_to_atm + &
@@ -1240,7 +1243,7 @@ subroutine fire_litter_fluxes(currentSite, cp_target, new_patch_target, patch_si
12401243
if(EDPftvarcon_inst%woody(currentCohort%pft) == 1)then
12411244
burned_leaves = leaf_c * currentCohort%fraction_crown_burned
12421245
else
1243-
burned_leaves = leaf_c * currentPatch%burnt_frac_litter(6)
1246+
burned_leaves = leaf_c * currentPatch%burnt_frac_litter(lg_sf)
12441247
endif
12451248

12461249
if (burned_leaves > 0.0_r8) then

0 commit comments

Comments
 (0)