The different nature of the different climate products, models and variables, and the idiosyncratic naming and storage conventions often applied by the various modelling centres, makes necessary a previous homogeneization across datasets in order to implement a truly user-friendly toolbox for data access. The ecomsUDG.Raccess package achieves this aim by defining a common vocabulary to all climate datasets. The particular variables of each dataset are translated -and transformed if necessary- into the common vocabulary by means of a dictionary. Both features are next described:
In order to set a common framework with a precise definition of the variables, the ecomsUDG.Raccess package is based on the use of a vocabulary. In essence, the vocabulary is a table containing the standard names of a number of variables commonly used in impact studies and downscaling applications, subject to permanent revision or addition of new standard variables. The naming conventions and the units are based on the standard name ?table provided in the frame of the SPECS project, although in case of conflict, and in order to maximize the inter-operability of the vocabulary, the nomenclature is also compliant with the ?NetCDF Climate and Forecast Metadata Convention.
The vocabulary has been included as a is a built-in dataset of the ecomsUDG.Raccess package in order to provide the user a reference of the standard variables.
> library(ecomsUDG.Raccess) Loading required package: rJava Loading required package: sp > data(vocabulary) > print(vocabulary) identifier standard_name units 1 tas 2-meter temperature degrees Celsius 2 tasmax maximum 2-m temperature degrees Celsius 3 tasmin minimum 2-m temperature degrees Celsius 4 tp Total precipitation amount mm 5 psl air pressure at sea level Pa
The dictionary is a table whose aim is twofold:
In essence, the dictionary is a comma-sepparated text file (csv), that by default is identified with the same name than the argument dataset of the loadSeasonalForecast function. The dictionaries for the currently available datasets are included in the ecomsUDG.Raccess package, within the dictionaries folder. The dictionaries are read internally by loadSeasonalForecast to undertake the conversions needed for returning the standard variables, so by default, the user does not need to worry about it. In case an interested user wants to inspect a particular dictionary, he/she can proceed as follows:
> ip <- installed.packages() > # Path to the installed library > libPath <- ip[grep("ecomsUDG.Raccess", ip[ ,1]), 2] > # Path to the dictionaries folder > dicPath <- paste(libPath, "/ecomsUDG.Raccess/dictionaries", sep = "") > list.files(dicPath)  "CFSv2_seasonal_16.csv" "System4_annual_15.csv" "System4_seasonal_15.csv"  "System4_seasonal_51.csv" > dic <- read.csv(list.files(dicPath, full = TRUE)[grep("CFSv2", list.files(dicPath))]) > str(dic.cfs) 'data.frame': 5 obs. of 9 variables: $ identifier : Factor w/ 5 levels "psl","tas","tasmax",..: 3 4 2 5 1 $ short_name : Factor w/ 5 levels "Maximum_temperature_height_above_ground" ... $ time_step : Factor w/ 1 level "6h": 1 1 1 1 1 $ lower_time_bound: int 0 0 0 0 0 $ upper_time_bound: int 6 6 6 6 0 $ aggr_fun : Factor w/ 5 levels "max","mean","min",..: 1 3 2 5 4 $ offset : num -273 -273 -273 0 0 $ scale : int 1 1 1 21600 1 $ deaccum : int 0 0 0 0 0
The latest version of the dictionaries can be checked-out in the development version of the package at the ?GitHub repository.
The columns of the dictionary are next described:
Example: Suppose we have daily temperature data, each record associated to a date (e.g. 19780420 for 20th April 1978). The lower time bound in this case is 0, and the upper time bound 24, indicating that the verification period of the value starts 20 April 1978 at 00:00 and ends 20 April 1978 23:59:59 (i.e., the range [19780420, 19780421). Because it is mean temperature, the aggregation function for this time interval would be "mean". If the same record has a time associated at 12:00 rather than 00:00 (i.e. 20 April 1978 at 12:00), then the lower and the upper time bounds would be 12.