
library(s2dverification)
packageVersion("s2dverification")

mypath <- "/esarchive/recon/ecmwf/erainterim/monthly_mean/tas_f6h"

path <- "/home/Earth/nperez/git/Flor/s2dverification_tests/data/$YEAR$/tas_$YEAR$$MONTH$.nc"

d = Load(var = 'tas', 
         obs = list(list(name = 'erain', path = path)),
         sdates = c('19910101', '19920101'))
dim(d$obs)
# Only loads 1991 data
path <- "/home/Earth/nperez/git/Flor/s2dverification_tests/data/$YEAR$/$VAR_NAME$_$YEAR$$MONTH$.nc"

d2 = Load(var = 'tas', 
         obs = list(list(name = 'erain', path = path)),
         sdate = c('19910101', '19920101'),
         leadtimemax = 1, path_glob_permissive = TRUE)


# Only loads 1991 data
path <- "/home/Earth/nperez/git/Flor/s2dverification_tests/data/$SUFFIX$/$VAR_NAME$_$YEAR$$MONTH$.nc"

d2 = Load(var = 'tas', 
         obs = list(list(name = 'erain', path = path, 
                         suffix = c('1991', '1992'))),
         sdate = c('19910101', '19920101'),
         leadtimemax = 1)


d2$obs

# Debugging Load:
path <- "/home/Earth/nperez/git/Flor/s2dverification_tests/data/$YEAR$/$VAR_NAME$_$YEAR$$MONTH$.nc
var = 'tas'
exp = NULL
obs = list(list(name = 'erain', path = path))
sdate = c('19910101', '19920101')
leadtimemax = 1

nmember = NULL
nmemberobs = NULL
nleadtime = NULL
leadtimemin = 1
storefreq = 'monthly'
sampleperiod = 1
lonmin = 0
lonmax = 360
latmin = -90
latmax = 90
output = 'areave'
method = 'conservative'
grid = NULL
maskmod = vector("list", 15)
maskobs = vector("list", 15)
configfile = NULL
varmin = NULL
varmax = NULL
silent = FALSE
nprocs = NULL
dimnames = NULL
remapcells = 2
path_glob_permissive = 'partial'











