
Download CHELSA V2.1 monthly climatologies, optionally for a region only
Source:R/climate_indices.R
download_chelsa_monthly.RdDownloads the 12 monthly files of each variable needed by
climate_indices(). With extent, only that region is downloaded:
GDAL reads the needed part of each global file over the internet and
writes it locally, keeping the stored values, scale and offset exactly
(no global 100+ MB files on disk). Files already present are skipped, so
an interrupted download can simply be run again.
Usage
download_chelsa_monthly(
path,
vars = c("tasmax", "tasmin", "tas", "pr"),
period = "1981-2010",
gcm = NULL,
ssp = NULL,
extent = NULL,
overwrite = FALSE
)Arguments
- path
Folder for the files (created if needed).
- vars
Variables:
"tasmax","tasmin","tas"(mean temperature) and"pr"(precipitation); any other CHELSA monthly variable, e.g."rsds"or"vpd", works too.- period
"1981-2010"(present) or a future period,"2011-2040","2041-2070"or"2071-2100".- gcm, ssp
For future periods: the climate model, e.g.
"IPSL-CM6A-LR","MPI-ESM1-2-HR","UKESM1-0-LL","GFDL-ESM4","MRI-ESM2-0", and the scenario,"ssp126","ssp370"or"ssp585".- extent
Optional region:
c(xmin, xmax, ymin, ymax)in degrees, a terra::SpatExtent, or any object with an extent and CRS (sf, terra::SpatVector, terra::SpatRaster), which is converted to longitude/latitude.NULLdownloads the global files.- overwrite
Download again files that exist.
Details
The global files are large (about 110 MB each, 48 files per period and scenario for four variables); a region needs only its share, but at least the full width of the rows it covers is read. Data: Karger et al. (2017, 2023), CHELSA V2.1, https://chelsa-climate.org; please cite them.
References
Karger, D.N., Conrad, O., Bohner, J., et al. (2017) Climatologies at high resolution for the earth's land surface areas. Scientific Data 4, 170122. doi:10.1038/sdata.2017.122
Examples
if (FALSE) { # \dontrun{
# present climate of the Alps, four variables x 12 months
f <- download_chelsa_monthly("chelsa_alps", extent = c(5, 17, 43, 49))
# a future scenario
download_chelsa_monthly("chelsa_alps", period = "2071-2100",
gcm = "MPI-ESM1-2-HR", ssp = "ssp370",
extent = c(5, 17, 43, 49))
} # }