# This function interpolates data with CDO.
#  - Providing a data array (of up to 4 dimension), and vectors or 
#    arrays of longitudes and latitudes. An array of data and new
#    vectors/arrays of longitudes and latitudes are returned.
CDORemap(data_array = NULL, lons = NULL, lats = NULL, grid, method)  #, mask = NULL)

tas <- array(1:50, dim = c(25, 50))
names(dim(tas)) <- c('lat', 'lon')
lon <- seq(0, 360 - 360/50/2, length.out = 50)
metadata <- list(lon = list(units = 'degrees_east'))
attr(lon, 'variables') <- metadata
lat <- seq(-90, 90, length.out = 25)
metadata <- list(lat = list(units = 'degrees_north'))
attr(lat, 'variables') <- metadata
metadata <- list(tas = list(dim = list(lat = list(len = 25,
                                                  vals = lat),
                                       lon = list(len = 50,
                                                  vals = lon)
                                      )))
attr(tas, 'variables') <- metadata
tas2 <- CDORemap(tas, lon, lat, 't170grid', 'bil', TRUE)
