Ingests data for site scale simulations with rsofun (or any other Dynamic Vegetation Model).

ingest(
  siteinfo,
  source,
  getvars = c(),
  dir = NULL,
  settings = NULL,
  timescale = "d",
  parallel = FALSE,
  ncores = NULL,
  find_closest = FALSE,
  verbose = FALSE
)

Arguments

siteinfo

A data frame containing site meta info. Required columns are: "sitename", "date_start", "date_end", "lon", "lat", "elv".

source

A character used as identifiyer for the type of data source (e.g., "fluxnet"). See vignette for a full description of available options.

getvars

A named list of characters specifying the variable names in the source dataset corresponding to standard names "temp" for temperature, "prec" for precipitation, "patm" for atmospheric pressure, "vpd" for vapour pressure deficit, "netrad" for net radiation, "swin" for shortwave incoming radiation, "lwin" for longwave incoming radiation, "wind" for wind.

dir

A character specifying the directory where data is located.

settings

A list of additional settings used for reading original files.

timescale

A character or vector of characters, specifying the time scale of data used from the respective source (if multiple time scales are available, otherwise is disregarded).

parallel

A logical specifying whether ingest is run as parallel jobs for each site. This option is only available for source = "modis" and requires argument ncores to be set.

ncores

An integer specifying the number of cores for parallel runs of ingest per site. Required only if parallel = TRUE

find_closest

A logical specifying whether to extract data from the closest gridcell with data if no data is available for the specified location. Defaults to FALSE.

verbose

if TRUE, additional messages are printed.

Value

A named list of data frames (tibbles) containing input data for each site is returned.

Examples

if (FALSE) { # \dontrun{
  inputdata <- prepare_input_sofun(
   settings_input = settings_input,
   settings_sims = settings_sims,
   verwrite_climate = FALSE,
   verbose = TRUE )
} # }