Documentation for ncoct

Name

ncoct - an Octave netCDF interface

Synopsis

ncoct("open", fname)
ncoct("close", ncid)
ncoct("create", fname)
ncoct("putdim", ncid, dname, ddata)
ncoct("putvar", ncid, vname, rowid, colid, vdata)
ncoct("getvar", ncid, vname)

Description

ncoct is a Octave netCDF interface to be called from within Octave. Different functions are used by giving different first arguments. The functions currently available are:

string argument purpose of function
"open" open a file with read access
"close" close a file
"create" create a file with read and write access
"putdim" add a dimension
"putvar" add a variable field
"getvar" read a variable field

If the wrong number or incorrect type of arguments are given, then ncoct should print a usage message to the standard error.

ncoct makes use of netCDF ids. netCDF ids are simply non-negative integers that are used to refer different parts of a netCDF dataset.

ncoct("open", fname)
Open a netCDF file. Where fname (a string) is the name of the file to be opened. The dataset is opened with read-only access, with accesses buffered and cached for efficiency. Returns the netCDF id of the opened file if successful.
ncoct("close", ncid)
Close a netCDF file. Where ncid (a real scalar) is the netCDF id of the file to be closed. After the dataset is closed, its netCDF id may be used for other files which are opened or created. Returns 0.0 if successful.
ncoct("create", fname)
Create a netCDF file. Where fname (a string) is the name of the file to create. Any existing file with the same name is overwritten. Accesses are buffered and cached for efficiency. Returns the netCDF id of the created file if successful.
ncoct("putdim", ncid, dname, ddata)
Add a dimension. Where: The index field for the dimension is stored as 64-bit doubles, and is given a valid_range attribute. Returns the netCDF id of the added dimension if successful.
ncoct("putvar", ncid, vname, rowid, colid, vdata)
Add a variable. Where: If vdata is a vector or a scalar, use a negative number to hold the place of the corresponding dimension id. The variable field is stored as 64-bit doubles in the netCDF file, and is given a valid_range attribute. Returns the netCDF id of the added variable if successful.
ncoct("getvar", ncid, vname)
Read a variable. Where: Returns the variable as an Octave value list if successful.

Notes

Tested with:

Compiled with: mkoctfile ncoct.cc -lnetcdf

Author

Beverly Davis
beverly@nmt.edu