@@ -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+
17091801end module EDCohortDynamicsMod
0 commit comments