@@ -24,12 +24,15 @@ module FATESPlantRespPhotosynthMod
2424 use FatesGlobals, only : fates_log
2525 use FatesConstantsMod, only : r8 = > fates_r8
2626 use FatesConstantsMod, only : itrue
27+ use FatesConstantsMod, only : nearzero
2728 use FatesInterfaceMod, only : hlm_use_planthydro
2829 use FatesInterfaceMod, only : hlm_parteh_mode
2930 use FatesInterfaceMod, only : numpft
31+ use FatesInterfaceMod, only : nleafage
3032 use EDTypesMod, only : maxpft
3133 use EDTypesMod, only : nlevleaf
3234 use EDTypesMod, only : nclmax
35+ use EDTypesMod, only : max_nleafage
3336 use EDTypesMod, only : do_fates_salinity
3437 use PRTGenericMod, only : prt_carbon_allom_hyp
3538 use PRTGenericMod, only : prt_cnp_flex_allom_hyp
@@ -156,7 +159,7 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime)
156159 real (r8 ) :: co2_cpoint ! CO2 compensation point (Pa)
157160 real (r8 ) :: btran_eff ! effective transpiration wetness factor (0 to 1)
158161 real (r8 ) :: bbb ! Ball-Berry minimum leaf conductance (umol H2O/m**2/s)
159- real (r8 ) :: kn(maxpft) ! leaf nitrogen decay coefficient
162+ real (r8 ) :: kn ! leaf nitrogen decay coefficient
160163 real (r8 ) :: cf ! s m**2/umol -> s/m (ideal gas conversion) [umol/m3]
161164 real (r8 ) :: gb_mol ! leaf boundary layer conductance (molar form: [umol /m**2/s])
162165 real (r8 ) :: ceair ! vapor pressure of air, constrained (Pa)
@@ -202,8 +205,6 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime)
202205 real (r8 ) :: lai_current ! the LAI in the current leaf layer
203206 real (r8 ) :: cumulative_lai ! the cumulative LAI, top down, to the leaf layer of interest
204207
205-
206-
207208 ! -----------------------------------------------------------------------------------
208209 ! Keeping these two definitions in case they need to be added later
209210 !
@@ -214,6 +215,7 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime)
214215 integer :: cl,s,iv,j,ps,ft,ifp ! indices
215216 integer :: nv ! number of leaf layers
216217 integer :: NCL_p ! number of canopy layers in patch
218+ integer :: iage ! loop counter for leaf age classes
217219
218220 ! Parameters
219221 ! -----------------------------------------------------------------------
@@ -313,11 +315,7 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime)
313315
314316 do ft = 1 ,numpft
315317
316- ! Bonan et al (2011) JGR, 116, doi:10.1029/2010JG001593 used
317- ! kn = 0.11. Here, derive kn from vcmax25 as in Lloyd et al
318- ! (2010) Biogeosciences, 7, 1833-1859
319318
320- kn(ft) = decay_coeff_kn(ft)
321319
322320
323321 ! This is probably unnecessary and already calculated
@@ -373,7 +371,7 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime)
373371
374372 ! are there any leaves of this pft in this layer?
375373 if (currentPatch% canopy_mask(cl,ft) == 1 )then
376-
374+
377375 ! Loop over leaf-layers
378376 do iv = 1 ,currentCohort% nv
379377
@@ -385,14 +383,17 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime)
385383 ! cohort-layer combo of interest.
386384 ! but in the vanilla case, we only re-calculate if it has
387385 ! not been done yet.
386+ ! Other cases where we need to solve for every cohort
387+ ! in every leaf layer: nutrient dynamic mode, multiple leaf
388+ ! age classes
388389 ! ------------------------------------------------------------
389390
390391 if ( .not. rate_mask_z(iv,ft,cl) .or. &
391392 (hlm_use_planthydro.eq. itrue) .or. &
393+ (nleafage > 1 ) .or. &
392394 (hlm_parteh_mode .ne. prt_carbon_allom_hyp ) ) then
393395
394- if (hlm_use_planthydro.eq. itrue) then
395-
396+ if (hlm_use_planthydro.eq. itrue ) then
396397
397398 bbb = max (bbbopt(nint (c3psn(ft)))* currentCohort% co_hydr% btran(1 ), 1._r8 )
398399 btran_eff = currentCohort% co_hydr% btran(1 )
@@ -427,10 +428,16 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime)
427428 if (do_fates_salinity)then
428429 btran_eff = btran_eff* currentPatch% bstress_sal_ft(ft)
429430 endif
430-
431431
432+
433+ ! Bonan et al (2011) JGR, 116, doi:10.1029/2010JG001593 used
434+ ! kn = 0.11. Here, derive kn from vcmax25 as in Lloyd et al
435+ ! (2010) Biogeosciences, 7, 1833-1859
436+
437+ kn = decay_coeff_kn(ft,currentCohort% vcmax25top)
438+
432439 ! Scale for leaf nitrogen profile
433- nscaler = exp (- kn(ft) * cumulative_lai)
440+ nscaler = exp (- kn * cumulative_lai)
434441
435442 ! Leaf maintenance respiration to match the base rate used in CN
436443 ! but with the new temperature functions for C3 and C4 plants.
@@ -473,13 +480,15 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime)
473480 ! These rates are the specific rates used in the actual photosynthesis
474481 ! calculations that take localized environmental effects (temperature)
475482 ! into consideration.
483+
484+
476485
477486 call LeafLayerBiophysicalRates(currentPatch% ed_parsun_z(cl,ft,iv), & ! in
478487 ft, & ! in
479- EDPftvarcon_inst % vcmax25top(ft), & ! in
480- param_derived % jmax25top(ft), & ! in
481- param_derived % tpu25top(ft), & ! in
482- param_derived % kp25top(ft), & ! in
488+ currentCohort % vcmax25top, & ! in
489+ currentCohort % jmax25top, & ! in
490+ currentCohort % tpu25top, & ! in
491+ currentCohort % kp25top, & ! in
483492 nscaler, & ! in
484493 bc_in(s)% t_veg_pa(ifp), & ! in
485494 btran_eff, & ! in
@@ -1742,7 +1751,7 @@ subroutine LeafLayerBiophysicalRates( parsun_lsl, &
17421751 ! for this pft (umol electrons/m**2/s)
17431752 real (r8 ), intent (in ) :: tpu25top_ft ! canopy top triose phosphate utilization rate at 25C
17441753 ! for this pft (umol CO2/m**2/s)
1745- real (r8 ), intent (in ) :: co2_rcurve_islope25top_ft ! initial slope of CO2 response curve
1754+ real (r8 ), intent (in ) :: co2_rcurve_islope25top_ft ! initial slope of CO2 response curve
17461755 ! (C4 plants) at 25C, canopy top, this pft
17471756 real (r8 ), intent (in ) :: veg_tempk ! vegetation temperature
17481757 real (r8 ), intent (in ) :: btran ! transpiration wetness factor (0 to 1)
@@ -1803,6 +1812,8 @@ subroutine LeafLayerBiophysicalRates( parsun_lsl, &
18031812 tpu = 0._r8
18041813 co2_rcurve_islope = 0._r8
18051814 else ! day time
1815+
1816+ ! Vcmax25top was already calculated to derive the nscaler function
18061817 vcmax25 = vcmax25top_ft * nscaler
18071818 jmax25 = jmax25top_ft * nscaler
18081819 tpu25 = tpu25top_ft * nscaler
0 commit comments