Initialization of model inputs for spatially-distributed forest stands
Source:R/initialize_landscape.R
initialize_landscape.Rd
Usage
initialize_landscape(
x,
SpParams,
local_control,
model = "spwb",
simplify = FALSE,
replace = FALSE,
progress = TRUE
)
Arguments
- x
An object of class
sf
with the following columns:geometry
: Spatial geometry.forest
: Objects of classforest
.soil
: Objects of classsoil
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 parameterlocal_control
for specific cells (values can beNULL
for the remaining ones).
- SpParams
A data frame with species parameters (see
SpParamsMED
).- local_control
A list of control parameters (see
defaultControl
).- model
A string to indicate the model, either
"spwb"
or"growth"
.- simplify
Boolean flag to simplify forest to the tree and shrub cohorts with largest leaf area index. The leaf area index of the whole tree (respectively, shrub) layer will be attributed to the selected cohort. See function
forest_reduceToDominant
.- replace
Boolean flag to replace existing initialized states
- progress
Boolean flag to display progress information.
Value
Replaces or adds column 'state' whose elements are spwbInput
or growthInput
objects
and returns the modified object of class 'sf'.
Details
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.
Option simplify
has been implemented to allow simplification of forests to tree/shrub dominant cohorts during watershed simulations
where focus is on runoff (e.g. calibration of watershed parameters or burnin periods). Elements identified as result_cell
will not be simplified.
Examples
# Load example landscape data
data("example_ifn")
# Load example meteo data frame from package meteoland
data("examplemeteo")
# Load default medfate parameters
data("SpParamsMED")
# Define local control parameters using function in medfate
local_control <- defaultControl()
# If necessary, change defaults
# Initialize state for 'spwb' simulations
example_ifn_init <- initialize_landscape(example_ifn, SpParamsMED,
local_control = local_control,
model = "spwb")
#> ℹ Creating 100 state objects for model 'spwb'.
#> ✔ Creating 100 state objects for model 'spwb'. [5ms]
#>