Histo2Hindcast {s2dv}R Documentation

Chunk long simulations for comparison with hindcasts

Description

Reorganize a long run (historical typically) with only one start date into chunks corresponding to a set of start dates. The time frequency of the data should be monthly.

Usage

Histo2Hindcast(
  data,
  sdatesin,
  sdatesout,
  nleadtimesout,
  sdate_dim = "sdate",
  ftime_dim = "ftime",
  ncores = NULL
)

Arguments

data

A numeric array of model or observational data with dimensions at least sdate_dim and ftime_dim.

sdatesin

A character string of the start date of 'data'. The format should be 'YYYYMMDD' or 'YYYYMM'.

sdatesout

A vector of character string indicating the expected start dates of the output. The format should be 'YYYYMMDD' or 'YYYYMM'.

nleadtimesout

A positive integer indicating the length of leadtimes of the output.

sdate_dim

A character string indicating the name of the sdate date dimension of 'data'. The default value is 'sdate'.

ftime_dim

A character string indicating the name of the lead time dimension of 'data'. The default value is 'ftime'.

ncores

An integer indicating the number of cores to use for parallel computation. The default value is NULL.

Value

A numeric array with the same dimensions as data, except the length of sdate_dim is 'sdatesout' and the length of ftime_dim is nleadtimesout.

Examples

 

sdates_out <- c('19901101', '19911101', '19921101', '19931101', '19941101')
leadtimes_per_startdate <- 12	
exp_data <- Histo2Hindcast(sampleData$mod, startDates, 
                          sdates_out, leadtimes_per_startdate)
obs_data <- Histo2Hindcast(sampleData$obs, startDates, 
                          sdates_out, leadtimes_per_startdate)
 ## Not run: 
exp_data <- Reorder(exp_data, c(3, 4, 1, 2))
obs_data <- Reorder(obs_data, c(3, 4, 1, 2))
PlotAno(exp_data, obs_data, sdates_out, 
       toptitle = paste('Anomalies reorganized into shorter chunks'), 
       ytitle = 'K', fileout = NULL)
 
## End(Not run)


[Package s2dv version 2.0.0 Index]