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

Carbon allocation bug fix #863

Merged
merged 3 commits into from
Jun 15, 2022
Merged

Conversation

mpaiao
Copy link
Contributor

@mpaiao mpaiao commented May 4, 2022

Revised the carbon allocation routine to ensure allocation to fine roots and leaves are truly proportional to demand.

Description:

  1. Bug fix in DailyPRTAllometricCarbon (parteh/PRTAllometricCarbonMod.F90). When allocating to different tissues, the code was subtracting allocation of tissues before calculating the amount for the next tissue, potentially under-allocating carbon to fine roots.
  2. Minor code updates to simplify allocation calculations. It now uses a single
    allocation factor based on availability and total need, which is applied to all tissues.
  3. Replaced a few if statements with select case, which simplifies adding other hypotheses
    in the future (and it's safer for selecting cases).

This pull request addresses the bug discussed in #784 and supersedes pull request #800.
Additional minor changes in former PR #800 will be added as subsequent pull requests.

Collaborators:

@rgknox @glemieux @jkshuman

Expectation of Answer Changes:

Checklist:

  • My change requires a change to the documentation.
  • I have updated the in-code documentation .AND. (the technical note .OR. the wiki) accordingly.
  • I have read the CONTRIBUTING document.
  • FATES PASS/FAIL regression tests were run
  • If answers were expected to change, evaluation was performed and provided

Test Results:

CTSM (or) E3SM (specify which) test hash-tag:

CTSM (or) E3SM (specify which) baseline hash-tag:

FATES baseline hash-tag:

Test Output:

…ots and leaves are truly

proportional to demand.

Description:

1. Bug fix in DailyPRTAllometricCarbon (parteh/PRTAllometricCarbonMod.F90). When allocating
to different tissues, the code was subtracting allocation of tissues before calculating
the amount for the next tissue, potentially under-allocating carbon to fine roots.
2. Minor code updates to simplify allocation calculations. It now uses a single
allocation factor based on availability and total need, which is applied to all tissues.
3.  Replaced a few if statements with select case, which simplifies adding other hypotheses
in the future (and it's safer for selecting cases).

This pull request addresses the bug discussed in NGEET#784 and supersedes pull request NGEET#800.
Additional minor changes in former PR NGEET#800 will be added as subsequent pull requests.
@glemieux
Copy link
Contributor

Regression testing against baseline fates-sci.1.57.2_api.23.0.0-ctsm5.1.dev098 is complete. There are no unexpected failures. The satellite phenology and static stand structure test mods all pass B4B which is expected. DIFFs appear to be as expected with initial and daily small differences in carbon balance and related variables. Interestingly the PRT2 testmod passes B4B, but I'm not sure why this would be so. @rgknox do you have thoughts here?

Results can be found on Cheyenne at:
/glade/u/home/glemieux/scratch/ctsm-tests/tests_pr863-sci_1_57_2

@rgknox
Copy link
Contributor

rgknox commented Jun 14, 2022

That makes sense, the PRT2 has a completely different allocation module, only the carbon-only code was changed. I believe the PRT2 module does not have the bug that @mpaiao is fixing, so that should be fine

@glemieux glemieux merged commit cb379c5 into NGEET:master Jun 15, 2022
@mpaiao mpaiao deleted the mpaiao-pr-carbon-alloc branch December 5, 2023 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants