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

Add a recruitment carbon flux history variable #1153

Merged
merged 2 commits into from
Mar 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions main/FatesHistoryInterfaceMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,7 @@ module FatesHistoryInterfaceMod
integer :: ih_nindivs_si_pft
integer :: ih_nindivs_sec_si_pft
integer :: ih_recruitment_si_pft
integer :: ih_recruitment_cflux_si_pft
integer :: ih_mortality_si_pft
integer :: ih_mortality_carbonflux_si_pft
integer :: ih_hydraulicmortality_carbonflux_si_pft
Expand Down Expand Up @@ -3046,6 +3047,7 @@ subroutine update_history_dyn2(this,nc,nsites,sites,bc_in)

real(r8), parameter :: reallytalltrees = 1000. ! some large number (m)

!
associate( hio_err_fates_elem => this%hvars(ih_err_fates_elem)%r82d, &
hio_biomass_si_pft => this%hvars(ih_biomass_si_pft)%r82d, &
hio_biomass_sec_si_pft => this%hvars(ih_biomass_sec_si_pft)%r82d, &
Expand All @@ -3054,6 +3056,7 @@ subroutine update_history_dyn2(this,nc,nsites,sites,bc_in)
hio_nindivs_si_pft => this%hvars(ih_nindivs_si_pft)%r82d, &
hio_nindivs_sec_si_pft => this%hvars(ih_nindivs_sec_si_pft)%r82d, &
hio_recruitment_si_pft => this%hvars(ih_recruitment_si_pft)%r82d, &
hio_recruitment_cflux_si_pft => this%hvars(ih_recruitment_cflux_si_pft)%r82d, &
hio_seeds_out_gc_si_pft => this%hvars(ih_seeds_out_gc_si_pft)%r82d, &
hio_seeds_in_gc_si_pft => this%hvars(ih_seeds_in_gc_si_pft)%r82d, &
hio_mortality_si_pft => this%hvars(ih_mortality_si_pft)%r82d, &
Expand Down Expand Up @@ -3514,6 +3517,11 @@ subroutine update_history_dyn2(this,nc,nsites,sites,bc_in)
(ccohort%n * AREA_INV) * total_m
end if

if(ccohort%isnew) then
hio_recruitment_cflux_si_pft(io_si, ft) = hio_recruitment_cflux_si_pft(io_si, ft) + &
(ccohort%n * AREA_INV) * total_m * days_per_year
end if

hio_biomass_si_pft(io_si, ft) = hio_biomass_si_pft(io_si, ft) + &
(ccohort%n * AREA_INV) * total_m

Expand Down Expand Up @@ -6727,6 +6735,12 @@ subroutine define_history_vars(this, initialize_variables)
upfreq=group_dyna_complx, ivar=ivar, initialize=initialize_variables, &
index=ih_biomass_sec_si_pft)

call this%set_history_var(vname='FATES_RECRUITMENT_CFLUX_PF', units='kg m-2 yr-1', &
long='total PFT-level biomass of new recruits in kg of carbon per land area', &
use_default='active', avgflag='A', vtype=site_pft_r8, hlms='CLM:ALM', &
upfreq=1, ivar=ivar, initialize=initialize_variables, &
index=ih_recruitment_cflux_si_pft)

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