magclass (version 4.107.0)

write.magpie.ncdf: write.magpie.ncdf

Description

Writes magpie object into netcdf4 file.

Usage

write.magpie.ncdf(x, file, nc_compression = 9, var_style = "fullname",
  comment = NULL, verbose = TRUE)

Arguments

x

MAgPIE object. Has to be on half degree resolution. If x as comments in attr, they are plotted as global attributes.

file

file path as provided in write.magpie

nc_compression

Only used if filetype="nc". Sets the compression level for netCDF files (default is 9). If set to an integer between 1 (least compression) and 9 (most compression), the netCDF file is written in netCDF version 4 format. If set to NA, the netCDF file is written in netCDF version 3 format.

var_style

change between variable naming in nc-file; "fullname" for ungrouped name, "grouped" for variable names divided into sub-groups

comment

Vector of comments (also used for setting the unit). Comments are set as global attributes in the netcdf file. Format of comments: "indicator: comment" (e.g. "unit: Share of land area per grid cell")

verbose

Boolean deciding about whether function should be verbose or not

Value

netcdf file. Writes one file per year per data column. In the case that more than one year and data column is supplied several files are written with the structure filename_year_datacolumn.asc. In the case several data dimensions exist, they are saved as subcategories.

See Also

write.magpie