Skip to content
Open
Show file tree
Hide file tree
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
26 changes: 14 additions & 12 deletions biogeochem/EDPatchDynamicsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1134,8 +1134,8 @@ subroutine spawn_patches( currentSite, bc_in )

endif

currentSite%mass_balance(el)%burn_flux_to_atm = &
currentSite%mass_balance(el)%burn_flux_to_atm + &
currentSite%mass_balance(el)%burn_flux_to_atm(i_disturbance_type) = &
currentSite%mass_balance(el)%burn_flux_to_atm(i_disturbance_type) + &
leaf_burn_frac * leaf_m * nc%n

! This term increments the loss flux from surviving trees
Expand Down Expand Up @@ -2042,7 +2042,7 @@ subroutine TransLitterNewPatch(currentSite, &


if (debug) then
burn_flux0 = site_mass%burn_flux_to_atm
burn_flux0 = site_mass%burn_flux_to_atm(dist_type)
litter_stock0 = curr_litt%GetTotalLitterMass()*currentPatch%area + &
new_litt%GetTotalLitterMass()*newPatch%area
end if
Expand All @@ -2063,7 +2063,7 @@ subroutine TransLitterNewPatch(currentSite, &
new_litt%ag_cwd(c) = new_litt%ag_cwd(c) + donatable_mass*donate_m2
curr_litt%ag_cwd(c) = curr_litt%ag_cwd(c) + donatable_mass*retain_m2

site_mass%burn_flux_to_atm = site_mass%burn_flux_to_atm + burned_mass
site_mass%burn_flux_to_atm(dist_type) = site_mass%burn_flux_to_atm(dist_type) + burned_mass

! Transfer below ground CWD (none burns)
do sl = 1,currentSite%nlevsoil
Expand Down Expand Up @@ -2091,7 +2091,7 @@ subroutine TransLitterNewPatch(currentSite, &
new_litt%leaf_fines(dcmpy) = new_litt%leaf_fines(dcmpy) + donatable_mass*donate_m2
curr_litt%leaf_fines(dcmpy) = curr_litt%leaf_fines(dcmpy) + donatable_mass*retain_m2

site_mass%burn_flux_to_atm = site_mass%burn_flux_to_atm + burned_mass
site_mass%burn_flux_to_atm(dist_type) = site_mass%burn_flux_to_atm(dist_type) + burned_mass

! Transfer root fines (none burns)
do sl = 1,currentSite%nlevsoil
Expand Down Expand Up @@ -2122,7 +2122,7 @@ subroutine TransLitterNewPatch(currentSite, &
! EDMainMod start triggering.
! --------------------------------------------------------------------------
if (debug) then
burn_flux1 = site_mass%burn_flux_to_atm
burn_flux1 = site_mass%burn_flux_to_atm(dist_type)
litter_stock1 = curr_litt%GetTotalLitterMass()*remainder_area + &
new_litt%GetTotalLitterMass()*newPatch%area
error = (litter_stock1 - litter_stock0) + (burn_flux1-burn_flux0)
Expand Down Expand Up @@ -2301,7 +2301,7 @@ subroutine fire_litter_fluxes(currentSite, currentPatch, &
donatable_mass*retain_m2*dcmpy_frac
end do

site_mass%burn_flux_to_atm = site_mass%burn_flux_to_atm + burned_mass
site_mass%burn_flux_to_atm(dtype_ifire) = site_mass%burn_flux_to_atm(dtype_ifire) + burned_mass

call set_root_fraction(currentSite%rootfrac_scr, pft, currentSite%zi_soil, &
bc_in%max_rooting_depth_index_col)
Expand Down Expand Up @@ -2363,7 +2363,7 @@ subroutine fire_litter_fluxes(currentSite, currentPatch, &
donatable_mass = donatable_mass * (1.0_r8-currentCohort%fraction_crown_burned)
burned_mass = num_dead_trees * SF_val_CWD_frac_adj(c) * bstem * &
currentCohort%fraction_crown_burned
site_mass%burn_flux_to_atm = site_mass%burn_flux_to_atm + burned_mass
site_mass%burn_flux_to_atm(dtype_ifire) = site_mass%burn_flux_to_atm(dtype_ifire) + burned_mass
endif
new_litt%ag_cwd(c) = new_litt%ag_cwd(c) + donatable_mass * donate_m2
curr_litt%ag_cwd(c) = curr_litt%ag_cwd(c) + donatable_mass * retain_m2
Expand Down Expand Up @@ -2768,7 +2768,8 @@ subroutine landusechange_litter_fluxes(currentSite, currentPatch, &
donatable_mass*retain_m2*dcmpy_frac
end do

site_mass%burn_flux_to_atm = site_mass%burn_flux_to_atm + burned_mass
site_mass%burn_flux_to_atm(dtype_ilandusechange) = &
site_mass%burn_flux_to_atm(dtype_ilandusechange) + burned_mass

call set_root_fraction(currentSite%rootfrac_scr, pft, currentSite%zi_soil, &
bc_in%max_rooting_depth_index_col)
Expand Down Expand Up @@ -2828,8 +2829,8 @@ subroutine landusechange_litter_fluxes(currentSite, currentPatch, &
burned_mass = num_dead_trees * SF_val_CWD_frac(c) * bstem * &
EDPftvarcon_inst%landusechange_frac_burned(pft)

site_mass%burn_flux_to_atm = site_mass%burn_flux_to_atm + burned_mass

site_mass%burn_flux_to_atm(dtype_ilandusechange) = &
site_mass%burn_flux_to_atm(dtype_ilandusechange) + burned_mass
else ! all other pools can end up as timber products or burn or go to litter
donatable_mass = donatable_mass * (1.0_r8-EDPftvarcon_inst%landusechange_frac_exported(pft)) * &
(1.0_r8-EDPftvarcon_inst%landusechange_frac_burned(pft))
Expand All @@ -2841,7 +2842,8 @@ subroutine landusechange_litter_fluxes(currentSite, currentPatch, &
woodproduct_mass = num_dead_trees * SF_val_CWD_frac(c) * bstem * &
EDPftvarcon_inst%landusechange_frac_exported(pft)

site_mass%burn_flux_to_atm = site_mass%burn_flux_to_atm + burned_mass
site_mass%burn_flux_to_atm(dtype_ilandusechange) = &
site_mass%burn_flux_to_atm(dtype_ilandusechange) + burned_mass

! Amount of trunk mass exported off site [kg/m2]
elflux_diags%exported_harvest = elflux_diags%exported_harvest + &
Expand Down
2 changes: 1 addition & 1 deletion main/ChecksBalancesMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ subroutine CheckIntegratedMassPools(site)
ibal%iflux_litter = ibal%iflux_litter + &
tot_litter_input - &
(site_mass%frag_out*area_inv - ediag%tot_seed_turnover) - &
(site_mass%burn_flux_to_atm*area_inv - ediag%burned_liveveg)
(sum(site_mass%burn_flux_to_atm(:))*area_inv - ediag%burned_liveveg)


ediag%err_liveveg = ibal%iflux_liveveg - ibal%state_liveveg
Expand Down
8 changes: 4 additions & 4 deletions main/EDMainMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -926,8 +926,8 @@ subroutine ed_update_site( currentSite, bc_in, bc_out, is_restarting )

! Set boundary condition to HLM for carbon loss to atm from fires and grazing
! [kgC/ha/day]*[ha/m2]*[day/s] = [kg/m2/s]
bc_out%fire_closs_to_atm_si = site_cmass%burn_flux_to_atm * ha_per_m2 * days_per_sec

bc_out%fire_closs_to_atm_si = sum(site_cmass%burn_flux_to_atm(:)) * ha_per_m2 * days_per_sec
bc_out%grazing_closs_to_atm_si = site_cmass%herbivory_flux_out * ha_per_m2 * days_per_sec


Expand Down Expand Up @@ -1006,7 +1006,7 @@ subroutine TotalBalanceCheck (currentSite, call_index )

flux_out = sum(site_mass%wood_product_harvest(:)) + &
sum(site_mass%wood_product_landusechange(:)) + &
site_mass%burn_flux_to_atm + &
sum(site_mass%burn_flux_to_atm(:)) + &
site_mass%seed_out + &
site_mass%flux_generic_out + &
site_mass%frag_out + &
Expand Down Expand Up @@ -1039,7 +1039,7 @@ subroutine TotalBalanceCheck (currentSite, call_index )
write(fates_log(),*) 'wood_product_harvest: ',site_mass%wood_product_harvest(:)
write(fates_log(),*) 'wood_product_landusechange: ',site_mass%wood_product_landusechange(:)
write(fates_log(),*) 'error from patch resizing: ',site_mass%patch_resize_err
write(fates_log(),*) 'burn_flux_to_atm: ',site_mass%burn_flux_to_atm
write(fates_log(),*) 'burn_flux_to_atm: ',site_mass%burn_flux_to_atm(:)
write(fates_log(),*) 'seed_out: ',site_mass%seed_out
write(fates_log(),*) 'flux_generic_out: ',site_mass%flux_generic_out
write(fates_log(),*) 'frag_out: ',site_mass%frag_out
Expand Down
6 changes: 3 additions & 3 deletions main/EDTypesMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ module EDTypesMod

real(r8) :: wood_product_landusechange(maxpft) ! Total mass exported as wood product from land use change [kg/site/day]

real(r8) :: burn_flux_to_atm ! Total mass burned and exported to the atmosphere [kg/site/day]
real(r8) :: burn_flux_to_atm(n_dist_types) ! Total mass burned and exported to the atmosphere [kg/site/day]

real(r8) :: flux_generic_in ! Used for prescribed or artificial input fluxes
! and initialization [kg/site/day]
Expand All @@ -311,7 +311,7 @@ module EDTypesMod
! due to re-sizing patches when area math starts to lose
! precision

real(r8) :: herbivory_flux_out ! loss of element due to grazing (and/or browsing) by herbivores
real(r8) :: herbivory_flux_out ! loss of element due to grazing (and/or browsing) by herbivores [kg/site/day]

contains

Expand Down Expand Up @@ -726,7 +726,7 @@ subroutine ZeroMassBalFlux(this)
this%frag_out = 0._r8
this%wood_product_harvest(:) = 0._r8
this%wood_product_landusechange(:) = 0._r8
this%burn_flux_to_atm = 0._r8
this%burn_flux_to_atm(:) = 0._r8
this%flux_generic_in = 0._r8
this%flux_generic_out = 0._r8
this%patch_resize_err = 0._r8
Expand Down
Loading