Skip to contents

Initializes state for local models spwb or growth.

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 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).

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.

Author

Miquel De Cáceres Ainsa, CREAF

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'. [4ms]
#> 
#> Stands ■■■■■■■■■■■■■■                    42% | ETA:  1s
#> Stands ■■■■■■■■■■■■■■                    43% | ETA:  1s
#> Stands ■■■■■■■■■■■■■■■■                  50% | ETA:  1s
#> Stands ■■■■■■■■■■■■■■■■■■■■■■■■■         81% | ETA:  0s
#> Stands ■■■■■■■■■■■■■■■■■■■■■■■■■■■■      91% | ETA:  0s
#> Stands ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■    98% | ETA:  0s
#> Stands ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■  100% | ETA:  0s