Skip to content
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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ckoven
Copy link
Contributor

@ckoven ckoven commented May 10, 2024

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-hourly max(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.

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

  • The in-code documentation has been updated with descriptive comments
  • The documentation has been assessed to determine if updates are necessary

Integrator

  • FATES PASS/FAIL regression tests were run
  • Evaluation of test results for answer changes was performed and results provided

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:

@ckoven ckoven added the draft label May 10, 2024
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
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@@ -82,15 +82,13 @@ subroutine AccumulateFluxes_ED(nsites, sites, bc_in, bc_out, dt_time)

if ( debug ) then
Copy link
Contributor

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
Copy link
Contributor

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

Copy link
Contributor

@rgknox rgknox May 17, 2024

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.

Copy link
Contributor

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

@rgknox
Copy link
Contributor

rgknox commented Jun 12, 2024

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.

Copy link
Contributor

@JessicaNeedham JessicaNeedham left a 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.


! 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
Copy link
Contributor

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?

@@ -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, &
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be r81d

Copy link
Contributor

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.
Copy link
Contributor

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
Copy link
Contributor

Results from a global nocomp simulation with the default parameter file. Growth respiration decreased by about 10% with this change. This is just the mean over a 10 year simulation from bare ground so definitely not spun up yet.

Screenshot 2024-06-28 at 19 58 11
Screenshot 2024-06-28 at 20 01 12

@rgknox
Copy link
Contributor

rgknox commented Jul 1, 2024

@JessicaNeedham , that 10% decrease seems about what I would had expected, do you see it the same way?

@JessicaNeedham
Copy link
Contributor

@JessicaNeedham , that 10% decrease seems about what I would had expected, do you see it the same way?

I think so


! 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (hlm_use_ed_prescribed_phys .eq. itrue) then
if (hlm_use_ed_prescribed_phys .eq. ifalse) then

@@ -735,7 +735,7 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime)

! Zero cohort flux accumulators.
currentCohort%npp_tstep = 0.0_r8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
currentCohort%npp_tstep = 0.0_r8

@glemieux glemieux self-assigned this Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Final Testing
Development

Successfully merging this pull request may close these issues.

issue with growth respiration calculation
4 participants