# NOT RUN {
# See ?Load for explanations on the first part of this example
# }
# NOT RUN {
data_path <- system.file('sample_data', package = 's2dverification')
expA <- list(name = 'experiment', path = file.path(data_path,
'model/$EXP_NAME$/$STORE_FREQ$_mean/$VAR_NAME$_3hourly',
'$VAR_NAME$_$START_DATE$.nc'))
obsX <- list(name = 'observation', path = file.path(data_path,
'$OBS_NAME$/$STORE_FREQ$_mean/$VAR_NAME$',
'$VAR_NAME$_$YEAR$$MONTH$.nc'))
# Now we are ready to use Load().
startDates <- c('19851101', '19901101', '19951101', '20001101', '20051101')
sampleData <- Load('tos', list(expA), list(obsX), startDates,
output = 'lonlat', latmin = 27, latmax = 48,
lonmin = -12, lonmax = 40)
# }
# NOT RUN {
# }
# NOT RUN {
clim <- Clim(sampleData$mod, sampleData$obs, memb = FALSE)
# }
# NOT RUN {
AnimateMap(clim$clim_exp, sampleData$lon, sampleData$lat,
toptitle = "climatology of decadal prediction", sizetit = 1,
units = "degree", brks = seq(270, 300, 3), monini = 11, freq = 12,
msk95lev = FALSE, filled.continents = TRUE, intlon = 10, intlat = 10,
fileout = 'clim_dec.gif')
# }
# NOT RUN {
ano_exp <- Ano(sampleData$mod, clim$clim_exp)
ano_obs <- Ano(sampleData$obs, clim$clim_obs)
leadtimes_dimension <- 4
initial_month <- 11
mean_start_month <- 1
mean_stop_month <- 12
season_means_mod <- Season(ano_exp, leadtimes_dimension, initial_month,
mean_start_month, mean_stop_month)
season_means_obs <- Season(ano_obs, leadtimes_dimension, initial_month,
mean_start_month, mean_stop_month)
# }
# NOT RUN {
AnimateMap(Mean1Dim(season_means_mod, 2)[1, 1, , , ], sampleData$lon,
sampleData$lat, toptitle = "Annual anomalies 1985 of decadal prediction",
sizetit = 1, units = "degree", monini = 1, freq = 1, msk95lev = FALSE,
brks = seq(-0.5, 0.5, 0.1), intlon = 10, intlat = 10,
filled.continents = TRUE, fileout = 'annual_means_dec.gif')
# }
# NOT RUN {
dim_to_mean <- 2 # Mean along members
rms <- RMS(Mean1Dim(season_means_mod, dim_to_mean),
Mean1Dim(season_means_obs, dim_to_mean))
# }
# NOT RUN {
AnimateMap(rms, sampleData$lon, sampleData$lat, toptitle =
"RMSE decadal prediction", sizetit = 1, units = "degree",
monini = 1, freq = 1, msk95lev = FALSE, brks = seq(0, 0.8, 0.08),
intlon = 10, intlat = 10, filled.continents = TRUE,
fileout = 'rmse_dec.gif')
# }
Run the code above in your browser using DataLab