unit fix on excess respiration mass balance checking #1372
+22
−19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
Excess respiration is activated when a plant is nutrient limited but continues to accumulate carbon. When stores are full, the plant will respire excess carbon. For book-keeping purposes, we make sure that carbon fluxes match the change in the carbon stocks. This excess respiration term had a unit error when calculating these balance check fluxes. There was no error in how this term actually affected NPP, which drives plant allocations, just the checking process. The unit error was fixed and descriptive text was updated.
Also, it was noticed that unit conversions of fluxes that are per year and per day, used a global variable "hlm_days_per_year". This is an integer, but was being used in multiply and divides on real numbers. Compilers should be converting this integer to a float for us, but it is better to pre-convert it to reduce warning messages and we shouldn't assume that the compilers will fix things for us. It is better practice to specify type conversions ourselves, so I applied the conversions.
Fixes: #1354
To verify that this fix I ran the following two ELM land tests:
Note that the second test is typically a 20 day test, but I wanted to run it longer to give it more time to trigger the error. Both tests now pass.
Collaborators:
@glemieux @ckoven
Expectation of Answer Changes:
This should fix failing tests in ELM.
It should not affect answers. If it does, that means the integer conversion was long overdue. :/
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: