Skip to content

Commit

Permalink
Merge pull request #1 from rgknox/JessicaNeedham-IO-sizeagemortality-…
Browse files Browse the repository at this point in the history
…merged-rkfixes

conditioning age mortality rate and history output
  • Loading branch information
JessicaNeedham authored Mar 24, 2020
2 parents 337ec13 + f4afdf2 commit cec41c7
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 16 deletions.
9 changes: 7 additions & 2 deletions biogeochem/EDMortalityFunctionsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,16 @@ subroutine mortality_rates( cohort_in,bc_in,cmort,hmort,bmort,frmort,smort,asmor
end if

! if param values have been set then calculate asmort



mort_r_age_senescence = EDPftvarcon_inst%mort_r_age_senescence(cohort_in%pft)
mort_ip_age_senescence = EDPftvarcon_inst%mort_ip_age_senescence(cohort_in%pft)

if ( mort_ip_age_senescence < fates_check_param_set ) then
! Age Dependent Senescence
! rate and inflection point define the change in mortality with age
mort_r_age_senescence = EDPftvarcon_inst%mort_r_age_senescence(cohort_in%pft)
mort_ip_age_senescence = EDPftvarcon_inst%mort_ip_age_senescence(cohort_in%pft)

asmort = 1.0_r8 / (1.0_r8 + exp(-1.0_r8 * mort_r_age_senescence * &
(cohort_in%coage - mort_ip_age_senescence ) ) )
else
Expand Down
36 changes: 22 additions & 14 deletions main/FatesHistoryInterfaceMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ module FatesHistoryInterfaceMod
use FatesInterfaceMod , only : hlm_hio_ignore_val
use FatesInterfaceMod , only : hlm_use_planthydro
use FatesInterfaceMod , only : hlm_use_ed_st3
use FatesInterfaceMod , only : hlm_use_cohort_age_tracking
use FatesInterfaceMod , only : numpft
use FatesInterfaceMod , only : hlm_freq_day
use EDParamsMod , only : ED_val_comp_excln
Expand Down Expand Up @@ -2274,10 +2275,15 @@ subroutine update_history_dyn(this,nc,nsites,sites)
(ccohort%lmort_direct+ccohort%lmort_collateral+ccohort%lmort_infra) * ccohort%n
hio_m8_si_scpf(io_si,scpf) = hio_m8_si_scpf(io_si,scpf) + ccohort%frmort*ccohort%n
hio_m9_si_scpf(io_si,scpf) = hio_m9_si_scpf(io_si,scpf) + ccohort%smort*ccohort%n
hio_m10_si_scpf(io_si,scpf) = hio_m10_si_scpf(io_si,scpf) + ccohort%asmort*ccohort%n

hio_m10_si_capf(io_si,capf) = hio_m10_si_capf(io_si,capf) + ccohort%asmort*ccohort%n


if (hlm_use_cohort_age_tracking .eq.itrue) then
hio_m10_si_scpf(io_si,scpf) = hio_m10_si_scpf(io_si,scpf) + ccohort%asmort*ccohort%n
hio_m10_si_capf(io_si,capf) = hio_m10_si_capf(io_si,capf) + ccohort%asmort*ccohort%n
hio_m10_si_scls(io_si,scls) = hio_m10_si_scls(io_si,scls) + ccohort%asmort*ccohort%n
hio_m10_si_cacls(io_si,cacls) = hio_m10_si_cacls(io_si,cacls)+ &
ccohort%asmort*ccohort%n
end if

hio_m1_si_scls(io_si,scls) = hio_m1_si_scls(io_si,scls) + ccohort%bmort*ccohort%n
hio_m2_si_scls(io_si,scls) = hio_m2_si_scls(io_si,scls) + ccohort%hmort*ccohort%n
hio_m3_si_scls(io_si,scls) = hio_m3_si_scls(io_si,scls) + ccohort%cmort*ccohort%n
Expand All @@ -2287,10 +2293,7 @@ subroutine update_history_dyn(this,nc,nsites,sites)
ccohort%frmort*ccohort%n
hio_m9_si_scls(io_si,scls) = hio_m9_si_scls(io_si,scls) + ccohort%smort*ccohort%n

hio_m10_si_scls(io_si,scls) = hio_m10_si_scls(io_si,scls) + ccohort%asmort*ccohort%n

hio_m10_si_cacls(io_si,cacls) = hio_m10_si_cacls(io_si,cacls)+ &
ccohort%asmort*ccohort%n


!C13 discrimination
if(gpp_cached + ccohort%gpp_acc_hold > 0.0_r8)then
Expand All @@ -2302,9 +2305,13 @@ subroutine update_history_dyn(this,nc,nsites,sites)

! number density [/ha]
hio_nplant_si_scpf(io_si,scpf) = hio_nplant_si_scpf(io_si,scpf) + ccohort%n

! number density along the cohort age dimension
hio_nplant_si_capf(io_si,capf) = hio_nplant_si_capf(io_si,capf) + ccohort%n

if (hlm_use_cohort_age_tracking .eq.itrue) then
hio_nplant_si_capf(io_si,capf) = hio_nplant_si_capf(io_si,capf) + ccohort%n
hio_nplant_si_cacls(io_si,cacls) = hio_nplant_si_cacls(io_si,cacls)+ccohort%n
end if

! number density by size and biomass
hio_agb_si_scls(io_si,scls) = hio_agb_si_scls(io_si,scls) + &
total_c * ccohort%n * EDPftvarcon_inst%allom_agb_frac(ccohort%pft) * AREA_INV
Expand All @@ -2322,7 +2329,7 @@ subroutine update_history_dyn(this,nc,nsites,sites)
hio_nplant_si_scag(io_si,iscag) = hio_nplant_si_scag(io_si,iscag) + ccohort%n

hio_nplant_si_scls(io_si,scls) = hio_nplant_si_scls(io_si,scls) + ccohort%n
hio_nplant_si_cacls(io_si,cacls) = hio_nplant_si_cacls(io_si,cacls)+ccohort%n


! update size, age, and PFT - indexed quantities

Expand Down Expand Up @@ -2821,13 +2828,13 @@ subroutine update_history_dyn(this,nc,nsites,sites)

hio_cwd_elcwd(io_si,:) = 0._r8


do el = 1, num_elements

flux_diags => sites(s)%flux_diags(el)

! Sum up all input litter fluxes (above below, fines, cwd)
hio_litter_in_elem(io_si, el) = hio_litter_in_elem(io_si, el) + &
hio_litter_in_elem(io_si, el) = &
sum(flux_diags%cwd_ag_input(:)) + &
sum(flux_diags%cwd_bg_input(:)) + &
sum(flux_diags%leaf_litter_input(:)) + &
Expand All @@ -2843,6 +2850,7 @@ subroutine update_history_dyn(this,nc,nsites,sites)
hio_seed_decay_elem(io_si,el) = 0._r8
hio_seeds_in_local_elem(io_si,el) = 0._r8
hio_seed_in_extern_elem(io_si,el) = 0._r8
hio_litter_out_elem(io_si,el) = 0._r8

cpatch => sites(s)%oldest_patch
do while(associated(cpatch))
Expand All @@ -2857,7 +2865,7 @@ subroutine update_history_dyn(this,nc,nsites,sites)
sum(litt%root_fines_frag(:,:)) + &
sum(litt%ag_cwd_frag(:)) + &
sum(litt%bg_cwd_frag(:,:))) * area_frac

hio_seed_bank_elem(io_si,el) = hio_seed_bank_elem(io_si,el) + &
sum(litt%seed(:)) * area_frac

Expand Down

0 comments on commit cec41c7

Please sign in to comment.