CST_SaveExp.Rd 3 KB
Newer Older
nperez's avatar
nperez committed
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/CST_SaveExp.R
\name{CST_SaveExp}
\alias{CST_SaveExp}
\title{Save objects of class 's2dv_cube' to data in NetCDF format}
nperez's avatar
nperez committed
\usage{
CST_SaveExp(
  data,
  sdate_dim = "sdate",
  ftime_dim = "time",
  var_dim = "var",
  memb_dim = "member",
Eva Rifà's avatar
Eva Rifà committed
  extra_string = NULL
nperez's avatar
nperez committed
}
\arguments{
\item{data}{An object of class \code{s2dv_cube}.}
nperez's avatar
nperez committed

\item{destination}{A character string containing the directory name in which 
to save the data. NetCDF file for each starting date are saved into the 
folder tree: \cr
destination/experiment/variable/. By default the function 
creates and saves the data into the folder "CST_Data" in the working 
directory.}
\item{sdate_dim}{A character string indicating the name of the start date 
dimension. By default, it is set to 'sdate'. It can be NULL if there is no
start date dimension.}

\item{ftime_dim}{A character string indicating the name of the forecast time
dimension. By default, it is set to 'time'. It can be NULL if there is no 
forecast time dimension.}

\item{dat_dim}{A character string indicating the name of dataset dimension. 
By default, it is set to 'dataset'. It can be NULL if there is no dataset  
dimension.}

\item{var_dim}{A character string indicating the name of variable dimension. 
By default, it is set to 'var'. It can be NULL if there is no variable  
dimension.}

\item{memb_dim}{A character string indicating the name of the member dimension.
By default, it is set to 'member'. It can be NULL if there is no member 
dimension.}

\item{single_file}{A logical value indicating if all object is saved in a 
unique file (TRUE) or in separated directories (FALSE). When it is FALSE, 
the array is separated for Datasets, variable and start date.}
\item{extra_string}{A character string to be include as part of the file name, 
for instance, to identify member or realization. It would be added to the 
file name between underscore characters.}
}
\value{
If single_file is TRUE only one file is created. If single_file is 
FALSE multiple files are created. Multiple files are created for each 
Dataset and start date. Each file could contain multiple members. It would be 
added to the file name between underscore characters. The path will be 
created with the name of the variable and each Datasets.
nperez's avatar
nperez committed
}
\description{
This function allows to divide and save a object of class 
's2dv_cube' into a NetCDF file, allowing to reload the saved data using 
\code{Start} function from StartR package. If the original 's2dv_cube' object 
has been created from \code{CST_Load()}, then it can be reloaded with 
\code{Load()}.
nperez's avatar
nperez committed
}
\examples{
\dontrun{
data <- lonlat_temp$exp
destination <- "./"
CST_SaveExp(data = data, destination = destination, ftime_dim = 'ftime', 
Eva Rifà's avatar
Eva Rifà committed
           var_dim = NULL, ftime_dim = 'ftime', var_dim = NULL)
nperez's avatar
nperez committed
}

}
\seealso{
\code{\link{CST_Load}}, \code{\link{as.s2dv_cube}} and 
\code{\link{s2dv_cube}}
nperez's avatar
nperez committed
}
nperez's avatar
nperez committed
\author{
Perez-Zanon Nuria, \email{nuria.perez@bsc.es}
}