@@ -4,27 +4,37 @@ module EDMortalityFunctionsMod
44 ! Functions that control mortality.
55 ! ============================================================================
66
7- use FatesConstantsMod, only : r8 = > fates_r8
8- use FatesGlobals , only : fates_log
9- use EDPftvarcon , only : EDPftvarcon_inst
10- use EDTypesMod , only : ed_cohort_type
11- use FatesConstantsMod, only : itrue,ifalse
12- use FatesAllometryMod, only : bleaf
13- use EDParamsMod , only : ED_val_stress_mort
14- use FatesInterfaceMod, only : hlm_use_ed_prescribed_phys
15- use FatesInterfaceMod, only : bc_in_type
16-
17- implicit none
18- private
19-
20-
21- public :: mortality_rates
7+ use FatesConstantsMod , only : r8 = > fates_r8
8+ use FatesGlobals , only : fates_log
9+ use EDPftvarcon , only : EDPftvarcon_inst
10+ use EDTypesMod , only : ed_cohort_type
11+ use EDTypesMod , only : ed_site_type
12+ use EDTypesMod , only : ed_patch_type
13+ use FatesConstantsMod , only : itrue,ifalse
14+ use FatesAllometryMod , only : bleaf
15+ use EDParamsMod , only : ED_val_stress_mort
16+ use FatesInterfaceMod , only : bc_in_type
17+ use FatesInterfaceMod , only : hlm_use_ed_prescribed_phys
18+ use FatesInterfaceMod , only : hlm_freq_day
19+ use EDLoggingMortalityMod , only : LoggingMortality_frac
20+ use EDParamsMod , only : fates_mortality_disturbance_fraction
21+ use FatesInterfaceMod , only : bc_in_type
22+
23+
24+ implicit none
25+ private
26+
27+
28+ public :: mortality_rates
29+ public :: Mortality_Derivative
30+
31+ logical :: DEBUG_growth = .false.
32+
33+ ! ============================================================================
34+ ! 10/30/09: Created by Rosie Fisher
35+ ! 02/20/18: Refactored Ryan Knox
36+ ! ============================================================================
2237
23- logical :: DEBUG_growth = .false.
24-
25- ! ============================================================================
26- ! 10/30/09: Created by Rosie Fisher
27- ! ============================================================================
2838
2939contains
3040
@@ -55,6 +65,10 @@ subroutine mortality_rates( cohort_in,bc_in,cmort,hmort,bmort,frmort )
5565 real (r8 ),parameter :: frost_mort_scaler = 3.0_r8 ! Scaling factor for freezing mortality
5666 real (r8 ),parameter :: frost_mort_buffer = 5.0_r8 ! 5deg buffer for freezing mortality
5767
68+ logical , parameter :: test_zero_mortality = .false. ! Developer test which
69+ ! may help to debug carbon imbalances
70+ ! and the like
71+
5872 if (hlm_use_ed_prescribed_phys .eq. ifalse) then
5973
6074 ! 'Background' mortality (can vary as a function of
@@ -72,7 +86,7 @@ subroutine mortality_rates( cohort_in,bc_in,cmort,hmort,bmort,frmort )
7286
7387 ! Carbon Starvation induced mortality.
7488 if ( cohort_in% dbh > 0._r8 ) then
75- call bleaf(cohort_in% dbh,cohort_in% hite,cohort_in % pft,cohort_in% canopy_trim,b_leaf)
89+ call bleaf(cohort_in% dbh,cohort_in% pft,cohort_in% canopy_trim,b_leaf)
7690 if ( b_leaf > 0._r8 .and. cohort_in% bstore <= b_leaf )then
7791 frac = cohort_in% bstore/ b_leaf
7892 cmort = max (0.0_r8 ,ED_val_stress_mort* (1.0_r8 - frac))
@@ -111,8 +125,68 @@ subroutine mortality_rates( cohort_in,bc_in,cmort,hmort,bmort,frmort )
111125 frmort = 0._r8
112126 endif
113127
128+ if (test_zero_mortality) then
129+ cmort = 0.0_r8
130+ hmort = 0.0_r8
131+ frmort = 0.0_r8
132+ bmort = 0.0_r8
133+ end if
134+
135+ return
114136 end subroutine mortality_rates
115137
116- ! ============================================================================
138+ ! ============================================================================
139+
140+ subroutine Mortality_Derivative ( currentSite , currentCohort , bc_in )
141+
142+ !
143+ ! !DESCRIPTION:
144+ ! Calculate the change in number density per unit time from the contributing
145+ ! rates. These rates are not disturbance-inducing rates (that is handled
146+ ! elsewhere).
147+ !
148+ ! !USES:
149+
150+ !
151+ ! !ARGUMENTS
152+ type (ed_site_type), intent (inout ), target :: currentSite
153+ type (ed_cohort_type),intent (inout ), target :: currentCohort
154+ type (bc_in_type), intent (in ) :: bc_in
155+ !
156+ ! !LOCAL VARIABLES:
157+ real (r8 ) :: cmort ! starvation mortality rate (fraction per year)
158+ real (r8 ) :: bmort ! background mortality rate (fraction per year)
159+ real (r8 ) :: hmort ! hydraulic failure mortality rate (fraction per year)
160+ real (r8 ) :: frmort ! freezing mortality rate (fraction per year)
161+ real (r8 ) :: dndt_logging ! Mortality rate (per day) associated with the a logging event
162+ integer :: ipft ! local copy of the pft index
163+ !- ---------------------------------------------------------------------
164+
165+ ipft = currentCohort% pft
166+
167+ ! Mortality for trees in the understorey.
168+ ! if trees are in the canopy, then their death is 'disturbance'. This probably needs a different terminology
169+ call mortality_rates(currentCohort,bc_in,cmort,hmort,bmort,frmort)
170+ call LoggingMortality_frac(ipft, currentCohort% dbh, &
171+ currentCohort% lmort_direct, &
172+ currentCohort% lmort_collateral, &
173+ currentCohort% lmort_infra )
174+
175+ if (currentCohort% canopy_layer > 1 )then
176+
177+ ! Include understory logging mortality rates not associated with disturbance
178+ dndt_logging = (currentCohort% lmort_direct + &
179+ currentCohort% lmort_collateral + &
180+ currentCohort% lmort_infra)/ hlm_freq_day
181+
182+ currentCohort% dndt = - 1.0_r8 * (cmort+ hmort+ bmort+ frmort+ dndt_logging) * currentCohort% n
183+ else
184+ currentCohort% dndt = - (1.0_r8 - fates_mortality_disturbance_fraction) &
185+ * (cmort+ hmort+ bmort+ frmort) * currentCohort% n
186+ endif
187+
188+ return
189+
190+ end subroutine Mortality_Derivative
117191
118192end module EDMortalityFunctionsMod
0 commit comments