
Build grazable grass availability from an LPJmL run.
Source:R/feed_lpjml.R
build_grass_availability_lpjml.RdReads managed-grassland net primary production/availability (the LPJmL
grassland CFT) from the pinned WHEP artifact by default. Pass
availability or availability_path to use a custom already-derived
artifact; pass run_dir to read a finished local LPJmL run instead and
convert NPP to grazable above-ground dry-matter availability, the forage
supply ceiling for feed allocation. Availability is the production flux, not
the realised grazing off-take (the off-take is the intake-validation target,
not the supply).
Usage
build_grass_availability_lpjml(
run_dir = NULL,
years = NULL,
first_year = 1901L,
shares = grass_access_shares(),
example = FALSE,
availability = NULL,
availability_path = NULL
)Arguments
- run_dir
Path to the LPJmL run output directory holding
pft_npp.ncandcftfrac.nc(thescenario_*output folder). If unset, the pinnedlpjml-grass-availabilityartifact is used.- years
Integer vector of calendar years to read.
- first_year
First calendar year of the run's output time axis.
Accessibility and conversion parameters from
grass_access_shares().- example
If
TRUE, return a small fixture instead of reading a run.- availability
Optional already-derived grass availability tibble/data frame. Takes precedence over pinned data and
run_dir.- availability_path
Optional path to an already-derived grass availability artifact (
.parquet,.csv, or.rds). Takes precedence over pinned data andrun_dir.