Skip to content
This repository has been archived by the owner on Sep 14, 2018. It is now read-only.

Commit

Permalink
Merge pull request #1 from rgknox/bchristo-planthydro-longlived-cxu
Browse files Browse the repository at this point in the history
added a dead plant storage term
  • Loading branch information
xuchongang authored Jan 10, 2018
2 parents bc2996d + c0ca0a2 commit 8aa7485
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 13 deletions.
5 changes: 4 additions & 1 deletion biogeochem/EDCohortDynamicsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,10 @@ subroutine terminate_cohorts( currentSite, patchptr, level )
currentSite%root_litter_diagnostic_input_carbonflux(currentCohort%pft) + &
currentCohort%n * (currentCohort%br+currentCohort%bstore) * hlm_days_per_year / AREA

if (hlm_use_planthydro.eq.itrue) call DeallocateHydrCohort(currentCohort)
if( hlm_use_planthydro == itrue ) then
call AccumulateMortalityWaterStorage(currentSite,currentCohort,currentCohort%n)
call DeallocateHydrCohort(currentCohort)
end if

deallocate(currentCohort)
endif
Expand Down
12 changes: 10 additions & 2 deletions biogeochem/EDLoggingMortalityMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@ module EDLoggingMortalityMod
use FatesInterfaceMod , only : hlm_model_day
use FatesInterfaceMod , only : hlm_day_of_year
use FatesInterfaceMod , only : hlm_days_per_year
use FatesInterfaceMod , only : hlm_use_logging
use FatesInterfaceMod , only : hlm_use_logging
use FatesInterfaceMod , only : hlm_use_planthydro
use FatesConstantsMod , only : itrue,ifalse
use FatesGlobals , only : endrun => fates_endrun
use FatesGlobals , only : fates_log
use shr_log_mod , only : errMsg => shr_log_errMsg

use FatesPlantHydraulicsMod, only : AccumulateMortalityWaterStorage

implicit none
private

Expand Down Expand Up @@ -289,6 +291,12 @@ subroutine logging_litter_fluxes(currentSite, currentPatch, newPatch, patch_site
litter_area = currentPatch%area
np_mult = patch_site_areadis/newPatch%area


if( hlm_use_planthydro == itrue ) then
call AccumulateMortalityWaterStorage(currentSite,currentCohort,(direct_dead+indirect_dead))
end if


! ----------------------------------------------------------------------------------------
! Handle woody litter flux for non-bole components of biomass
! This litter is distributed between the current and new patches, &
Expand Down
16 changes: 16 additions & 0 deletions biogeochem/EDPatchDynamicsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module EDPatchDynamicsMod
use FatesConstantsMod , only : r8 => fates_r8
use FatesConstantsMod , only : itrue
use FatesPlantHydraulicsMod, only : InitHydrCohort
use FatesPlantHydraulicsMod, only : AccumulateMortalityWaterStorage
use FatesPlantHydraulicsMod, only : DeallocateHydrCohort
use EDLoggingMortalityMod, only : logging_litter_fluxes
use EDLoggingMortalityMod, only : logging_time
Expand Down Expand Up @@ -843,6 +844,10 @@ subroutine fire_litter_fluxes(currentSite, cp_target, new_patch_target, patch_si
bcroot = (currentCohort%bsw + currentCohort%bdead) * (1.0_r8 - EDPftvarcon_inst%allom_agb_frac(p) )
! density of dead trees per m2.
dead_tree_density = (currentCohort%fire_mort * currentCohort%n*patch_site_areadis/currentPatch%area) / AREA

if( hlm_use_planthydro == itrue ) then
call AccumulateMortalityWaterStorage(currentSite,currentCohort,dead_tree_density*AREA)
end if

! Unburned parts of dead tree pool.
! Unburned leaves and roots
Expand Down Expand Up @@ -1019,6 +1024,10 @@ subroutine mortality_litter_fluxes(currentSite, cp_target, new_patch_target, pat
canopy_mortality_root_litter(p) = canopy_mortality_root_litter(p)+ &
canopy_dead*(currentCohort%br+currentCohort%bstore)

if( hlm_use_planthydro == itrue ) then
call AccumulateMortalityWaterStorage(currentSite,currentCohort, canopy_dead)
end if

else
if(EDPftvarcon_inst%woody(currentCohort%pft) == 1)then

Expand All @@ -1029,6 +1038,10 @@ subroutine mortality_litter_fluxes(currentSite, cp_target, new_patch_target, pat
understorey_dead* currentCohort%bl
canopy_mortality_root_litter(p)= canopy_mortality_root_litter(p)+ &
understorey_dead*(currentCohort%br+currentCohort%bstore)

if( hlm_use_planthydro == itrue ) then
call AccumulateMortalityWaterStorage(currentSite,currentCohort, understorey_dead)
end if

! FIX(SPM,040114) - clarify this comment
! grass is not killed by canopy mortality disturbance events.
Expand All @@ -1037,6 +1050,9 @@ subroutine mortality_litter_fluxes(currentSite, cp_target, new_patch_target, pat
! no-op
endif
endif





currentCohort => currentCohort%taller
Expand Down
7 changes: 7 additions & 0 deletions biogeochem/EDPhysiologyMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module EDPhysiologyMod
use FatesInterfaceMod, only : hlm_freq_day
use FatesInterfaceMod, only : hlm_day_of_year
use FatesInterfaceMod, only : numpft
use FatesInterfaceMod, only : hlm_use_planthydro
use FatesConstantsMod, only : r8 => fates_r8
use EDPftvarcon , only : EDPftvarcon_inst
use FatesInterfaceMod, only : bc_in_type
Expand All @@ -32,6 +33,7 @@ module EDPhysiologyMod
use FatesGlobals , only : endrun => fates_endrun
use EDParamsMod , only : fates_mortality_disturbance_fraction
use FatesConstantsMod , only : itrue,ifalse
use FatesPlantHydraulicsMod , only : AccumulateMortalityWaterStorage

implicit none
private
Expand Down Expand Up @@ -1217,6 +1219,11 @@ subroutine CWD_Input( currentSite, currentPatch)
(dead_n_ilogging+dead_n_dlogging) * &
hlm_freq_day * currentPatch%area

if( hlm_use_planthydro == itrue ) then
call AccumulateMortalityWaterStorage(currentSite,currentCohort,dead_n)
end if


do c = 1,ncwd

currentPatch%cwd_BG_in(c) = currentPatch%cwd_BG_in(c) + (currentCohort%bdead+currentCohort%bsw) * &
Expand Down
49 changes: 47 additions & 2 deletions biogeophys/FatesPlantHydraulicsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ module FatesPlantHydraulicsMod
__FILE__
!
! !PUBLIC MEMBER FUNCTIONS:
public :: AccumulateMortalityWaterStorage
public :: hydraulics_drive
public :: InitHydrSites
public :: HydrSiteColdStart
Expand Down Expand Up @@ -842,7 +843,11 @@ subroutine UpdateH2OVeg(nsites,sites,bc_out)
enddo !end patch loop

csite_hydr%h2oveg = csite_hydr%h2oveg / AREA
bc_out(s)%plant_stored_h2o_si = csite_hydr%h2oveg

! Note that h2oveg_dead is incremented wherever we have litter fluxes
! and it will be reduced via an evaporation term
bc_out(s)%plant_stored_h2o_si = csite_hydr%h2oveg + csite_hydr%h2oveg_dead

end do

return
Expand Down Expand Up @@ -2165,14 +2170,54 @@ subroutine hydraulics_bc ( nsites, sites,bc_in,bc_out,dtime )
! The Host Land Model may need to know what the total stored vegetation water is
! in order for it to fill its balance checks

bc_out(s)%plant_stored_h2o_si = site_hydr%h2oveg
bc_out(s)%plant_stored_h2o_si = site_hydr%h2oveg + site_hydr%h2oveg_dead



enddo !site

end subroutine Hydraulics_BC

! =====================================================================================


subroutine AccumulateMortalityWaterStorage(csite,ccohort,delta_n)

! ---------------------------------------------------------------------------
! This subroutine accounts for the water bound in plants that have
! just died. This water is accumulated at the site level for all plants
! that die.
! In another routine, this pool is reduced as water vapor flux, and
! passed to the HLM.
! ---------------------------------------------------------------------------


! Arguments

type(ed_site_type), intent(inout), target :: csite
type(ed_cohort_type) , intent(inout), target :: ccohort
real(r8), intent(in) :: delta_n ! Loss in number density
! for this cohort /ha/day

! Locals
type(ed_site_hydr_type), pointer :: csite_hydr
type(ed_cohort_hydr_type), pointer :: ccohort_hydr

ccohort_hydr => ccohort%co_hydr
csite_hydr => csite%si_hydr

csite_hydr%h2oveg_dead = csite_hydr%h2oveg_dead + &
(sum(ccohort_hydr%th_ag(:)*ccohort_hydr%v_ag(:)) + &
sum(ccohort_hydr%th_bg(:)*ccohort_hydr%v_bg(:)) + &
sum(ccohort_hydr%th_aroot(:)*ccohort_hydr%v_aroot_layer(:)))* &
denh2o*delta_n/AREA

return
end subroutine AccumulateMortalityWaterStorage




!-------------------------------------------------------------------------------!

subroutine Hydraulics_1DSolve(cc_p, ft, z_node, v_node, ths_node, thr_node, kmax_bound, kmax_upper, kmax_lower, &
Expand Down
6 changes: 5 additions & 1 deletion main/FatesHydraulicsMemMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ module FatesHydraulicsMemMod
! cohorts to column level (mm)
real(r8) :: dwat_veg ! change in stored water in vegetation
! column level (kg)
real(r8) :: h2oveg ! stored water in vegetation (kg)
real(r8) :: h2oveg ! stored water in vegetation (kg/m2)

real(r8) :: h2oveg_dead ! stored water in dead vegetation (kg/m2)


! Hold Until Van Genuchten is implemented
! col inverse of air-entry pressure [MPa-1] (for van Genuchten SWC only)
Expand Down Expand Up @@ -249,6 +252,7 @@ subroutine InitHydrSite(this)
this%errh2o_hyd = nan
this%dwat_veg = nan
this%h2oveg = nan
this%h2oveg_dead = 0.0_r8
return
end subroutine InitHydrSite

Expand Down
16 changes: 9 additions & 7 deletions main/FatesInterfaceMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -524,15 +524,17 @@ module FatesInterfaceMod

! FATES Hydraulics

real(r8) :: plant_stored_h2o_si ! stored water in vegetation (kg/m2 H2O)
! Assuming density of 1Mg/m3 ~= mm/m2 H2O
! This must be set and transfered prior to clm_drv()
! following the calls to ed_update_site()
! ed_update_site() is called during both the restart
! and coldstart process
real(r8) :: plant_stored_h2o_si ! stored water in LIVE+DEAD vegetation (kg/m2 H2O)
! Assuming density of 1Mg/m3 ~= mm/m2 H2O
! This must be set and transfered prior to clm_drv()
! following the calls to ed_update_site()
! ed_update_site() is called during both the restart
! and coldstart process

real(r8),allocatable :: qflx_soil2root_sisl(:) ! Water flux from soil into root by site and soil layer
! [mm H2O/s] [+ into root]



end type bc_out_type

Expand Down

0 comments on commit 8aa7485

Please sign in to comment.