Fix #372: Consider leaf-off litter and event fluxes in negative-growt… - #397
Open
coder-Yash886 wants to merge 1 commit into
Open
coder-Yash886 wants to merge 1 commit into
coder-Yash886 wants to merge 1 commit into
Conversation
…gative-growth limitation check
coder-Yash886
requested review from
Alomir,
dlebauer,
mdietze and
mswilburn
as code owners
September 10, 2026 08:42
Author
Author
This branch has not been deployed
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.
Closes #372
Summary
This PR updates checkNegativeCreation() in src/sipnet/limitations.c to account for leaf-off litter (both computed phenology leaf-off and event leaf-off) and event biomass fluxes, as well as coarse root deductions for leaf-on allocations when performing the negative-growth look-ahead limitation check.
Previously, checkNegativeCreation() used continuous leaf turnover rate (envi.plantLeafC * params.leafTurnoverRate) and ignored phenology leaf-off litter, event leaf-off litter, event leaf/root fluxes, and leaf-on allocations. This could result in negative pool deficits not being properly detected and reallocated during timesteps with leaf-off or event fluxes.
Proposed Changes
Leaf Deficit: Updated calculation to use fluxes.leafLitter (which includes both continuous turnover and computed phenology leaf-off litter), fluxes.eventLeafOffLitter, fluxes.leafOnCreation, fluxes.eventLeafC, and fluxes.eventLeafOnCreation.
Fine Root Deficit: Updated calculation to include fluxes.eventFineRootC.
Coarse Root Deficit: Updated calculation to include fluxes.eventCoarseRootC, as well as coarse root deductions for leaf-on allocations (leafOnFromRoot and eventLeafOnFromRoot).
Carbon Balance: Verified that reallocations between sibling pools (leafCreation
↔
↔ woodCreation and fineRootCreation
↔
↔ coarseRootCreation) preserve exact total carbon creation across biomass pools.
Added testLeafOffAndEventDeficits() to test:
Phenology leaf-off litter triggering leaf deficit reallocation to wood.
Event leaf-off litter (eventLeafOffLitter) triggering leaf deficit reallocation to wood.
Event root biomass fluxes and leaf-on root allocations in fine/coarse root deficit calculations.
Explicit verification of carbon conservation across biomass creation fluxes.
Updated reference outputs for russell_1, russell_2, and russell_3 to reflect the corrected negative growth allocations during event/leaf-off timesteps.