sl.grid.writeZAXIS: Write z-axis for CDO

sl.grid.writeZAXISR Documentation

Write z-axis for CDO

Description

Write a z-axis description file that can be used to set the z-axis of a 3D data file with the Climate Data Operators (CDO).

Usage

sl.grid.writeZAXIS(grid = NULL, levels = NULL, bounds = NULL, zaxistype = "depth_below_sea", ofile = "~/sl.grid.zaxis.txt", overwrite = FALSE, verbose = TRUE)

Arguments

grid

a spheRlab grid list as returned by sl.grid.readFESOM; must contain an element 'depth', and optionally 'depth.bounds'. If NULL (default), levels must be specified explicitly.

levels

NULL (default) if levels are to be taken from grid, or a numeric vector speficying the depth levels explicitly.

bounds

NULL (default) if level bounds are to be taken from grid, or a numeric vector speficying the depth level bounds explicitly.

zaxistype

a character specifying the z-axis type. Default is "depth_below_sea".

ofile

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

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.

Details

See the CDO operator 'setzaxis' to set the z-axis of a corresponding FESOM file.

Author(s)

Helge Goessling

See Also

sl.grid.readFESOM, sl.grid.writeCDO

Examples

## Not run: 
# In this example a 'backward rotation' is performed, assuming that the original mesh coordinates are rotated;
# if that's not the case (which is now default), set 'rot=FALSE' or leave it unspecified (default is FALSE).
grid = sl.grid.readFESOM(griddir="PATH-TO-YOUR-FESOM-GRID",rot=TRUE,rot.invert=TRUE,rot.abg=c(50,15,-90))

# Write a corresponding z-axis description file that can be used with CDO to set the z-axis of a FESOM file ('cdo setzaxis,~/zaxis.txt ifile.nc ofile.nc')
res = sl.grid.writeZAXIS(grid,ofile="~/zaxis.txt")

## End(Not run)

FESOM/spheRlab documentation built on April 6, 2024, 6:52 p.m.