Skip to contents

Materialises a self-contained LANDIS-II scenario whose only purpose is to run ForCS for a single year with both spinup flags ON, emit a snapshot of the spun-up cohort community via the Output Biomass Community extension, and exit.

Usage

build_calibration_spinup_scenario(
  out_dir,
  template_dir,
  duration = 1L,
  community_output_year = 0L,
  cell_length
)

Arguments

out_dir

Character. Destination directory (created or overwritten).

template_dir

Character. Existing production scenario directory to copy from. Must contain forc-succession.txt, species.txt, ecoregions.txt, ecoregions.tif, climate.txt, ForCS_DM.txt, initial-communities.csv, initial-communities.tif, and the ForCS data CSVs.

duration

Integer. Simulation duration in years. LANDIS-II minimum 1.

community_output_year

Integer. Year at which the snapshot is consumed downstream (caller chooses 0 for post-spinup state; default 0).

cell_length

Integer. Raster cell size in metres.

Value

Character scalar: absolute path to the written scenario.txt.

Details

The Output Biomass Community extension emits at multiples of its Timestep starting from year 0 (post-init, pre-step), so with Timestep = 1 and Duration = 1 we get two snapshot CSVs: community-input-file-0.csv (post-spinup state – this is the one we want) and community-input-file-1.csv (after one year of ANPP). The TIF (output-community-0.tif) is emitted only once at year 0 – cohort communities don't repartition in a no-disturbance run, so one raster suffices for both years.

Note on CSV schema: LANDIS-II Output Biomass Community v3 writes a 5-column file (MapCode, SpeciesName, CohortAge, CohortBiomass, CohortANPP). LANDIS-II's initial-communities parser tolerates the extra CohortANPP column, so the file is drop-in usable as InitialCommunitiesFiles without post-processing.

Implementation: copy every top-level file from template_dir (a production scenario directory), strip the disturbance stack from the copied scenario.txt, add an Output Biomass Community extension, and rewrite scenario.txt with Duration = duration. Rep subdirectories are NOT copied.