-
Notifications
You must be signed in to change notification settings - Fork 92
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
Move growth respiration to daily timestep #1197
Changes from 3 commits
8104707
d03b44f
2df2832
b6cad14
9080ba3
a0dea3b
f5a7caa
1d52034
366b73a
3f688d7
a9758b3
50bf6b9
9d28eb6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ module EDAccumulateFluxesMod | |
!------------------------------------------------------------------------------ | ||
! !DESCRIPTION: | ||
! This routine accumulates NPP, GPP and respiration of each cohort over the course of each 24 hour period. | ||
! The fluxes are stored per cohort, and the npp_tstep (etc) fluxes are calcualted in EDPhotosynthesis | ||
! The fluxes are stored per cohort, and the gpp_tstep (etc) fluxes are calculated in EDPhotosynthesis | ||
! This routine cannot be in EDPhotosynthesis because EDPhotosynthesis is a loop and therefore would | ||
! erroneously add these things up multiple times. | ||
! Rosie Fisher. March 2014. | ||
|
@@ -82,15 +82,13 @@ subroutine AccumulateFluxes_ED(nsites, sites, bc_in, bc_out, dt_time) | |
|
||
if ( debug ) then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should remove this debug statement. we can add these types of write statements in when needed, but not maintained in the main codebase |
||
|
||
write(fates_log(),*) 'EDAccumFlux 64 ',ccohort%npp_tstep | ||
write(fates_log(),*) 'EDAccumFlux 66 ',ccohort%gpp_tstep | ||
write(fates_log(),*) 'EDAccumFlux 67 ',ccohort%resp_tstep | ||
write(fates_log(),*) 'EDAccumFlux 67 ',ccohort%resp_m_tstep | ||
|
||
endif | ||
|
||
ccohort%npp_acc = ccohort%npp_acc + ccohort%npp_tstep | ||
ccohort%gpp_acc = ccohort%gpp_acc + ccohort%gpp_tstep | ||
ccohort%resp_acc = ccohort%resp_acc + ccohort%resp_tstep | ||
ccohort%resp_m_acc = ccohort%resp_m_acc + ccohort%resp_m_tstep | ||
|
||
ccohort%sym_nfix_daily = ccohort%sym_nfix_daily + ccohort%sym_nfix_tstep | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -735,7 +735,7 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime) | |
|
||
! Zero cohort flux accumulators. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This npp_tstep needs to be deleted now. |
||
currentCohort%npp_tstep = 0.0_r8 | ||
ckoven marked this conversation as resolved.
Show resolved
Hide resolved
|
||
currentCohort%resp_tstep = 0.0_r8 | ||
currentCohort%resp_m_tstep = 0.0_r8 | ||
currentCohort%gpp_tstep = 0.0_r8 | ||
currentCohort%rdark = 0.0_r8 | ||
currentCohort%resp_m = 0.0_r8 | ||
|
@@ -987,23 +987,15 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime) | |
|
||
rgknox marked this conversation as resolved.
Show resolved
Hide resolved
|
||
! convert from kgC/indiv/s to kgC/indiv/timestep | ||
currentCohort%resp_m = currentCohort%resp_m * dtime | ||
currentCohort%resp_m_tstep = currentCohort%resp_m ! these two things are the same. we should get rid of one them | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. agreed, I vote we get rid of resp_m since resp_m_tstep is more descriptive |
||
currentCohort%gpp_tstep = currentCohort%gpp_tstep * dtime | ||
currentCohort%ts_net_uptake = currentCohort%ts_net_uptake * dtime | ||
|
||
if ( debug ) write(fates_log(),*) 'EDPhoto 911 ', currentCohort%gpp_tstep | ||
if ( debug ) write(fates_log(),*) 'EDPhoto 912 ', currentCohort%resp_tstep | ||
if ( debug ) write(fates_log(),*) 'EDPhoto 912 ', currentCohort%resp_m_tstep | ||
if ( debug ) write(fates_log(),*) 'EDPhoto 913 ', currentCohort%resp_m | ||
|
||
|
||
currentCohort%resp_g_tstep = prt_params%grperc(ft) * & | ||
(max(0._r8,currentCohort%gpp_tstep - currentCohort%resp_m)) | ||
|
||
|
||
currentCohort%resp_tstep = currentCohort%resp_m + & | ||
currentCohort%resp_g_tstep ! kgC/indiv/ts | ||
currentCohort%npp_tstep = currentCohort%gpp_tstep - & | ||
currentCohort%resp_tstep ! kgC/indiv/ts | ||
|
||
! Accumulate the combined conductance (stomatal+leaf boundary layer) | ||
! Note that currentCohort%g_sb_laweight is weighted by the leaf area | ||
! of each cohort and has units of [m/s] * [m2 leaf] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's a resp_acc on line 675 that needs to be updated |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -335,7 +335,8 @@ subroutine ed_integrate_state_variables(currentSite, bc_in, bc_out ) | |
use FatesConstantsMod, only : itrue | ||
use FatesConstantsMod , only : nearzero | ||
use EDCanopyStructureMod , only : canopy_structure | ||
|
||
use PRTParametersMod , only : prt_params | ||
|
||
! !ARGUMENTS: | ||
|
||
type(ed_site_type) , intent(inout) :: currentSite | ||
|
@@ -498,7 +499,7 @@ subroutine ed_integrate_state_variables(currentSite, bc_in, bc_out ) | |
! We don't explicitly define a respiration rate for prescribe phys | ||
! but we do need to pass mass balance. So we say it is zero respiration | ||
currentCohort%gpp_acc = currentCohort%npp_acc | ||
currentCohort%resp_acc = 0._r8 | ||
currentCohort%resp_m_acc = 0._r8 | ||
|
||
end if | ||
|
||
|
@@ -514,14 +515,30 @@ subroutine ed_integrate_state_variables(currentSite, bc_in, bc_out ) | |
! photosynthesis step | ||
! ----------------------------------------------------------------------------- | ||
|
||
currentCohort%npp_acc_hold = currentCohort%npp_acc * real(hlm_days_per_year,r8) | ||
currentCohort%gpp_acc_hold = currentCohort%gpp_acc * real(hlm_days_per_year,r8) | ||
currentCohort%resp_acc_hold = currentCohort%resp_acc * real(hlm_days_per_year,r8) | ||
currentCohort%resp_m_acc_hold = currentCohort%resp_m_acc * real(hlm_days_per_year,r8) | ||
|
||
! at this point we have the info we need to calculate growth respiration | ||
! as a "tax" on the difference between daily GPP and daily maintenance respiration | ||
if (hlm_use_ed_prescribed_phys .eq. itrue) then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this if else statement the wrong way around? if prescribed physiology is true then we should set resp_g_acc to 0 as in the comments?
ckoven marked this conversation as resolved.
Show resolved
Hide resolved
|
||
currentCohort%resp_g_acc = prt_params%grperc(ft) * & | ||
max(0._r8,(currentCohort%gpp_acc - currentCohort%resp_m_acc)) | ||
currentCohort%resp_g_acc_hold = currentCohort%resp_g_acc * real(hlm_days_per_year,r8) | ||
else | ||
! set growth respiration to zero in prescribed physiology mode, | ||
! that way the npp_acc vars will be set to the nominal gpp values set above. | ||
currentCohort%resp_g_acc = 0._r8 | ||
currentCohort%resp_g_acc_hold = 0._r8 | ||
endif | ||
|
||
! calculate the npp as the difference between gpp and autotrophic respiration | ||
currentCohort%npp_acc = currentCohort%gpp_acc - (currentCohort%resp_m_acc + currentCohort%resp_g_acc) | ||
currentCohort%npp_acc_hold = currentCohort%gpp_acc_hold - (currentCohort%resp_m_acc_hold + currentCohort%resp_g_acc_hold) | ||
|
||
! Passing gpp_acc_hold to HLM | ||
bc_out%gpp_site = bc_out%gpp_site + currentCohort%gpp_acc_hold * & | ||
AREA_INV * currentCohort%n / hlm_days_per_year / sec_per_day | ||
bc_out%ar_site = bc_out%ar_site + currentCohort%resp_acc_hold * & | ||
bc_out%ar_site = bc_out%ar_site + (currentCohort%resp_m_acc_hold + currentCohort%resp_g_acc_hold) * & | ||
AREA_INV * currentCohort%n / hlm_days_per_year / sec_per_day | ||
|
||
! Conduct Maintenance Turnover (parteh) | ||
|
@@ -630,7 +647,8 @@ subroutine ed_integrate_state_variables(currentSite, bc_in, bc_out ) | |
currentCohort%gpp_acc * currentCohort%n | ||
|
||
site_cmass%aresp_acc = site_cmass%aresp_acc + & | ||
(currentCohort%resp_acc+currentCohort%resp_excess) * currentCohort%n | ||
(currentCohort%resp_m_acc+currentCohort%resp_g_acc+currentCohort%resp_excess) * & | ||
currentCohort%n | ||
|
||
call currentCohort%prt%CheckMassConservation(ft,5) | ||
|
||
|
@@ -1050,11 +1068,13 @@ subroutine bypass_dynamics(currentSite) | |
|
||
currentCohort%npp_acc_hold = currentCohort%npp_acc * real(hlm_days_per_year,r8) | ||
currentCohort%gpp_acc_hold = currentCohort%gpp_acc * real(hlm_days_per_year,r8) | ||
currentCohort%resp_acc_hold = currentCohort%resp_acc * real(hlm_days_per_year,r8) | ||
currentCohort%resp_g_acc_hold = currentCohort%resp_g_acc * real(hlm_days_per_year,r8) | ||
currentCohort%resp_m_acc_hold = currentCohort%resp_m_acc * real(hlm_days_per_year,r8) | ||
|
||
currentCohort%npp_acc = 0.0_r8 | ||
currentCohort%gpp_acc = 0.0_r8 | ||
currentCohort%resp_acc = 0.0_r8 | ||
currentCohort%resp_g_acc = 0.0_r8 | ||
currentCohort%resp_m_acc = 0.0_r8 | ||
|
||
! No need to set the "net_art" terms to zero | ||
! they are zeroed at the beginning of the daily step | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ckoven , do we need resp_g_acc? The _acc variable was created to track the accumulation of the flux through the fast timesteps over the course of the day. Since we don't accumulate growth respiration anymore, since it is defined only at the end of the day, I believe we only need resp_g_acc_hold, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, this was a thing I wasn't sure about. I was guessing that it is as you describe, but wanted to include the
_acc
variable to be on the safe side. If you don't think it is needed, then happy to remove.