Skip to content

Commit

Permalink
fix error with large size initialisation in nocomp mode
Browse files Browse the repository at this point in the history
Add a call to h_allom so that trees can be demoted in
canopy_structure
  • Loading branch information
JessicaNeedham committed Aug 26, 2023
1 parent 905bf11 commit eb25064
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion main/EDInitMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ module EDInitMod
use FatesInterfaceTypesMod , only : nlevage

use FatesAllometryMod , only : h2d_allom
use FatesAllometryMod , only : h_allom
use FatesAllometryMod , only : bagw_allom
use FatesAllometryMod , only : bbgw_allom
use FatesAllometryMod , only : bleaf
Expand Down Expand Up @@ -851,6 +852,14 @@ subroutine init_cohorts(site_in, patch_in, bc_in)
patch_in%tallest => null()
patch_in%shortest => null()

! if any pfts are starting with large size then the whole site needs a spread of 0
do pft = 1, numpft
if (EDPftvarcon_inst%initd(pft) < 0.0_r8) then
site_in%spread = init_spread_inventory
end if
end do


! Manage interactions of fixed biogeog (site level filter) and nocomp (patch level filter)
! Need to cover all potential biogeog x nocomp combinations
! 1. biogeog = false. nocomp = false: all PFTs on (DEFAULT)
Expand Down Expand Up @@ -980,8 +989,15 @@ subroutine init_cohorts(site_in, patch_in, bc_in)
! Calculate the leaf biomass from allometry
! (calculates a maximum first, then applies canopy trim)
call bleaf(dbh, pft, crown_damage, canopy_trim, efleaf_coh, &
c_leaf)
c_leaf)

! calculate crown area of the cohort
call carea_allom(dbh, cohort_n, init_spread_inventory, pft, crown_damage, &
c_area)

! calculate height from diameter
call h_allom(dbh, pft, hite)

else
write(fates_log(),*) 'Negative fates_recruit_init_density can only be used in no comp mode'
call endrun(msg=errMsg(sourcefile, __LINE__))
Expand Down

0 comments on commit eb25064

Please sign in to comment.