initialize_landscape.Rd
Initializes state for local models spwb
or growth
.
initialize_landscape(
x,
SpParams,
local_control,
model = "spwb",
replace = FALSE,
progress = TRUE
)
An object of class sf
with the following columns:
geometry
: Spatial geometry.
forest
: Objects of class forest
.
soil
: Objects of class soil
or data frames of physical properties.
land_cover_type
: Land cover type of each grid cell (values should be 'wildland' or 'agriculture').
crop_factor
: Crop evapo-transpiration factor. Only required for 'agriculture' land cover type.
local_control
: A list of control parameters (optional). Used to override function parameter local_control
for specific cells (values can be NULL
for the remaining ones).
A data frame with species parameters (see SpParamsMED
).
A list of control parameters (see defaultControl
).
A string to indicate the model, either "spwb"
or "growth"
.
Boolean flag to replace existing initialized states
Boolean flag to display progress information.
Replaces or adds column 'state' whose elements are spwbInput
or growthInput
objects
and returns the modified object of class 'sf'.
Initialization is dealt automatically when calling simulation functions spwb_spatial
, growth_spatial
,
spwb_spatial_day
or growth_spatial_day
. However, function initialize_landscape
allows separating initialization from model simulations.
# Load example landscape data
data("example_ifn")
# Load example meteo data frame from package meteoland
data("examplemeteo")
# Load default medfate parameters
data("SpParamsMED")
# Initialize state for 'spwb' simulations
example_ifn_init <- initialize_landscape(example_ifn, SpParamsMED,
defaultControl(), model = "spwb")
#> ℹ Creating 100 input objects for model 'spwb'.
#> ✔ Creating 100 input objects for model 'spwb'. [25ms]
#>