Skip to content

Commit

Permalink
passing ci from FATES into MEGAN
Browse files Browse the repository at this point in the history
  • Loading branch information
rosiealice committed Oct 28, 2024
1 parent b53ee98 commit 0f84a5a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
21 changes: 13 additions & 8 deletions src/biogeochem/VOCEmissionMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ subroutine VOCEmission (bounds, num_soilp, filter_soilp, &
fsun240 => canopystate_inst%fsun240_patch , & ! Input: [real(r8) (:) ] sunlit fraction of canopy last 240 hrs
elai => canopystate_inst%elai_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index with burying by snow
elai240 => canopystate_inst%elai240_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index with burying by snow last 240 hrs

ci_fates => canopystate_inst%ci_patch , & !Input: [real(r8) (:) ] FATES-calculated internalleaf ci
cisun_z => photosyns_inst%cisun_z_patch , & ! Input: [real(r8) (:,:) ] sunlit intracellular CO2 (Pa)
cisha_z => photosyns_inst%cisha_z_patch , & ! Input: [real(r8) (:,:) ] shaded intracellular CO2 (Pa)

Expand Down Expand Up @@ -587,7 +587,8 @@ subroutine VOCEmission (bounds, num_soilp, filter_soilp, &
patchpft = canopystate_inst%voc_pftindex_patch(p)
else
patchpft = patch%itype(p)
endif
endif

if ( trim(meg_cmp%name) == 'isoprene' .and. shr_megan_mapped_emisfctrs) then
epsilon = get_map_EF(patchpft,g, vocemis_inst)
else
Expand All @@ -600,22 +601,27 @@ subroutine VOCEmission (bounds, num_soilp, filter_soilp, &
! Activity factor for PPFD
gamma_p = get_gamma_P(par_sun, par24_sun, par240_sun, par_sha, par24_sha, par240_sha, &
fsun(p), fsun240(p), forc_solad240(p),forc_solai240(p), LDF(class_num), cp, alpha)

! Activity factor for T
gamma_t = get_gamma_T(t_veg240(p), t_veg24(p),t_veg(p), ct1(class_num), ct2(class_num),&
betaT(class_num),LDF(class_num), Ceo(class_num), Eopt, topt, patch%itype(p))
betaT(class_num),LDF(class_num), Ceo(class_num), Eopt, topt, patchpft)

! Activity factor for Leaf Age
gamma_a = get_gamma_A(patch%itype(p), elai240(p),elai(p),class_num)
gamma_a = get_gamma_A(patchpft, elai240(p),elai(p),class_num)

! Activity factor for CO2 (only for isoprene)
if (trim(meg_cmp%name) == 'isoprene') then
co2_ppmv = 1.e6_r8*forc_pco2(g)/forc_pbot(c)
gamma_c = get_gamma_C(cisun_z(p,1),cisha_z(p,1),forc_pbot(c),fsun(p), co2_ppmv)
if(use_fates)then
gamma_c = get_gamma_C(ci_fates(p),ci_fates(p),forc_pbot(c),fsun(p), co2_ppmv)
else
gamma_c = get_gamma_C(cisun_z(p,1),cisha_z(p,1),forc_pbot(c),fsun(p), co2_ppmv)
endif

else
gamma_c = 1._r8
end if

! Calculate total scaling factor
gamma = gamma_l * gamma_sm * gamma_a * gamma_p * gamma_T * gamma_c

Expand All @@ -626,7 +632,6 @@ subroutine VOCEmission (bounds, num_soilp, filter_soilp, &
! assign to arrays for history file output (not weighted by landfrac)
meg_out(imeg)%flux_out(p) = meg_out(imeg)%flux_out(p) &
+ epsilon * gamma * megemis_units_factor*1.e-3_r8 ! Kg/m2/sec

if (imeg==1) then
!
gamma_out(p)=gamma
Expand Down
2 changes: 2 additions & 0 deletions src/biogeophys/CanopyStateType.F90
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ module CanopyStateType
real(r8) , pointer :: hbot_patch (:) ! patch canopy bottom (m)
real(r8) , pointer :: z0m_patch (:) ! patch momentum roughness length (m)
real(r8) , pointer :: displa_patch (:) ! patch displacement height (m)
real(r8) , pointer :: ci_patch (:) ! Internal leaf CO2 concentration for MEGAN
real(r8) , pointer :: fsun_patch (:) ! patch sunlit fraction of canopy
real(r8) , pointer :: fsun24_patch (:) ! patch 24hr average of sunlit fraction of canopy
real(r8) , pointer :: fsun240_patch (:) ! patch 240hr average of sunlit fraction of canopy
Expand Down Expand Up @@ -140,6 +141,7 @@ subroutine InitAllocate(this, bounds)
allocate(this%hbot_patch (begp:endp)) ; this%hbot_patch (:) = nan
allocate(this%z0m_patch (begp:endp)) ; this%z0m_patch (:) = nan
allocate(this%displa_patch (begp:endp)) ; this%displa_patch (:) = nan
allocate(this%ci_patch (begp:endp)) ; this%ci_patch (:) = nan
allocate(this%fsun_patch (begp:endp)) ; this%fsun_patch (:) = nan
allocate(this%fsun24_patch (begp:endp)) ; this%fsun24_patch (:) = nan
allocate(this%fsun240_patch (begp:endp)) ; this%fsun240_patch (:) = nan
Expand Down
6 changes: 3 additions & 3 deletions src/utils/clmfates_interfaceMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2577,8 +2577,8 @@ subroutine wrap_photosynthesis(this, nc, bounds, fn, filterp, &
rssun => photosyns_inst%rssun_patch , &
rssha => photosyns_inst%rssha_patch, &
psnsun => photosyns_inst%psnsun_patch, &
psnsha => photosyns_inst%psnsha_patch)

psnsha => photosyns_inst%psnsha_patch, &
ci => canopystate_inst%ci_patch)
do s = 1, this%fates(nc)%nsites

c = this%f2hmap(nc)%fcolumn(s)
Expand Down Expand Up @@ -2645,7 +2645,7 @@ subroutine wrap_photosynthesis(this, nc, bounds, fn, filterp, &
this%fates(nc)%bc_in(s)%filter_photo_pa(ifp) = 3
rssun(p) = this%fates(nc)%bc_out(s)%rssun_pa(ifp)
rssha(p) = this%fates(nc)%bc_out(s)%rssha_pa(ifp)

ci(p) = this%fates(nc)%bc_out(s)%ci_pa(ifp)
! These fields are marked with a bad-value flag
photosyns_inst%psnsun_patch(p) = spval
photosyns_inst%psnsha_patch(p) = spval
Expand Down

0 comments on commit 0f84a5a

Please sign in to comment.