[FIX] Jabowa: align self.grow to per-step convention#404
Merged
Conversation
Memory mortality assumes plant_module.grow stores a per-step increment (consistent with Bettina's m^3/step). Jabowa stored an annualised rate (cm/yr), causing relative_grow * steps_per_year to be inflated by steps_per_year-fold at sub-yearly time steps - Memory's threshold became effectively N times more lenient (e.g. 12x at monthly dt). Convert annualised rate to per-step in-place inside progressPlant. self.grow now stores cm/step, dbh += self.grow directly. CSV output column 'growth' also switches to cm/step for consistency across plant models (Bettina already outputs m^3/step). Documents the per-step contract explicitly in Memory.md so future plant modules cannot regress. BREAKING CHANGE: Jabowa CSV output column 'growth' semantics changes from cm/yr to cm/step. Downstream analyses that assumed cm/yr must multiply by dt_yr = time / (3600*24*365.25) to recover the old value. Reference CSVs regenerated for 12 Jabowa benchmarks. Bettina benchmarks unaffected.
mcwimm
reviewed
May 8, 2026
mcwimm
left a comment
Collaborator
There was a problem hiding this comment.
I'm glad you found this bug!
Could you also please upload the non-CI reference files? Once you have done so, this PR will be ready to be merged.
- Apply suggestion in Memory.md: '**Contract for plant modules**' -> '**Note**'
- Regenerate non-CI reference CSVs for 11 Jabowa benchmarks (Default,
Aboveground/AsymmetricZOI, Belowground/{FixedSalinity, FON, SymmetricZOI,
Merge_FixedSalinity_FON, Merge_FixedSalinity_sZOI},
Mortality/{Memory, NoGrowth, Random, RandomGrowth}).
This was referenced Jun 8, 2026
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.
Summary
Mortality/Memoryassumes thatplant_module.growstores a per-step growth increment (consistent with Bettina'sm³/step).Jabowainstead stored an annualised rate (cm/yr), so the formulainflated the LHS by
steps_per_year-fold for Jabowa, making the mortality threshold effectivelyN×more lenient at sub-yearly time steps (e.g. 12× too lenient at monthly dt).This PR fixes the unit mismatch at its source:
Jabowa.self.growis now stored ascm/step, matching Bettina's per-step convention. TheMortality/Memoryformula is unchanged (it was correct for Bettina all along; the contract is now documented explicitly inMemory.md).Diagnosis
dt = 1 yr)relative_grow × 1 < threshold✓ correctdt = 1/12 yr)relative_grow × 12 < threshold— threshold effectively0.5%/12 ≈ 0.04%/yr✗relative_grow × 1 < threshold✓Bettina was unaffected because every Bettina intermediate (maint, ag/bg resources) explicitly multiplies by
self.time, so itsself.growis already per-step.Changes
Code
PlantModelLib/Jabowa/Jabowa.py— convert annualised rate to per-step insideprogressPlant.self.grownow storescm/step;dbh += self.growdirectly (no time rescaling).PlantModelLib/Mortality/Memory/Memory.py— comment generalised (was Bettina-only "m³ per time step").Documentation
PlantModelLib/Jabowa/Jabowa.md— Process overview reflects per-step semantics.PlantModelLib/Mortality/Memory/Memory.md— explicit per-step contract for plant modules; removed Bettina-specific "m³/m³" / "biovolume" wording.Reference CSVs (regenerated)
12 Jabowa benchmarks:
Default,Aboveground/AsymmetricZOI,Belowground/{FON, FON_MultiSpecies, FixedSalinity, SymmetricZOI, Merge_FixedSalinity_FON, Merge_FixedSalinity_sZOI},Mortality/{Memory, NoGrowth, Random, RandomGrowth}. Bettina references untouched.This unifies the output convention across plant modules.