NAME

cxLatCoordNew - create a lattice with coordinates and no data
#include <cx/DataAccess.h>

typedef enum {
 cx_coord_uniform,
 cx_coord_perimeter,
 cx_coord_curvilinear
} cxCoordType;

cxLattice *cxLatCoordNew(long nDim, long dims[],
   long nCoordVar, cxCoordType coordType)
integer cx_coord_uniform
integer cx_coord_perimeter
integer cx_coord_curvilinear

parameter (cx_coord_uniform = 0) parameter (cx_coord_perimeter = 1) parameter (cx_coord_curvilinear = 2)
integer function cxLatCoordNew(nDim, dims, nCoordVar, coordType) integer nDim, dims(nDim) integer nCoordVar, coordType
nDim
Number of lattice dimensions.
dims
Array specifying length in each dimension.
nCoordVar
Number of elements per coordinate point.
coordType
Representation of coordinate information.
Returns a pointer to a new lattice structure. cxLatCoordNew creates a cxLattice structure in data memory and returns a pointer it. The lattice created will have nDim dimensions; the length of each dimension is specified in the array dims. Coordinates of the type given by coordType will be created, with nCoordVar floating point elements per coordinate. nCoordVar does not have to be the same as nDim. For example, to create a two dimensional lattice representing a surface in a three dimensional space set nDim to 2 and nCoordVar to 3. No space for data will be allocated. See notes below.

Refer to "IRIS Explorer Module Writer's Guide" for more information on the structure of cxLattice and its contents.

Lattice data structures are allocated from a shared memory arena. This shared memory is a limited resource, so it is possible for the memory to be exhausted, causing the allocation routine to fail.

See cxDataManAbortOnError for more details on writing portable module code that copes well with limited memory.

cxDataManAbortOnError cxLatNew, cxLatRootNew, cxLatDataNew, cxDataNew, cxLatPtrSet

Many modules assume that a lattice has data. Modules built with the IRIS Explorer module builder utility (mbuilder(1)) also require that coordinates be present. It is strongly recommended that lattices be created with both data and coordinates for compatibility. cxLatCoordNew, used in conjunction with cxDataNew and cxLatPtrSet, allows the lattice, data and coordinates to be created separately.

[ Documentation Home ]