-
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
Conversation
biogeochem/FatesCohortMod.F90
Outdated
real(r8) :: resp_m_acc | ||
real(r8) :: resp_m_acc_hold | ||
|
||
real(r8) :: resp_g_acc ! Growth respication can only be calculated at the daily timestep |
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.
biogeophys/EDAccumulateFluxesMod.F90
Outdated
@@ -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 comment
The 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
@@ -987,23 +987,15 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime) | |||
|
|||
! 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 comment
The 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
@@ -2814,6 +2815,15 @@ subroutine update_history_dyn1(this,nc,nsites,sites,bc_in) | |||
! have any meaning, otherwise they are just inialization values | |||
notnew: if( .not.(ccohort%isnew) ) then | |||
|
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.
As part of an upcoming refactor, we will be adding calls to daily fluxes that occur before we change plant number densities. As already acknowledged, the number of plants present in this point of the call sequence is not the same number of plants that generated the growth respiration flux. This is a known issue, but it outside the scope of this PR.
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.
Here is the last place in the dynamics call sequence where number density has not changed yet: https://github.com/NGEET/fates/blob/sci.1.76.3_api.35.1.0/main/EDMainMod.F90#L751
Here is where we make a call to write daily nutrient fluxes, which also happens before we change number density: https://github.com/NGEET/fates/blob/sci.1.76.3_api.35.1.0/main/EDMainMod.F90#L698
This may or may not fit into this PR @ckoven, but I did want to point out that we have another carbon flux that is triggered daily. When the nutrient model is active, if carbon is not the limiting resource, any carbon that was available for growth but was not allocated to tissues and storage will be respired off. The variable is cohort%resp_excess, and it is resolved at the end of the calls to growth, here: https://github.com/NGEET/fates/blob/main/main/EDMainMod.F90#L595 Ideally, the plant's dynamic root allocation schemes should nudge the plant's resource allocation balance so that it is not wasting resources, but nonetheless this is a term that should be accounted for if anyone is tracking NEE or other carbon flux balancing while the nutrient model is active. |
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.
Thanks @ckoven ! This mostly looks good to me. It compiled after I fixed a few very minor things.
main/EDMainMod.F90
Outdated
|
||
! 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 comment
The 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?
main/FatesHistoryInterfaceMod.F90
Outdated
@@ -2377,6 +2375,9 @@ subroutine update_history_dyn1(this,nc,nsites,sites,bc_in) | |||
hio_sum_fuel_si => this%hvars(ih_sum_fuel_si)%r81d, & | |||
hio_litter_in_si => this%hvars(ih_litter_in_si)%r81d, & | |||
hio_litter_out_si => this%hvars(ih_litter_out_si)%r81d, & | |||
hio_npp_si => this%hvars(ih_npp_si)%r82d, & |
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.
should be r81d
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.
There's a resp_acc on line 675 that needs to be updated
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
This npp_tstep needs to be deleted now.
@JessicaNeedham , that 10% decrease seems about what I would had expected, do you see it the same way? |
I think so |
Co-authored-by: Jessica Needham <10586303+JessicaNeedham@users.noreply.github.com>
… gpp does. Fixed some output units. Fixed carbon flux tracking when we bypass (ie st3 and satphen).
I believe this PR is content complete and has had a thorough examination. |
Initial regression testing underway on derecho. |
Testing on derecho against Spot checking the
Beyond this timestep, more differences show up in additional variables. The differences for the variables above are on the order of Results: |
Checking the |
This PR moves the calculation of growth respiration (GR) to the daily timestep, as a tax on daily integrated
max(0,(GPP - MR))
, instead of half-hourlymax(0,(GPP-MR))
. This will lead to a decrease in growth respiration because it includes the nighttime respiration in the loss term.Description:
By moving the GR to daily, it means that NPP is also only defined at the daily timestep as well. With one exception, I moved all history variables that depend on growth respiration to also be daily. The one exception was I kept NEP as a high frequency output for the case where a user wants to compare directly to NEE data; however this requires (1) making the assumption that GR is constant on timescales less than a day, and (2) using a given cohort's GR from the prior day (which thus introduces some slight error since cohort n will have changed since the GR was actually applied).
fixes #1194
potentially:
fixes #1229
Collaborators:
Discussed on 4/29 FATES SW call, and further discussions with @JessicaNeedham and @rgknox.
Expectation of Answer Changes:
This will be answer-changing.
Checklist
If this is your first time contributing, please read the CONTRIBUTING document.
All checklist items must be checked to enable merging this pull request:
Contributor
Integrator
Documentation
Test Results:
CTSM (or) E3SM (specify which) test hash-tag:
CTSM (or) E3SM (specify which) baseline hash-tag:
FATES baseline hash-tag:
Test Output: