obs_path <- "/esarchive/recon/ecmwf/era5/monthly_mean/$var$_f1h/$var$_$sdate$.nc"
var_name <- 'sfcWind'
lons.min <- 0
lons.max <- 10
lats.min <- 0
lats.max <- 10
dates_file <- c('199312', '199412', '199512')

obs <- Start(dat = obs_path,
             var = var_name,
             sdate = dates_file,
             latitude = values(list(lats.min, lats.max)),
             latitude_reorder=Sort(),
             longitude = values(list(lons.min, lons.max)),
             synonims = list(latitude = c('lat','latitude'),
                             longitude = c('lon','longitude')),
             transform = CDORemapper,
             transform_params = list(
               grid = paste0('/esarchive/obs/ukmo/hadcrut_v4.6/',
                             'monthly_mean/tasanomaly/tasanomaly_201712.nc'),
               #grid = paste0(
               #  '/esarchive/exp/ecmwf/system5c3s/', fcst.freq,
               #  '/', variable, '_', freq.exp,
               #  '/', variable, '_', '201805', '01.nc'),
               method = 'con',
               crop = c(lons.min, lons.max, lats.min, lats.max)
             ),
             transform_vars = c('latitude', 'longitude'),
             return_vars = list(latitude = 'dat',
                                longitude = 'dat',
                                time = 'sdate'),
             split_multiselected_dims = TRUE,
             retrieve = TRUE)


# no interpolation
qwe <- Start(dat = obs_path,
             var = var_name,
             sdate = dates_file,
             latitude = values(list(lats.min, lats.max)),
             latitude_reorder=Sort(),
             longitude = values(list(lons.min, lons.max)),
             synonims = list(latitude = c('lat','latitude'),
                             longitude = c('lon','longitude')),
#             transform = CDORemapper,
#             transform_params = list(
#               grid = paste0('/esarchive/obs/ukmo/hadcrut_v4.6/',
#                             'monthly_mean/tasanomaly/tasanomaly_201712.nc'),
#               #grid = paste0(
#               #  '/esarchive/exp/ecmwf/system5c3s/', fcst.freq,
#               #  '/', variable, '_', freq.exp,
               #  '/', variable, '_', '201805', '01.nc'),
##               method = 'con',
#               crop = c(lons.min, lons.max, lats.min, lats.max)
#             ),
#             transform_vars = c('latitude', 'longitude'),
             return_vars = list(latitude = 'dat',
                                longitude = 'dat',
                                time = 'sdate'),
             split_multiselected_dims = TRUE,
             retrieve = TRUE)


