Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to C starvation by canopy layer history variables #971

Merged
merged 8 commits into from
Feb 2, 2023
Prev Previous commit
Next Next commit
Add total LAI as a history variable for use in ILAMB
  • Loading branch information
Jessica F Needham committed Jan 31, 2023
commit d83805d48b05f26961fb6ceec05730883c235478
14 changes: 12 additions & 2 deletions main/FatesHistoryInterfaceMod.F90
Original file line number Diff line number Diff line change
@@ -363,7 +363,8 @@ module FatesHistoryInterfaceMod
integer :: ih_h2oveg_recruit_si
integer :: ih_h2oveg_growturn_err_si
integer :: ih_h2oveg_hydro_err_si

integer :: ih_lai_si

integer :: ih_site_cstatus_si
integer :: ih_site_dstatus_si
integer :: ih_gdd_si
@@ -2430,7 +2431,8 @@ subroutine update_history_dyn(this,nc,nsites,sites,bc_in)
hio_tveg24 => this%hvars(ih_tveg24_si)%r81d, &
hio_meanliqvol_si => this%hvars(ih_meanliqvol_si)%r81d, &
hio_cbal_err_fates_si => this%hvars(ih_cbal_err_fates_si)%r81d, &
hio_err_fates_si => this%hvars(ih_err_fates_si)%r82d )
hio_err_fates_si => this%hvars(ih_err_fates_si)%r82d, &
hio_lai_si => this%hvars(ih_lai_si)%r81d )

! If we don't have dynamics turned on, we just abort these diagnostics
if (hlm_use_ed_st3.eq.itrue) return
@@ -2601,6 +2603,8 @@ subroutine update_history_dyn(this,nc,nsites,sites,bc_in)
+ cpatch%ncl_p * cpatch%area
hio_npatches_si_age(io_si,cpatch%age_class) = hio_npatches_si_age(io_si,cpatch%age_class) + 1._r8

hio_lai_si(io_si) = hio_lai_si(io_si) + sum(cpatch%tlai_profile(:,:,:)) * cpatch%area * AREA_INV

if ( ED_val_comp_excln .lt. 0._r8 ) then ! only valid when "strict ppa" enabled
hio_zstar_si_age(io_si,cpatch%age_class) = hio_zstar_si_age(io_si,cpatch%age_class) &
+ cpatch%zstar * cpatch%area * AREA_INV
@@ -5184,6 +5188,12 @@ subroutine define_history_vars(this, initialize_variables)
upfreq=1, ivar=ivar, initialize=initialize_variables, &
index=ih_canopy_spread_si)

call this%set_history_var(vname='FATES_LAI', units='m2 m-2', &
long='leaf area index per m2 land area', &
use_default='active', avgflag='A', vtype=site_r8, hlms='CLM:ALM', &
upfreq=1, ivar=ivar, initialize=initialize_variables, &
index=ih_lai_si)

call this%set_history_var(vname='FATES_VEGC_PF', units='kg m-2', &
long='total PFT-level biomass in kg of carbon per land area', &
use_default='active', avgflag='A', vtype=site_pft_r8, hlms='CLM:ALM', &