Skip to content

Spin-up starts cohorts at initialB; widen young-cohort biomass check - #138

Merged
eliotmcintire merged 2 commits into
developmentfrom
fix-young-biomass-spinup
Oct 9, 2026
Merged

eliotmcintire merged 2 commits into
developmentfrom
fix-young-biomass-spinup

Conversation

@eliotmcintire

@eliotmcintire eliotmcintire commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Young forests in recently burned areas get their starting biomass from a short growth simulation. That simulation started every tree species at zero biomass, so spruce barely grew while pioneer species took all the growth, and a sanity check on the result was too strict for fast-growing pioneers, stopping runs. This starts each species at the biomass a new cohort normally gets and loosens the check slightly.

Affects: starting biomass of young cohorts inside fire perimeters in every run (spruce higher, pioneers lower); runs that stopped on the check now continue.

Technical details

R/updateYoungBiomasses.R (spinUpPartial, was line ~164) set B = 0 for every cohort, so growthcurve-1 species gained only the 1 g/m2/yr floor. Biomass_core gives a new cohort initialB (default 10; LandR .initiateNewCohorts, cohorts.R:~330-335; the maxANPP branch only applies when initialB is NA). The module now has an initialB parameter (same definition as Biomass_core, with paramCheckOtherMods(..., "warning")), passed to spinUpPartial, which uses it for the starting B (new spinUpStartCohorts()) and passes it to Biomass_core. If initialB is NA, cohorts start at maxANPP from speciesEcoregion, as .initiateNewCohorts does with sumB = 0.

Biomass_borealDataPrep.R:1467: the check now uses youngBiomassLimit() = min(maxRawB, 1.2 * 2.8 * maxRawB / min(longevity / maxAgeHighQualityData)), still one scalar. 2026-10-09: ELF 3.2.3 had a 59-yr Lari_lar cohort 17% over the old limit, ELF 10.3.1 Pinu_con cohorts up to 2.9% over.

New tests/testthat/test-updateYoungBiomasses.R: the new tests error on development (functions absent). Full suite via convertToPackage + test_local: 135 pass, 0 fail on the branch (the metadata test lists the new parameter); on development 125 pass plus the new tests failing. The full spin-up with Biomass_core is not run in tests.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CwcjqqK59FmTJscyi7xUqv

…iomass limit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CwcjqqK59FmTJscyi7xUqv
@eliotmcintire eliotmcintire added the bug Something isn't working label Oct 9, 2026
@eliotmcintire

Copy link
Copy Markdown
Collaborator Author

This will change the estimated biomass upwards in the pixels that are "in fires", i.e., in updateYoungBiomasses. This change makes this part of the spinUp match what Biomass_core does with initialBiomass

@eliotmcintire
eliotmcintire merged commit 135a9bb into development Oct 9, 2026
4 checks passed
@eliotmcintire
eliotmcintire deleted the fix-young-biomass-spinup branch October 9, 2026 16:54
eliotmcintire added a commit that referenced this pull request Oct 9, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CwcjqqK59FmTJscyi7xUqv
eliotmcintire added a commit that referenced this pull request Oct 9, 2026
achubaty added a commit to FOR-CAST/Biomass_borealDataPrep that referenced this pull request Oct 19, 2026
Upstream 1.8.0 + PredictiveEcology#136, PredictiveEcology#138-PredictiveEcology#141 (LandR >= 1.2.0.9057); keeps SpaDES.project out of reqdPkgs and the fork NOTEs and test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working minor change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant