
Past climate from present climate and a climate-model anomaly
Source:R/temporal.R
anomaly_climate.RdThe "delta" or anomaly method: the change simulated by a (coarse) climate
model between a past period and its own present is added to a
high-resolution present-day climatology (e.g. CHELSA or WorldClim). This
removes much of the climate model's bias. Temperature-like variables use
the difference (current + past - present); precipitation amounts use the
ratio (current * (past + 1) / (present + 1), the +1 avoids division by
zero in dry cells), limited to ratio_limits to avoid extreme values.
Usage
anomaly_climate(
current,
past,
present,
ratio_vars = NULL,
ratio_limits = c(0.1, 10)
)Arguments
- current
Present-day high-resolution values.
- past
Climate model values for the past period.
- present
Climate model values for the present (the reference period of the same model).
- ratio_vars
Names of variables that use the ratio (e.g. the precipitation variables). Tip:
grep("^bio1[2-9]$", names(x), value = TRUE)selects bioclim precipitation variables 12-19.- ratio_limits
Lower and upper limits of the ratio.
Details
Works on matrices or data.frames of values at points (fast; no maps needed) and on terra::SpatRasters with layers of the same names.
References
Maraun, D., Widmann, M. (2018) Statistical Downscaling and Bias Correction for Climate Research. Cambridge University Press, Cambridge. doi:10.1017/9781107588783
Examples
cur <- data.frame(bio1 = c(5, 10), bio12 = c(600, 900))
past <- data.frame(bio1 = c(-3, 2), bio12 = c(300, 500))
pres <- data.frame(bio1 = c(4, 9), bio12 = c(650, 850))
anomaly_climate(cur, past, pres, ratio_vars = "bio12")
#> bio1 bio12
#> 1 -2 277.4194
#> 2 3 529.8472