@@ -86,9 +86,13 @@ module FatesAllometryMod
8686 use EDPFTvarcon , only : EDPftvarcon_inst
8787 use FatesConstantsMod, only : r8 = > fates_r8
8888 use FatesConstantsMod, only : i4 = > fates_int
89+ use FatesConstantsMod, only : g_per_kg
90+ use FatesConstantsMod, only : cm2_per_m2
91+ use FatesConstantsMod, only : kg_per_Megag
8992 use shr_log_mod , only : errMsg = > shr_log_errMsg
9093 use FatesGlobals , only : fates_log
9194 use FatesGlobals , only : endrun = > fates_endrun
95+ use EDTypesMod , only : nlevleaf, dinc_ed
9296
9397 implicit none
9498
@@ -98,6 +102,8 @@ module FatesAllometryMod
98102 public :: bagw_allom ! Generic AGWB (above grnd. woody bio) wrapper
99103 public :: blmax_allom ! Generic maximum leaf biomass wrapper
100104 public :: bleaf ! Generic actual leaf biomass wrapper
105+ public :: tree_lai ! Calculate tree-level LAI from actual leaf biomass
106+ public :: tree_sai ! Calculate tree-level SAI from target leaf biomass
101107 public :: bsap_allom ! Generic sapwood wrapper
102108 public :: bbgw_allom ! Generic coarse root wrapper
103109 public :: bfineroot ! Generic actual fine root biomass wrapper
@@ -494,6 +500,87 @@ subroutine bleaf(d,ipft,canopy_trim,bl,dbldd)
494500 return
495501 end subroutine bleaf
496502
503+ ! =====================================================================================
504+
505+ real (r8 ) function tree_lai( bl, status_coh, pft, c_area, n )
506+
507+ ! ============================================================================
508+ ! LAI of individual trees is a function of the total leaf area and the total canopy area.
509+ ! ============================================================================
510+
511+ real (r8 ), intent (in ) :: bl ! plant leaf biomass [kg]
512+ integer , intent (in ) :: status_coh ! growth status of plant (2 = leaves on , 1 = leaves off)
513+ integer , intent (in ) :: pft
514+ real (r8 ), intent (in ) :: c_area ! areal extent of canopy (m2)
515+ real (r8 ), intent (in ) :: n ! number of individuals in cohort per 'area' (10000m2 default)
516+
517+ real (r8 ) :: leafc_per_unitarea ! KgC of leaf per m2 area of ground.
518+ real (r8 ) :: slat ! the sla of the top leaf layer. m2/kgC
519+
520+ if ( bl < 0._r8 .or. pft == 0 ) then
521+ write (fates_log(),* ) ' problem in treelai' ,bl,pft
522+ endif
523+
524+ slat = g_per_kg * EDPftvarcon_inst% slatop(pft) ! m2/g to m2/kg
525+ leafc_per_unitarea = bl/ (c_area/ n) ! KgC/m2
526+ if (leafc_per_unitarea > 0.0_r8 )then
527+ tree_lai = leafc_per_unitarea * slat ! kg/m2 * m2/kg = unitless LAI
528+ else
529+ tree_lai = 0.0_r8
530+ endif
531+
532+
533+ ! here, if the LAI exceeeds the maximum size of the possible array, then we have no way of accomodating it
534+ ! at the moments nlevleaf default is 40, which is very large, so exceeding this would clearly illustrate a
535+ ! huge error
536+ if (tree_lai > nlevleaf* dinc_ed)then
537+ write (fates_log(),* ) ' too much lai' , tree_lai , pft , nlevleaf * dinc_ed
538+ write (fates_log(),* ) ' Aborting'
539+ call endrun(msg= errMsg(sourcefile, __LINE__))
540+ endif
541+
542+ return
543+
544+ end function tree_lai
545+
546+ ! ============================================================================
547+
548+ real (r8 ) function tree_sai( dbh, pft, canopy_trim, c_area, n )
549+
550+ ! ============================================================================
551+ ! SAI of individual trees is a function of the target leaf biomass
552+ ! ============================================================================
553+
554+ real (r8 ),intent (in ) :: dbh
555+ integer , intent (in ) :: pft
556+ real (r8 ),intent (in ) :: canopy_trim
557+ real (r8 ), intent (in ) :: c_area ! areal extent of canopy (m2)
558+ real (r8 ), intent (in ) :: n ! number of individuals in cohort per 'area' (10000m2 default)
559+
560+ real (r8 ) :: leafc_per_unitarea ! KgC of target leaf per m2 area of ground.
561+ real (r8 ) :: sai_scaler
562+ real (r8 ) :: b_leaf
563+
564+ sai_scaler = g_per_kg * EDPftvarcon_inst% allom_sai_scaler(pft) ! m2/g to m2/kg
565+
566+ call bleaf(dbh,pft,canopy_trim,b_leaf)
567+
568+ leafc_per_unitarea = b_leaf/ (c_area/ n) ! KgC/m2
569+
570+ tree_sai = leafc_per_unitarea * sai_scaler ! kg/m2 * m2/kg = unitless SAI
571+
572+ ! here, if the LAI exceeeds the maximum size of the possible array, then we have no way of accomodating it
573+ ! at the moments nlevleaf default is 40, which is very large, so exceeding this would clearly illustrate a
574+ ! huge error
575+ if (tree_sai > nlevleaf* dinc_ed)then
576+ write (fates_log(),* ) ' too much sai' , tree_sai , pft , nlevleaf * dinc_ed
577+ write (fates_log(),* ) ' Aborting'
578+ call endrun(msg= errMsg(sourcefile, __LINE__))
579+ endif
580+
581+ return
582+
583+ end function tree_sai
497584
498585 ! ============================================================================
499586 ! Generic sapwood biomass interface
@@ -804,9 +891,7 @@ end subroutine bbgw_const
804891
805892 subroutine bsap_deprecated (d ,h ,dhdd ,bleaf ,dbleafdd ,ipft ,bsap ,dbsapdd )
806893
807- use FatesConstantsMod, only : g_per_kg
808- use FatesConstantsMod, only : cm2_per_m2
809- use FatesConstantsMod, only : kg_per_Megag
894+
810895
811896 ! -------------------------------------------------------------------------
812897 ! -------------------------------------------------------------------------
@@ -853,10 +938,6 @@ end subroutine bsap_deprecated
853938
854939 subroutine bsap_dlinear (d ,h ,dhdd ,bleaf ,dbleafdd ,ipft ,bsap ,dbsapdd )
855940
856- use FatesConstantsMod, only : g_per_kg
857- use FatesConstantsMod, only : cm2_per_m2
858- use FatesConstantsMod, only : kg_per_Megag
859-
860941 ! -------------------------------------------------------------------------
861942 ! Calculate sapwood biomass based on leaf area to sapwood area
862943 ! proportionality. In this function, the leaftosapwood area is a function
@@ -1685,7 +1766,6 @@ subroutine StructureResetOfDH( bdead, ipft, canopy_trim, d, h )
16851766 ! T
16861767 ! ============================================================================
16871768
1688-
16891769 use FatesConstantsMod , only : calloc_abs_error
16901770 ! Arguments
16911771
0 commit comments