#Function call for s2dverification vignette:
var0 <- 'tas'
model_names <- c('CNRM-CM5 r1i1p1', 'IPSL-CM5A-LR r2i1p1', 'MIROC5r2i1p1', 'MPI-ESM-LR r1i1p1')
climatology_filenames <- paste0("/home/Earth/ahunter/Magic/Magic_input/",
                                c("tas_Amon_CNRM-CM5_historical_r1i1p1_195001-200512_remap.nc", 
                                  "tas_Amon_IPSL-CM5A-LR_historical_r2i1p1_185001-200512_remap.nc",
                                  "tas_Amon_MIROC5_historical_r1i1p1_185001-201212_remap.nc",
                                  "tas_Amon_MPI-ESM-LR_historical_r1i1p1_185001-200512_remap.nc"))
start_climatology <- '1961-01-01'
end_climatology <- '1990-12-31'
reference_data <- Start(model=climatology_filenames, 
                        var = var0, var_var = 'var_names',
                        time = values(list(as.POSIXct(start_climatology), 
                                           as.POSIXct(end_climatology))),
                        lat = 'all', lon = 'all', lon_var = 'lon',
                        return_vars = list(time = 'model', lon = 'model', lat = 'model'),
                        retrieve = TRUE)
#Function call for visca operational
obs <- Start(dat = obs.path,
             var = variable,
             sdate = obs.sdates,
             time = 'all',
             latitude = values(list(lats.min, lats.max)),
             longitude = values(list(lons.min, lons.max)),
             transform = CDORemapper(NULL, NULL, NULL),
             transform_params = params, 
             transform_vars = c('latitude', 'longitude'), 
             return_vars = list(latitude = 'dat',
                                longitude = 'dat'),
             retrieve = TRUE)