Writes one or multiple arrays with identical dimensions to a NetCDF file, creating multiple variables each with the same dimension.
write_nc2(
obj,
varnams = NA,
filnam_template = NA,
lonnam_template = "lon",
latnam_template = "lat",
lon = NA,
lat = NA,
z_dim = NA,
time = NA,
make_zdim = FALSE,
make_tdim = FALSE,
path = "./out.nc",
verbose = FALSE,
lonnam = "lon",
latnam = "lat",
zdimnam = "z",
timenam = "time",
units_lon = "degrees_east",
units_lat = "degrees_north",
units = "NA",
units_time = "days since 2001-01-01",
units_zdim = "",
long_names = "NA",
missing_value = -9999,
att_title = "",
att_history = ""
)
Either an rbeni-nc object or an array of size length(lon) x length(lat) x length(z_dim) x length(time). The order of lon (1st dim), lat (2nd dim), time (last dim) is mandatory. If it's an rbeni-nc object, then no additional aruguments are required.
A character string (or vector of strings) specifying the name(s) of the variable(s) that is/are written into the NetCDF output.
A character string specifying the file name of the template-NetCDF file from which all dimension information is read
and used for the NetCDF file created here. Defaults to NA
, meaning that all dimension information has to be spedifyed by the user. Othewise all
dimension specification are overridden.
Longitude name in the template file. Required only if !is.na(filnam_template)
.
Latitude name in the template file. Required only if !is.na(filnam_template)
.
A vector containing the longitudes of the grid cell's mid-points. Defaults to seq(dim(var)[1])
.
A vector containing the latitudes of the grid cell's mid-points. Defaults to seq(dim(var)[2])
.
A vector containing the values of the z-dimension ("z", 3rd dimension). Defaults to NA (no z-dimension is written).
A vector containing the values of the time dimension. Defaults to NA (no time dimension is written).
Write a z-dimension. If var is 2-dimensional, and z_dim==NA
, create a z-dimension of length 1.
Write a time dimension. If var is 2-dimensional, and time==NA
, create a time dimension of length 1.
A character string specifying the file path of the NetCDF file to be written.
A boolean specifying whether messages are to be returned. Defaults to FALSE
.
Longitude name
Latitude name
Z-dimension name
Time dimension name
Units of longitude
Units of latitude
Units of variables.
Units of time dimension.
Units of z-dimension.
Long name of var
.
Missing value for all variables.
Global attribute "Title"
.
Global attribute "History"
.
The path of the written NetCDF file.