# Changes between Version 8 and Version 9 of udg/ecoms/RPackage/examples/drift

Ignore:
Timestamp:
Mar 9, 2015 5:28:00 PM (7 years ago)
Comment:

--

### Legend:

Unmodified
 v8 = Analysing model drift in South-western Iberia In this practice, we will analyse the model drift by using the forecast of daily mean surface temperature for July 2001 considering 6 different forecast (lead) months, from January to June. The lead month 0 (i.e., the initialization of July itself) will be the reference from which we will compute the anomalies. In this example, we will consider the first member of the CFSv2 hindcast. In this practice, we will analyse the model drift by using the forecast of daily mean (time = "DD") surface temperature (var = "tas") for July (season = 7) 2006 (years = 2006) considering 6 different forecast (lead) months, from January to June. The lead month 0 (i.e., the initialization of July itself) will be the reference from which we will compute the anomalies (leadMonth = 0). In this example, we will consider the first member (members = 1) of the CFSv2 hindcast as reference: {{{#!text/R ref <- loadECOMS(dataset = "CFSv2_seasonal_16", var = "tas", members = 1, lonLim = c(-10,-1), latLim = c(36,40), season = 7, years = 2006, leadMonth = 0, time = "DD") ref <- loadECOMS(dataset = "CFSv2_seasonal_16", var = "tas", members = 1, lonLim = c(-10,-1), latLim = c(36,40), season = 7, years = 2006, leadMonth = 0, time = "DD") }}} Next, we will load the forecast of the target variable recursively for lead month values from 1 to 6 (i.e., the initializations from January to June). The different objects are arranged in a list: Next, we will load the forecast of the target variable recursively for lead month values from 1 to 6 (i.e.: the initializations from January to June). The different objects are arranged in a list: {{{#!text/R cfs.list <- lapply(1:6, function(lead.month) { loadECOMS(dataset = "CFSv2_seasonal_16", var = "tas", members = 1, lonLim = c(-10,-1), latLim = c(36,40), season = 7, years = 2006, leadMonth = lead.month, time = "DD") }) loadECOMS(dataset = "CFSv2_seasonal_16", var = "tas", members = 1, lonLim = c(-10,-1), latLim = c(36,40), season = 7, years = 2006, leadMonth = lead.month, time = "DD") } ) }}} In order to visualize the departures of each lead month from the reference in the same range of values, we will use the spplot method for plotting spatial objects of the library sp. To this aim, we will first compute the multi-member spatial mean for each lead month forecast, and then we will arrange the data in a matrix of 6 columns (one for each month), and x * y rows, as follows: In order to visualize the departures of each lead month from the reference in the same range of values, we will use the spplot method of package sp for plotting spatial objects. To this aim, we will first compute the multi-member spatial mean for each lead month forecast, and then we will arrange the data in a matrix of 6 columns (one for each month), and x * y rows, as follows: {{{#!text/R load(url("http://meteo.unican.es/work/downscaler/aux/wlines.rda"), verbose = TRUE) l1 <- list("sp.lines", wlines) spplot(df, as.table = TRUE, col.regions = colorRampPalette(c("blue","white","red")), at = seq(-5.25,5.25,.25), scales = list(draw = TRUE), sp.layout = list(l1)) spplot(df, as.table = TRUE, col.regions = colorRampPalette(c("blue","white","red")), at = seq(-5.25,5.25,.25), scales = list(draw = TRUE), sp.layout = list(l1)) }}}