cxLatNew
- create a lattice with data and coordinates

C SPECIFICATION
#include 

typedef enum {
 cx_prim_byte,
 cx_prim_short,
 cx_prim_long,
 cx_prim_float,
 cx_prim_double
} cxPrimType;

typedef enum {
 cx_coord_uniform,
 cx_coord_perimeter,
 cx_coord_curvilinear
} cxCoordType;

cxLattice *cxLatNew(
  long nDim,
  long dims[],
  long nDataVar,
  cxPrimType primType,
  long nCoordVar,
  cxCoordType coordType)

FORTRAN SPECIFICATION
integer cx_prim_byte
integer cx_prim_short
integer cx_prim_long
integer cx_prim_float
integer cx_prim_double

parameter (cx_prim_byte = 0)
parameter (cx_prim_short = 1)
parameter (cx_prim_long = 2)
parameter (cx_prim_float = 3)
parameter (cx_prim_double = 4)

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 cxLatNew( nDim,
 dims, nDataVar, primType, nCoordVar,
 coordType)
integer nDim, dims(nDim)
integer nDataVar, primType
integer nCoordVar, coordType
PARAMETERS

nDim Number of lattice dimensions. dims Array specifying length in each dimension. nDataVar Number of data elements at each node. primType Primitive data type. nCoordVar Number of elements per coordinate point. coordType Representation of coordinate information.
FUNCTION RETURN VALUE
Returns a pointer to a new lattice.

DESCRIPTION
cxLatNew returns a pointer to a cxLattice structure in data memory. The lattice created will have nDim dimensions; the length of each dimension is specified in the array dims. Each node of the lattice will have space for nDataVar elements; the type of each element is specified by primType. Coordinates of the type given by coordType will be created, with nCoordVar floating point elements per coordinate. For uniform and perimeter lattices, the values nDim and nCoordVar must be equal.

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 on Silicon Graphics workstations running IRIX. This shared memory is a limited resource, so it is possible for the memory to be exhausted, causing the allocation routine to fail. If the allocation routine fails, any memory it has successfully allocated will be released, and a NULL pointer will be returned.
The subroutine cxDataAllocErrorGet returns TRUE if the lattice could not be allocated. See cxDataAllocErrorGet for more details on writing portable module code that copes well with limited memory.

SEE ALSO

cxDataAllocErrorGet(3E)

Last modified: Mon Nov 18 1996

cxLatPtrGet
- extract pointers to lattice data and coordinates

C SPECIFICATION
#include 

cxErrorCode cxLatPtrGet(
  cxLattice *src,
  cxData   **data,
  void     **dataVals,
  cxCoord  **coord,
  void     **coordVals)
FORTRAN SPECIFICATION
integer function cxLatPtrGet(src,
 datahand, pdataval, coordhand,
 pcoordval)
integer src
integer datahand, pdataval
integer coordhand, pcoordval

pointer (pdataval, dataVals)
pointer (pcoordval, coordVals)
<type dataVals(1)
real coordVals(1)
PARAMETERS

src Input lattice from which description is extracted. data Set to cxData pointer of src. dataVal Set to point to first element in src's data array.
coord Set to cxCoord pointer of src. coordVal Set to point to first element in src's coordinates array. FUNCTION RETURN VALUE

Returns an integer error code enumeration. DESCRIPTION

cxLatPtrGet extracts pointers to the cxData and cxCoord structures within a lattice. Pointers to the first elements of the data and coordinate arrays are also extracted. If any of data, dataVals, coord, or coordVals is NULL, that value is not extracted.

If src is not valid, cxLatPtrGet returns cx_err_error, otherwise it returns cx_err_none.

The Fortran user can access the dataVals and coordVals arrays by using the Fortran Pointer construction to equivalence the returned integer memory address and the start of the desired array, as indicated in the Fortran specification above.

The user can tell the function not to get information on a particular field by passing a NULL pointer value. You need not create dummy variables in the calling routine which calls cxLatPtrGet, because the request is simply ignored when the pointer comes in NULL.

SEE ALSO cxLatDescGet(3E), cxLatNew(3E), cxLatRootNew(3E), cxLatCoordNew(3E),

Last modified: Mon Nov 18 1996

IRIS EXPLORER ©
api sample

© The Numerical Algorithms Group Ltd, Oxford UK. 1996



PAGE BY SANTIAGO V LOMBEYDA