Repository navigation
Biomass_borealDataPrep gets its own dataYear's stand ages and land cover - #120
Merged
Merged
Conversation
…ge and land cover dataPrepBuild set sim$standAgeMap and sim$rstLCC to the last of dataYears (2020). Biomass_borealDataPrep uses them as given, so a run that starts its vegetation in 1985 got 2020 stand ages on 1985 biomass and species. The year is read in Init (mod$vegStartYear), because the cached dataPrepBuild's key covers mod$ but not other modules' parameters. New test-vegStartYear.R. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx3DXfVqAugcusGHygZGJ3
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.
Simulations whose vegetation starts before 2020 were given 2020 stand ages, laid on top of the right year's biomass and species. In the 1985 attribution hindcasts, stands that burned just before 1985 started about 38 years old, and stands that burn later started about 11. Each run now gets the age and land-cover maps of the year it starts.
Affects: runs that start the vegetation before the last data year (the attribution hindcasts) get different, correct starting ages. Fits, hindcast validation and NRV runs are unchanged.
Technical details
dataPrepBuildsetsim$rstLCC(fireSense_dataPrepFit.R:748) andsim$standAgeMap(:777) totail(<per-year list>, 1), i.e. 2020. It runs before Biomass_borealDataPrep's init. This module declaresstandAgeMapas an output, so Biomass_borealDataPrep never builds its own map and buildscohortDatawith these ages.Evidence, ELF 4.3 run with
dataYear1985,cohortData_year1985:Fix:
Initrecordsmod$vegStartYear <- params(sim)$Biomass_borealDataPrep$dataYear. It is read inInit, not in the cacheddataPrepBuild, because that event's key coversmod$but not other modules' parameters.dataPrepBuildthen takes the elementvegStartYearName()picks: the latest data year at or before that year (fireSenseUtils::dataYearElement()), or the last element when Biomass_borealDataPrep is absent, as before.Not changed:
propFlammable,rstLCC_RTM,flammableRTMandnonForest_timeSinceDisturbancestill take the last element. They are prediction inputs, and fireSense_dataPrepPredict sets its own per-year values for hindcasts.Tests: new
test-vegStartYear.R, 12 passing (the year rule, plus checks thatdataPrepBuildandInituse it).test-dataPrepBuild.Rpasses.test-metadata.Rhas the same 2 failures and 1 error asdevelopment.🤖 Generated with Claude Code
https://claude.ai/code/session_01Lx3DXfVqAugcusGHygZGJ3