Skip to content

Commit

Permalink
Merge pull request #887 from rgknox/remove-laimemory
Browse files Browse the repository at this point in the history
Remove memory and lai variables
  • Loading branch information
glemieux authored Sep 14, 2022
2 parents 12ce31c + cdb8fca commit 2021c43
Show file tree
Hide file tree
Showing 8 changed files with 295 additions and 512 deletions.
449 changes: 180 additions & 269 deletions biogeochem/EDCanopyStructureMod.F90

Large diffs are not rendered by default.

34 changes: 1 addition & 33 deletions biogeochem/EDCohortDynamicsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,7 @@ module EDCohortDynamicsMod


subroutine create_cohort(currentSite, patchptr, pft, nn, hite, coage, dbh, &
prt, leafmemory, sapwmemory, structmemory, &
status, recruitstatus,ctrim, carea, clayer, spread, bc_in)
prt, status, recruitstatus,ctrim, carea, clayer, spread, bc_in)
!
! !DESCRIPTION:
! create new cohort
Expand Down Expand Up @@ -181,12 +180,6 @@ subroutine create_cohort(currentSite, patchptr, pft, nn, hite, coage, dbh, &
real(r8), intent(in) :: dbh ! dbh: cm
class(prt_vartypes),target :: prt ! The allocated PARTEH
! object
real(r8), intent(in) :: leafmemory ! target leaf biomass- set from
! previous year: kGC per indiv
real(r8), intent(in) :: sapwmemory ! target sapwood biomass- set from
! previous year: kGC per indiv
real(r8), intent(in) :: structmemory ! target structural biomass- set from
! previous year: kGC per indiv
real(r8), intent(in) :: ctrim ! What is the fraction of the maximum
! leaf biomass that we are targeting?
real(r8), intent(in) :: spread ! The community assembly effects how
Expand Down Expand Up @@ -237,9 +230,6 @@ subroutine create_cohort(currentSite, patchptr, pft, nn, hite, coage, dbh, &
new_cohort%canopy_trim = ctrim
new_cohort%canopy_layer = clayer
new_cohort%canopy_layer_yesterday = real(clayer, r8)
new_cohort%leafmemory = leafmemory
new_cohort%sapwmemory = sapwmemory
new_cohort%structmemory = structmemory

! This sets things like vcmax25top, that depend on the
! leaf age fractions (which are defined by PARTEH)
Expand Down Expand Up @@ -287,8 +277,6 @@ subroutine create_cohort(currentSite, patchptr, pft, nn, hite, coage, dbh, &
patchptr%canopy_layer_tlai, new_cohort%treelai,new_cohort%vcmax25top,2 )
end if

new_cohort%lai = new_cohort%treelai * new_cohort%c_area/patchptr%area


! Put cohort at the right place in the linked list
storebigcohort => patchptr%tallest
Expand Down Expand Up @@ -544,11 +532,6 @@ subroutine nan_cohort(cc_p)
currentCohort%dbh = nan ! 'diameter at breast height' in cm
currentCohort%coage = nan ! age of the cohort in years
currentCohort%hite = nan ! height: meters
currentCohort%leafmemory = nan ! target leaf biomass- set from previous year: kGC per indiv
currentCohort%sapwmemory = nan ! target sapwood biomass- set from previous year: kGC per indiv
currentCohort%structmemory = nan ! target structural biomass- set from previous year: kGC per indiv
currentCohort%lai = nan ! leaf area index of cohort m2/m2
currentCohort%sai = nan ! stem area index of cohort m2/m2
currentCohort%g_sb_laweight = nan ! Total leaf conductance of cohort (stomata+blayer) weighted by leaf-area [m/s]*[m2]
currentCohort%canopy_trim = nan ! What is the fraction of the maximum leaf biomass that we are targeting? :-
currentCohort%leaf_cost = nan ! How much does it cost to maintain leaves: kgC/m2/year-1
Expand Down Expand Up @@ -1198,7 +1181,6 @@ subroutine fuse_cohorts(currentSite, currentPatch, bc_in)
write(fates_log(),*) 'Cohort I, Cohort II'
write(fates_log(),*) 'n:',currentCohort%n,nextc%n
write(fates_log(),*) 'isnew:',currentCohort%isnew,nextc%isnew
write(fates_log(),*) 'leafmemory:',currentCohort%leafmemory,nextc%leafmemory
write(fates_log(),*) 'hite:',currentCohort%hite,nextc%hite
write(fates_log(),*) 'coage:',currentCohort%coage,nextc%coage
write(fates_log(),*) 'dbh:',currentCohort%dbh,nextc%dbh
Expand Down Expand Up @@ -1236,15 +1218,6 @@ subroutine fuse_cohorts(currentSite, currentPatch, bc_in)
! -----------------------------------------------------------------
call UpdateCohortBioPhysRates(currentCohort)

currentCohort%leafmemory = (currentCohort%n*currentCohort%leafmemory &
+ nextc%n*nextc%leafmemory)/newn

currentCohort%sapwmemory = (currentCohort%n*currentCohort%sapwmemory &
+ nextc%n*nextc%sapwmemory)/newn

currentCohort%structmemory = (currentCohort%n*currentCohort%structmemory &
+ nextc%n*nextc%structmemory)/newn

currentCohort%canopy_trim = (currentCohort%n*currentCohort%canopy_trim &
+ nextc%n*nextc%canopy_trim)/newn

Expand Down Expand Up @@ -1810,11 +1783,6 @@ subroutine copy_cohort( currentCohort,copyc )
n%dbh = o%dbh
n%coage = o%coage
n%hite = o%hite
n%leafmemory = o%leafmemory
n%sapwmemory = o%sapwmemory
n%structmemory = o%structmemory
n%lai = o%lai
n%sai = o%sai
n%g_sb_laweight = o%g_sb_laweight
n%leaf_cost = o%leaf_cost
n%canopy_layer = o%canopy_layer
Expand Down
Loading

0 comments on commit 2021c43

Please sign in to comment.