Initializes state for local models spwb or growth.

initialize_landscape(
  x,
  SpParams,
  local_control,
  model = "spwb",
  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.

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

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.

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")
  
# Initialize state for 'spwb' simulations
example_ifn <- initialize_landscape(example_ifn, SpParamsMED, 
                                    defaultControl(), model = "spwb")
#>  Creating 100 input objects for model 'spwb'.
#>  Creating 100 input objects for model 'spwb'. [17ms]
#>