Skip to contents

Automates importing CRU CL v.2.0 climatology data and creates a terra terra::rast object of the data. If requested, minimum and maximum temperature may also be automatically calculated as described in the data readme.txt file. Data may be cached for later use by this function, saving time downloading files in future using this function. This function can be useful if you have network connection issues that mean automated downloading of the files using R does not work properly.

Usage

create_CRU_stack(
  pre = FALSE,
  pre_cv = FALSE,
  rd0 = FALSE,
  tmp = FALSE,
  dtr = FALSE,
  reh = FALSE,
  tmn = FALSE,
  tmx = FALSE,
  sunp = FALSE,
  frs = FALSE,
  wnd = FALSE,
  elv = FALSE,
  dsn
)

create_cru_stack(
  pre = FALSE,
  pre_cv = FALSE,
  rd0 = FALSE,
  tmp = FALSE,
  dtr = FALSE,
  reh = FALSE,
  tmn = FALSE,
  tmx = FALSE,
  sunp = FALSE,
  frs = FALSE,
  wnd = FALSE,
  elv = FALSE,
  dsn
)

Arguments

pre

Loads precipitation (millimetres/month) from server and returns in the data frame, TRUE. Defaults to FALSE.

pre_cv

Loads cv of precipitation (percent) from server and returns in the data frame, TRUE. Defaults to FALSE. NOTE. Setting this to TRUE will always results in pre being set to TRUE and returned as well.

rd0

Loads wet-days (number days with >0.1 millimetres rain per month) and returns in the data frame, TRUE. Defaults to FALSE.

tmp

Loads temperature (degrees Celsius) and returns it in the data frame, TRUE. Defaults to FALSE.

dtr

Loads mean diurnal temperature range (degrees Celsius) and returns it in the data frame, TRUE. Defaults to FALSE.

reh

Loads relative humidity and returns it in the data frame, TRUE. Defaults to FALSE.

tmn

Calculate minimum temperature values (degrees Celsius) and returns it in the data frame, TRUE. Defaults to FALSE.

tmx

Calculate maximum temperature (degrees Celsius) and return it in the data frame, TRUE. Defaults to FALSE.

sunp

Loads sunshine, percent of maximum possible (percent of day length) and returns it in the data frame, TRUE. Defaults to FALSE.

frs

Loads ground-frost records (number of days with ground- frost per month) and returns it in the data frame, TRUE. Defaults to FALSE.

wnd

Load 10 m wind speed (metres/second) and returns it in the data frame, TRUE. Defaults to FALSE.

elv

Loads elevation (converted to metres) and returns it in the data frame, TRUE. Defaults to FALSE.

dsn

Local file path where CRU CL v.2.0 .dat.gz files are located.

Value

A base::list of terra::rast objects of CRU CL v. 2.0 climatology elements.

Nomenclature and Units

pre

precipitation (millimetres/month)

rd0

wet-days (number days with >0.1 millimetres rain per month)

tmp

mean temperature (degrees Celsius)

dtr

mean diurnal temperature range (degrees Celsius)

reh

relative humidity (percent)

sunp

sunshine (percent of maximum possible (percent of day length))

frs

ground-frost (number of days with ground-frost per month)

wnd

10 metre windspeed (metres/second)

elv

elevation (automatically converted to metres)

For more information see the description of the data provided by CRU, https://crudata.uea.ac.uk/cru/data/hrg/tmc/readme.txt

References

New, Mark, et al. "A high-resolution data set of surface climate over global land areas." Climate research 21.1 (2002): 1-25. https://crudata.uea.ac.uk/cru/data/hrg/tmc/new_et_al_10minute_climate_CR.pdf

See also

Author

Adam H. Sparks, adamhsparks@gmail.com

Examples

if (FALSE) { # interactive()

download.file(
  url = "https://crudata.uea.ac.uk/cru/data/hrg/tmc/grid_10min_tmp.dat.gz",
  destfile = file.path(tempdir(), "grid_10min_tmp.dat.gz")
)

CRU_tmp <- create_CRU_stack(tmp = TRUE, dsn = tempdir())

CRU_tmp
}