Skip to content

Commit

Permalink
Merge branch 'main' into allometry_unit_test
Browse files Browse the repository at this point in the history
  • Loading branch information
adrifoster committed May 3, 2024
2 parents 9775af6 + e262198 commit c76e7f4
Show file tree
Hide file tree
Showing 19 changed files with 3,761 additions and 457 deletions.
18 changes: 12 additions & 6 deletions biogeochem/EDCanopyStructureMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module EDCanopyStructureMod
use FatesAllometryMod , only : tree_sai
use EDTypesMod , only : ed_site_type
use FatesAllometryMod , only : VegAreaLayer
use FatesAllometryMod , only : CrownDepth
use FatesPatchMod, only : fates_patch_type
use FatesCohortMod, only : fates_cohort_type
use EDParamsMod , only : nclmax
Expand Down Expand Up @@ -1532,7 +1533,7 @@ subroutine leaf_area_profile( currentSite )
real(r8) :: elai_layer,tlai_layer ! leaf area per canopy area
real(r8) :: esai_layer,tsai_layer ! stem area per canopy area
real(r8) :: vai_top,vai_bot ! integrated top down veg area index at boundary of layer

real(r8) :: crown_depth ! Current cohort's crown depth
real(r8) :: layer_bottom_height,layer_top_height,lai,sai ! Can be removed later
!----------------------------------------------------------------------

Expand Down Expand Up @@ -1611,7 +1612,14 @@ subroutine leaf_area_profile( currentSite )
write(fates_log(), *) ' currentPatch%nrad(cl,ft): ', currentPatch%nrad(cl,ft)
call endrun(msg=errMsg(sourcefile, __LINE__))
end if

!---~---
! Find current crown depth using the allometric function.
!---~---
call CrownDepth(currentCohort%height,currentCohort%pft,crown_depth)
!---~---


! --------------------------------------------------------------------------
! Whole layers. Make a weighted average of the leaf area in each layer
! before dividing it by the total area. Fill up layer for whole layers.
Expand All @@ -1625,12 +1633,10 @@ subroutine leaf_area_profile( currentSite )
! is obscured by snow.

layer_top_height = currentCohort%height - &
( real(iv-1,r8)/currentCohort%NV * currentCohort%height * &
prt_params%crown_depth_frac(currentCohort%pft) )

( real(iv-1,r8)/currentCohort%NV * crown_depth )

layer_bottom_height = currentCohort%height - &
( real(iv,r8)/currentCohort%NV * currentCohort%height * &
prt_params%crown_depth_frac(currentCohort%pft) )
( real(iv,r8)/currentCohort%NV * crown_depth )

fraction_exposed = 1.0_r8
if(currentSite%snow_depth > layer_top_height)then
Expand Down
7 changes: 5 additions & 2 deletions biogeochem/EDPhysiologyMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module EDPhysiologyMod
use FatesAllometryMod , only : tree_lai
use FatesAllometryMod , only : tree_sai
use FatesAllometryMod , only : leafc_from_treelai
use FatesAllometryMod , only : decay_coeff_kn
use FatesAllometryMod , only : decay_coeff_vcmax
use FatesLitterMod , only : litter_type
use EDTypesMod , only : site_massbal_type
use EDTypesMod , only : numlevsoil_max
Expand Down Expand Up @@ -765,7 +765,10 @@ subroutine trim_canopy( currentSite )

! Calculate sla_levleaf following the sla profile with overlying leaf area
! Scale for leaf nitrogen profile
kn = decay_coeff_kn(ipft,currentCohort%vcmax25top)
kn = decay_coeff_vcmax(currentCohort%vcmax25top, &
prt_params%leafn_vert_scaler_coeff1(ipft), &
prt_params%leafn_vert_scaler_coeff2(ipft))

! Nscaler value at leaf level z
nscaler_levleaf = exp(-kn * cumulative_lai)
! Sla value at leaf level z after nitrogen profile scaling (m2/gC)
Expand Down
Loading

0 comments on commit c76e7f4

Please sign in to comment.