sl.grid.addinfo: Add Grid Variables to CDO Grid File

Description Usage Arguments Details Author(s) See Also Examples

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

Description

Add additional variables from a spheRlab grid list to a corresponding CDO grid file (NetCDF).

Usage

1
sl.grid.addinfo(grid, ncdf.file.in, ncdf.file.out = paste0(ncdf.file.in,"_addinfo.nc"), add.cell_area = TRUE, add.node_node_links = TRUE, add.triag_nodes = TRUE, add.coast = TRUE)

Arguments

grid

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

ncdf.file.in

a character specifying the path and file name of the file to which additional grid variables shall be added.

ncdf.file.out

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

add.cell_area

a logical value indicating whether or not to add cell (stamp polygon) areas.

add.node_node_links

a logical value indicating whether or not to add node-node links.

add.triag_nodes

a logical value indicating whether or not to add triangular element triplets.

add.coast

a logical value indicating whether or not to add coast information.

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.writeCDO

Examples

1
2
3
4
5
6
7
8
## Not run: 
grid = sl.grid.readFESOM(griddir="PATH-TO-YOUR-FESOM-GRID",rot=TRUE,rot.invert=TRUE,rot.abg=c(50,15,-90))
ofile = "~/sl.grid.CDO"
sl.grid.writeCDO(grid,ofile=ofile)
system(paste0("cdo -f nc const,0,",ofile," ",ofile,".nc"))
sl.grid.addinfo(grid,ncdf.file.in=paste0(ofile,".nc"))

## End(Not run)

helgegoessling/spheRlab documentation built on Sept. 29, 2017, 6:36 a.m.