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

sl.grid.addinfoR Documentation

Add Grid Variables to CDO Grid File

Description

Add additional variables from a spheRlab grid list to a corresponding CDO grid file (NetCDF). SHOULD BE DEPRECATED NOW THAT sl.grid.writeCDO CAN WRITE TO NetCDF DIRECTLY.

Usage

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

## 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 April 8, 2024, 8:34 a.m.