@@ -318,7 +318,7 @@ subroutine DemoteFromLayer(currentSite,currentPatch,i_lyr)
318318 ! !LOCAL VARIABLES:
319319 type (ed_cohort_type), pointer :: currentCohort,copyc
320320 integer :: i_cwd ! Index for CWD pool
321- real (r8 ) :: cc_loss
321+ real (r8 ) :: cc_loss ! cohort crown area loss in demotion (m2)
322322 real (r8 ) :: lossarea
323323 real (r8 ) :: newarea
324324 real (r8 ) :: demote_area
@@ -638,7 +638,7 @@ subroutine PromoteIntoLayer(currentSite,currentPatch,i_lyr)
638638 integer :: exceedance_counter
639639 real (r8 ) :: remainder_area
640640 real (r8 ) :: remainder_area_hold
641- real (r8 ) :: cc_gain
641+ real (r8 ) :: cc_gain ! cohort crown area gain in promotion (m2)
642642 real (r8 ) :: arealayer_current ! area (m2) of the current canopy layer
643643 real (r8 ) :: arealayer_below ! area (m2) of the layer below the current layer
644644
@@ -1628,9 +1628,11 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out)
16281628 ! currentPatch%total_canopy_area/currentPatch%area is fraction of this patch cover by plants
16291629 ! currentPatch%area/AREA is the fraction of the soil covered by this patch.
16301630
1631- bc_out(s)% canopy_fraction_pa(ifp) = currentPatch% total_canopy_area/ AREA
1631+ bc_out(s)% canopy_fraction_pa(ifp) = &
1632+ min (1.0_r8 ,currentPatch% total_canopy_area/ currentPatch% area)* (currentPatch% area/ AREA)
16321633
1633- bare_frac_area = (1.0_r8 - currentPatch% total_canopy_area/ currentPatch% area)* (currentPatch% area/ AREA)
1634+ bare_frac_area = (1.0_r8 - min (1.0_r8 ,currentPatch% total_canopy_area/ currentPatch% area)) * &
1635+ (currentPatch% area/ AREA)
16341636
16351637 total_patch_area = total_patch_area + bc_out(s)% canopy_fraction_pa(ifp) + bare_frac_area
16361638
@@ -1674,8 +1676,10 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out)
16741676 call endrun(msg= errMsg(sourcefile, __LINE__))
16751677 end if
16761678
1677- write (fates_log(),* ) ' imprecise patch areas in update_hlm_dynamics' ,total_patch_area
1678-
1679+ if (DEBUG) then
1680+ write (fates_log(),* ) ' imprecise patch areas in update_hlm_dynamics' ,total_patch_area
1681+ end if
1682+
16791683 currentPatch = > sites(s)% oldest_patch
16801684 ifp = 0
16811685 do while (associated (currentPatch))
0 commit comments