
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",
merge_trees = FALSE,
merge_shrubs = FALSE,
reduce_to_dominant = 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"
.- merge_trees
A logical flag to simplify tree cohorts by merging tree records in DBH classes (see
forest_mergeTrees
).- merge_shrubs
A logical flag to simplify shrub cohorts by merging shrub records in height classes (see
forest_mergeShrubs
).- reduce_to_dominant
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 normally 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.
Options merge_shrubs
, merge_trees
and reduce_to_dominant
have been implemented to allow simplification of forests 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'. [7ms]
#>
#> Stands ■■■■■■■■■■■■ 36% | ETA: 2s
#> Stands ■■■■■■■■■■■■ 37% | ETA: 2s
#> Stands ■■■■■■■■■■■■■■ 44% | ETA: 2s
#> Stands ■■■■■■■■■■■■■■■■ 50% | ETA: 1s
#> Stands ■■■■■■■■■■■■■■■■■■■■■ 66% | ETA: 1s
#> Stands ■■■■■■■■■■■■■■■■■■■■■ 67% | ETA: 1s
#> Stands ■■■■■■■■■■■■■■■■■■■■■■■■ 77% | ETA: 1s
#> Stands ■■■■■■■■■■■■■■■■■■■■■■■■■■ 82% | ETA: 1s
#> Stands ■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 91% | ETA: 0s
#> Stands ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 96% | ETA: 0s
#> Stands ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 100% | ETA: 0s
#> • Transpiration mode [Granier: 100, Sperry: 0, Sureau: 0]
#> • Soil doimains [buckets: 100, single: 0, dual: 0]