sl.grid.writeCDO: Write Grid for CDO

Description Usage Arguments Details Author(s) See Also Examples

View source: R/sl.grid.writeCDO.R

Description

Write a spheRlab grid to a grid description file that makes unstructured-mesh data readable by the Climate Data Operators (CDO).

Usage

1
sl.grid.writeCDO(grid, ofile = "~/sl.grid.CDO", netcdf = TRUE, netcdf.prec = "double", ascii.digits = Inf, overwrite = FALSE, verbose = TRUE, cell_area = TRUE, node_node_links = TRUE, triag_nodes = TRUE, coast = TRUE, depth = TRUE, fesom2velocities = FALSE)

Arguments

grid

a spheRlab grid list as returned by sl.grid.readFESOM.

ofile

a character specifying the path and file name of the output file.

netcdf

a logical value indicating whether or not to write directly to NetCDF (default). If FALSE, only the variables lon, lon_bnds, lat, and lat_bnds are written in an ascii format that can be coverted subsequently to NetCDF using CDO. The latter is much slower.

netcdf.prec

a character defining the precision at which the (non-integer) variables are written. Reasonable options are "float" and "double" (default). Used only if netcdf=TRUE.

ascii.digits

a scalar giving the number of digits after which coordinates are truncated (rounded). Used only if netcdf=FALSE.

overwrite

a logical value indicating whether or not to overwrite an already existing file.

verbose

a logical value indicating whether or not print statements shall report on the function progess.

cell_area

a logical value indicating whether or not to add cell (stamp polygon) areas (from grid$cellareas). Used only if netcdf=TRUE.

node_node_links

a logical value indicating whether or not to add node-node links (from grid$neighnodes). Used only if netcdf=TRUE.

triag_nodes

a logical value indicating whether or not to add triangular element triplets (from grid$elem). Used only if netcdf=TRUE.

coast

a logical value indicating whether or not to add coast information (from grid$coast). Used only if netcdf=TRUE.

depth

a logical value indicating whether or not to add a vector with the depth of each grid level (from grid$depth) and a vector that provides the number of active (wet) levels underneath each surface node (from grid$depth.lev). Used only if netcdf=TRUE.

fesom2velocities

a logical value indicating whether or not a grid description for values defined at the centroids of the triangular elements (like horizontal velocities in FESOM2) instead of at the vertices shall be generated. Implemented only for netcdf=TRUE.

Details

This is a special function that is typically used when converting FESOM grid information to a CDO-readable format, see the example below.

Author(s)

Helge Goessling

See Also

sl.grid.readFESOM, sl.grid.addinfo

Examples

1
2
3
4
5
6
## Not run: 
grid = sl.grid.readFESOM(griddir="PATH-TO-YOUR-FESOM-GRID",rot=TRUE,rot.invert=TRUE,rot.abg=c(50,15,-90),threeD=FALSE)
sl.grid.writeCDO(grid,ofile="~/sl.grid.scalars.CDO",depth=FALSE)
sl.grid.writeCDO(grid,ofile="~/sl.grid.vectors.CDO",depth=FALSE,node_node_links=FALSE,triag_nodes=FALSE,coast=FALSE,fesom2velocities=TRUE)

## End(Not run)

helgegoessling/spheRlab documentation built on June 6, 2018, 5:22 a.m.