Skip to contents

This function loads or generates daily climate data for a specified spatial unit and date range. If cached data exists and 'force' is FALSE, it loads the data from disk. Otherwise, it queries the RADIS database, aggregates climate variables, and saves the result if 'write_results' is TRUE.

Usage

create_inputs.climate(
  su_label = "climate",
  sf = load_spatial_units(su_label = su_label),
  source = c("safran", "drias"),
  years,
  ...,
  force = FALSE
)

create_inputs.climate.safran(
  su_label,
  sf,
  years,
  force,
  ...,
  cfg = loadConfig()
)

create_inputs.climate.drias(
  su_label,
  sf,
  GCM,
  RCM,
  BC,
  RCP,
  ETP = "Hg0175",
  years,
  force,
  ...,
  cfg = loadConfig()
)

Arguments

su_label

character Label for the spatial unit (default: "climate_depth").

sf

sf::sf Spatial unit sf object.

source

character Climate data source(s) to use. Options are "safran" and/or "drias" (default: both).

years

integer Vector of years for the simulation period.

...

Additional arguments passed to climate input creation.

force

logical Whether to force the creation of the uptakes data from the raw data.

cfg

a config object. Configuration to use. See loadConfig for details

GCM

character Global Climate Model (default: "safran").

RCM

character Regional Climate Model (default: "").

BC

character Bias Correction method (default: "").

RCP

character Representative Concentration Pathway (default: "").

ETP

character Evapotranspiration method (default: "Hg0175").

Value

data.frame of main inputs.