-
Notifications
You must be signed in to change notification settings - Fork 6
Calculation of climate impact indices
The following example has been developed in the framework of the INDECIS project, and partially reproduces the analyses undertaken for Deliverable 6.2.
The list of available climate impact indices is obtained with indexShow()
and indexGrid
is used to compute the target climate index.
indexShow()
In the following example, we retrieve observational data from the recently developed Iberia01 dataset (Herrera et al. 2016; 2019) and modeled data from one exemplary EURO-CORDEX (Jacob et al. 2014) Regional Climate Model (RCM) in order to calculate the number of summer days and compare both datasets. All data are remotely retrieved from the University of Cantabria User Data Gateway, after login through the THREDDS Access Portal UDG-TAP. Note that other libraries from the climate4R Framework for climate data access and analysis are used for reading, postprocessing and visualization purposes (loadeR
, transformeR
, convertR
, visualizeR
; see Iturbide et al. 2019 and references therein for further details.).
library(loadeR)
library(transformeR)
library(visualizeR)
library(convertR)
library(climate4R.indices)
# UDG-TAP log in
loginUDG(username = "*****", password = "*****")
First, read observational data (Iberia01) and plot the mean of daily maximum temperature :
# URL of the target dataset
iberiaNcml <- "http://meteo.unican.es/tds5/dodsC/Iberia01/Iberia01_v1.0_010reg_aa_3d.ncml"
# Loading function:
ib.data <- loadGridData(dataset = iberiaNcml, var = "tasmax", years = 1989:2008)
# Plot climatology:
spatialPlot(climatology(ib.data), backdrop.theme = "coastline", rev.colors = TRUE)
Second, RCM data for RACMO22E (ERA-Interim-driven run) are loaded:
rcmNcml <- "http://www.meteo.unican.es/tds5/dodsC/cordex/EUR-11/KNMI/ECMWF-ERAINT_evaluation_r1i1p1_RACMO22E_v1_day.ncml"
rcm.data <- loadGridData(dataset = rcmNcml, var = "tasmax", lonLim = c(-9.5, 4.3), latLim = c(36.0, 43.8), years = seq(1989,2008))
spatialPlot(climatology(rcm.data), rev.colors = TRUE)
For consistency with the observations, unit transformation and interpolation into the observed grid are performed:
rcm.data <- udConvertGrid(rcm.data, new.units = "celsius")
rcm.interp <- interpGrid(rcm.data, new.coordinates = getGrid(ib.data))
The calculation of threshold-based indices requires some sort of bias correction of model systematic biases. In this case, we just correct for the monthly mean biases towards the observations:
rcm.bc <- scaleGrid(rcm.interp, ref = ib.data, time.frame = "monthly", type = "center")
Calculate the number of summer days (SU) (number of days with tasmax > 25ºC). By default, the annual value of the index is calculated (see argument time.resolution
):
ib.su <- indexGrid(index.code = "TXth", tx = ib.data, th = 25)
rcm.su <- indexGrid(index.code= "TXth", tx = rcm.bc, th = 25)
Consider only land gridboxes (mask sea gridboxes derived from observations):
mask <- suppressMessages(climatology(ib.data))
mask$Data[!is.na(mask$Data)] <- 1
time <- getRefDates(ib.su)
nt <- length(time)
ls1 <-lapply(1:nt, function(i) {
timei <-subsetDimension(ib.su, dimension = "time", indices = i)
gridArithmetics(timei, mask, operator = "*")
})
ib.su.land <- bindGrid(ls1, dimension = "time")
ls2 <-lapply(1:nt, function(i){
timei <-subsetDimension(rcm.su, dimension = "time", indices = i)
gridArithmetics(timei, mask, operator = "*")
})
rcm.su.land <- bindGrid(ls2, dimension = "time")
Plot multi-year mean values of summer days:
spatialPlot(climatology(makeMultiGrid(ib.su.land,rcm.su.land, spatial.tolerance = 0.1)),
backdrop.theme = "coastline", color.theme= "YlOrRd", at= seq(0, 150, 5),
set.min = 0, set.max = 150, names.attr = c("OBS", "RCM"), as.table = TRUE)
Calculate and plot mean biases:
bias <- gridArithmetics(climatology(rcm.su.land), climatology(ib.su.land), operator = "-")
spatialPlot(bias, backdrop.theme = "coastline", set.min = -15, set.max = 15, at = seq(-15, 15), rev.colors = TRUE)
Herrera, S., Fernández, J., Gutiérrez, J.M., 2016. Update of the Spain02 gridded observational dataset for EURO-CORDEX evaluation: assessing the effect of the interpolation methodology. International Journal of Climatology 36, 900–908. https://doi.org/10.1002/joc.4391
Herrera, S., Cardoso, R.M., Soares, P.M.M., Espírito-Santo, F., Viterbo, P., Gutiérrez, J.M., 2019. Iberia01: A new gridded dataset of daily precipitation and temperatures over Iberia. Earth Syst. Sci. Data Discuss. 1–16. https://doi.org/10.5194/essd-2019-95
Iturbide, M., Bedia, J., Herrera, S., Baño-Medina, J., Fernández, J., Frías, M.D., Manzanas, R., San-Martín, D., Cimadevilla, E., Cofiño, A.S., Gutiérrez, J.M., 2019. The R-based climate4R open framework for reproducible climate data access and post-processing. Environmental Modelling & Software 111, 42–54. https://doi.org/10.1016/j.envsoft.2018.09.009
Jacob, D., Petersen, J., Eggert, B., Alias, A., Christensen, O.B., Bouwer, L.M., Braun, A., Colette, A., Déqué, M., Georgievski, G., Georgopoulou, E., Gobiet, A., Menut, L., Nikulin, G., Haensler, A., Hempelmann, N., Jones, C., Keuler, K., Kovats, S., Kröner, N., Kotlarski, S., Kriegsmann, A., Martin, E., Meijgaard, E. van, Moseley, C., Pfeifer, S., Preuschmann, S., Radermacher, C., Radtke, K., Rechid, D., Rounsevell, M., Samuelsson, P., Somot, S., Soussana, J.-F., Teichmann, C., Valentini, R., Vautard, R., Weber, B., Yiou, P., 2014. EURO-CORDEX: new high-resolution climate change projections for European impact research. Reg Environ Change 14, 563–578. https://doi.org/10.1007/s10113-013-0499-2
> sessionInfo()
R version 3.6.0 (2019-04-26)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.2 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=es_ES.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=es_ES.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=es_ES.UTF-8 LC_NAME=es_ES.UTF-8 LC_ADDRESS=es_ES.UTF-8
[10] LC_TELEPHONE=es_ES.UTF-8 LC_MEASUREMENT=es_ES.UTF-8 LC_IDENTIFICATION=es_ES.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] climate4R.indices_0.0.2 convertR_0.1.2 udunits2_0.13
[4] visualizeR_1.4.0 transformeR_1.5.2 loadeR_1.4.12
[7] loadeR.java_1.1.1 rJava_0.9-11
loaded via a namespace (and not attached):
[1] Rcpp_1.0.2 compiler_3.6.0 RColorBrewer_1.1-2
[4] bitops_1.0-6 tools_3.6.0 boot_1.3-22
[7] dotCall64_1.0-0 vioplot_0.3.2 lattice_0.20-38
[10] Matrix_1.2-17 parallel_3.6.0 spam_2.2-2
[13] akima_0.6-2 padr_0.5.0 raster_2.9-5
[16] mapplots_1.5.1 fields_9.8-3 maps_3.3.0
[19] grid_3.6.0 data.table_1.12.2 dtw_1.20-1
[22] pbapply_1.4-1 tcltk_3.6.0 sm_2.2-5.6
[25] SpecsVerification_0.5-2 sp_1.3-1 latticeExtra_0.6-28
[28] magrittr_1.5 scales_1.0.0 codetools_0.2-16
[31] CircStats_0.2-6 MASS_7.3-51.1 abind_1.4-5
[34] colorspace_1.4-1 proxy_0.4-23 munsell_0.5.0
[37] RCurl_1.95-4.12 easyVerification_0.4.4 kohonen_3.0.8
[40] verification_1.42 RcppEigen_0.3.3.5.0 zoo_1.8-6
climate4R.indices - Santander MetGroup (Univ. Cantabria - CSIC)