Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #962 +/- ##
===========================================
- Coverage 94.27% 94.21% -0.06%
===========================================
Files 79 79
Lines 6513 6518 +5
===========================================
+ Hits 6140 6141 +1
- Misses 373 377 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
This PR contains fixes for incorrect plant growth calculations. The culprits are:
The$\tau_r = \tau_r / 12$ increases the speed of turnover in the model by a factor of $12^2 = 144$ compared to the correct $\tau_r = \tau_r \times 12$ .
PlantsModel._setupupdated the turnover traits for the time step of the model, but did so in the wrong direction. The trait values are expressed in the models as reciprocals, and soThe
PlantsMode._setupwas not updating respiration rates for the time step of the model at all - so the full annual respiration costs were being removed at each time step. These rates are straightforward factors depending on masses, so are simply divided by the number of time steps.The subcanopy vegetation biomass (should be kg C) was being updated with µg C values, so implausibly then contained 10 million tons of carbon per m2. That pushed the equations in the
abiotic_simpleso far outside bounds that canopy temperature plummeted to -20°C and the plants then all slowly shrank to death.There are likely to be more issues, but hopefully this gets the model into territory where we can calibrate it.
I had to update the test values in one of the stochiometry tests - I'm assuming these are code-derived values from the previous aberrant behaviour.
Fixes #961
Type of change
Key checklist
pre-commitchecks:$ pre-commit run -a$ poetry run pytestFurther checks