NAME

cxCoordAlloc, cxCoordCDimsGet, cxCoordCDimsLen, cxCoordCDimsProd, cxCoordCDimsRem, cxCoordCDimsSet, cxCoordCnDimGet, cxCoordCnDimSet, cxCoordCoordTypeGet, cxCoordCoordTypeSet, cxCoordCoordinatesArrayAlloc, cxCoordCoordinatesArrayGet, cxCoordCoordinatesArrayLen, cxCoordCoordinatesArrayRem, cxCoordCoordinatesArraySet, cxCoordCoordinatesArrayType, cxCoordCopy, cxCoordDup, cxCoordNumCoordDimensionsGet, cxCoordNumCoordDimensionsSet, cxCoordNumCoordDimsGet, cxCoordNumCoordDimsSet, cxCoordPerimCoordArrayLengthGet, cxCoordPerimCoordArrayLengthSet, cxCoordRead, cxCoordWrite, cxDataAlloc, cxDataCopy, cxDataDDimsGet, cxDataDDimsLen, cxDataDDimsProd, cxDataDDimsRem, cxDataDDimsSet, cxDataDataArrayAlloc, cxDataDataArrayGet, cxDataDataArrayLen, cxDataDataArrayRem, cxDataDataArraySet, cxDataDataArrayType, cxDataDnDimGet, cxDataDnDimSet, cxDataDup, cxDataNumDataVariablesGet, cxDataNumDataVariablesSet, cxDataPrimitiveDataTypeGet, cxDataPrimitiveDataTypeSet, cxDataRead, cxDataWrite, cxLatticeAlloc, cxLatticeCoordStructureGet, cxLatticeCoordStructureSet, cxLatticeCopy, cxLatticeDataStructureGet, cxLatticeDataStructureSet, cxLatticeDimensionsArrayGet, cxLatticeDimensionsArrayLen, cxLatticeDimensionsArrayRem, cxLatticeDimensionsArraySet, cxLatticeDup, cxLatticeNumDimensionsGet, cxLatticeNumDimensionsSet, cxLatticeRead, cxLatticeWrite

interface routines for IRIS Explorer cxLattice data structure

C SPECIFICATION

#include <cx/cxLattice.api.h>
#ifndef __cxLattice_API_H_
#define __cxLattice_API_H_

#ifdef __cplusplus
 extern "C" {
#endif

#include <stdio.h>
#if defined(__sun) || defined(WIN32)
 cxCoord* cxCoordAlloc( signed long CnDim, signed long * CDims, cxCoordType CoordType,
 signed long PerimCoordArrayLength, signed long NumCoordDimensions );
 signed long* cxCoordCDimsGet( cxCoord *src, cxErrorCode *ec );
 long cxCoordCDimsLen( cxCoord *src, cxErrorCode *ec );
 long cxCoordCDimsProd( cxCoord *src, cxErrorCode *ec );
 void cxCoordCDimsRem( cxCoord *src, signed long* *val, cxErrorCode *ec );
 void cxCoordCDimsSet( cxCoord *src, signed long* val, cxErrorCode *ec );
 signed long cxCoordCnDimGet( cxCoord *src, cxErrorCode *ec );
 void cxCoordCnDimSet( cxCoord *src, signed long val, cxErrorCode *ec );
 cxCoordType cxCoordCoordTypeGet( cxCoord *src, cxErrorCode *ec );
 void cxCoordCoordTypeSet( cxCoord *src, cxCoordType val, cxErrorCode *ec );
 void* cxCoordCoordinatesArrayAlloc( cxCoord *src );
 void* cxCoordCoordinatesArrayGet( cxCoord *src, cxErrorCode *ec );
 long cxCoordCoordinatesArrayLen( cxCoord *src, cxErrorCode *ec );
 void cxCoordCoordinatesArrayRem( cxCoord *src, void *val, cxErrorCode *ec );
 void cxCoordCoordinatesArraySet( cxCoord *src, void *member, cxErrorCode *ec );
 cxPrimType cxCoordCoordinatesArrayType( cxCoord *src, cxErrorCode *ec );
 cxCoord* cxCoordCopy( cxCoord *src );
 cxCoord* cxCoordDup( cxCoord *src );
 signed long cxCoordNumCoordDimensionsGet( cxCoord *src, cxErrorCode *ec );
 void cxCoordNumCoordDimensionsSet( cxCoord *src, signed long val, cxErrorCode *ec );
 void* cxCoordNumCoordDimsGet( cxCoord *src );
 void cxCoordNumCoordDimsSet( cxCoord *src, void *member );
 signed long cxCoordPerimCoordArrayLengthGet( cxCoord *src, cxErrorCode *ec );
 void cxCoordPerimCoordArrayLengthSet( cxCoord *src, signed long val, cxErrorCode *ec );
 cxCoord* cxCoordRead( FILE *fd );
 void cxCoordWrite( FILE *fd, int mode, cxCoord *src );
 cxData* cxDataAlloc( signed long DnDim, signed long * DDims, signed long NumDataVariables,
 cxPrimType PrimitiveDataType );
 cxData* cxDataCopy( cxData *src );
 signed long* cxDataDDimsGet( cxData *src, cxErrorCode *ec );
 long cxDataDDimsLen( cxData *src, cxErrorCode *ec );
 long cxDataDDimsProd( cxData *src, cxErrorCode *ec );
 void cxDataDDimsRem( cxData *src, signed long* *val, cxErrorCode *ec );
 void cxDataDDimsSet( cxData *src, signed long* val, cxErrorCode *ec );
 void* cxDataDataArrayAlloc( cxData *src );
 void* cxDataDataArrayGet( cxData *src, cxErrorCode *ec );
 long cxDataDataArrayLen( cxData *src, cxErrorCode *ec );
 void cxDataDataArrayRem( cxData *src, void *val, cxErrorCode *ec );
 void cxDataDataArraySet( cxData *src, void *member, cxErrorCode *ec );
 cxPrimType cxDataDataArrayType( cxData *src, cxErrorCode *ec );
 signed long cxDataDnDimGet( cxData *src, cxErrorCode *ec );
 void cxDataDnDimSet( cxData *src, signed long val, cxErrorCode *ec );
 cxData* cxDataDup( cxData *src );
 signed long cxDataNumDataVariablesGet( cxData *src, cxErrorCode *ec );
 void cxDataNumDataVariablesSet( cxData *src, signed long val, cxErrorCode *ec );
 cxPrimType cxDataPrimitiveDataTypeGet( cxData *src, cxErrorCode *ec );
 void cxDataPrimitiveDataTypeSet( cxData *src, cxPrimType val, cxErrorCode *ec );
 cxData* cxDataRead( FILE *fd );
 void cxDataWrite( FILE *fd, int mode, cxData *src );
 cxLattice* cxLatticeAlloc( signed long NumDimensions, signed long * DimensionsArray );
 cxCoord* cxLatticeCoordStructureGet( cxLattice *src, cxErrorCode *ec );
 void cxLatticeCoordStructureSet( cxLattice *src, cxCoord* val, cxErrorCode *ec );
 cxLattice* cxLatticeCopy( cxLattice *src );
 cxData* cxLatticeDataStructureGet( cxLattice *src, cxErrorCode *ec );
 void cxLatticeDataStructureSet( cxLattice *src, cxData* val, cxErrorCode *ec );
 signed long* cxLatticeDimensionsArrayGet( cxLattice *src, cxErrorCode *ec );
 long cxLatticeDimensionsArrayLen( cxLattice *src, cxErrorCode *ec );
 void cxLatticeDimensionsArrayRem( cxLattice *src, signed long* *val, cxErrorCode *ec );
 void cxLatticeDimensionsArraySet( cxLattice *src, signed long* val, cxErrorCode *ec );
 cxLattice* cxLatticeDup( cxLattice *src );
 signed long cxLatticeNumDimensionsGet( cxLattice *src, cxErrorCode *ec );
 void cxLatticeNumDimensionsSet( cxLattice *src, signed long val, cxErrorCode *ec );
 cxLattice* cxLatticeRead( FILE *fd );
 void cxLatticeWrite( FILE *fd, int mode, cxLattice *src );

FORTRAN SPECIFICATION

#ifndef __cxLattice_API_H_
#define __cxLattice_API_H_

#ifdef __cplusplus
 extern "C" {
#endif

#include <stdio.h>
#if defined(__sun) || defined(WIN32)
 integer function cxCoordAlloc( CnDim, CDims, CoordType, PerimCoordArrayLength, NumCoordDimensions )
 integer function cxCoordCDimsGet( src, ec )
 integer function cxCoordCDimsLen( src, ec )
 integer function cxCoordCDimsProd( src, ec )
 subroutine cxCoordCDimsRem( src, val, ec )
 subroutine cxCoordCDimsSet( src, val, ec )
 integer function cxCoordCnDimGet( src, ec )
 subroutine cxCoordCnDimSet( src, val, ec )
 integer function cxCoordCoordTypeGet( src, ec )
 subroutine cxCoordCoordTypeSet( src, val, ec )
 integer function cxCoordCoordinatesArrayAlloc( src )
 integer function cxCoordCoordinatesArrayGet( src, ec )
 integer function cxCoordCoordinatesArrayLen( src, ec )
 subroutine cxCoordCoordinatesArrayRem( src, val, ec )
 subroutine cxCoordCoordinatesArraySet( src, member, ec )
 integer function cxCoordCoordinatesArrayType( src, ec )
 integer function cxCoordCopy( src )
 integer function cxCoordDup( src )
 integer function cxCoordNumCoordDimensionsGet( src, ec )
 subroutine cxCoordNumCoordDimensionsSet( src, val, ec )
 integer function cxCoordNumCoordDimsGet( src )
 subroutine cxCoordNumCoordDimsSet( src, member )
 integer function cxCoordPerimCoordArrayLengthGet( src, ec )
 subroutine cxCoordPerimCoordArrayLengthSet( src, val, ec )
 integer function cxCoordRead( fd )
 subroutine cxCoordWrite( fd, mode, src )
 integer function cxDataAlloc( DnDim, DDims, NumDataVariables, PrimitiveDataType )
 integer function cxDataCopy( src )
 integer function cxDataDDimsGet( src, ec )
 integer function cxDataDDimsLen( src, ec )
 integer function cxDataDDimsProd( src, ec )
 subroutine cxDataDDimsRem( src, val, ec )
 subroutine cxDataDDimsSet( src, val, ec )
 integer function cxDataDataArrayAlloc( src )
 integer function cxDataDataArrayGet( src, ec )
 integer function cxDataDataArrayLen( src, ec )
 subroutine cxDataDataArrayRem( src, val, ec )
 subroutine cxDataDataArraySet( src, member, ec )
 integer function cxDataDataArrayType( src, ec )
 integer function cxDataDnDimGet( src, ec )
 subroutine cxDataDnDimSet( src, val, ec )
 integer function cxDataDup( src )
 integer function cxDataNumDataVariablesGet( src, ec )
 subroutine cxDataNumDataVariablesSet( src, val, ec )
 integer function cxDataPrimitiveDataTypeGet( src, ec )
 subroutine cxDataPrimitiveDataTypeSet( src, val, ec )
 integer function cxDataRead( fd )
 subroutine cxDataWrite( fd, mode, src )
 integer function cxLatticeAlloc( NumDimensions, DimensionsArray )
 integer function cxLatticeCoordStructureGet( src, ec )
 subroutine cxLatticeCoordStructureSet( src, val, ec )
 integer function cxLatticeCopy( src )
 integer function cxLatticeDataStructureGet( src, ec )
 subroutine cxLatticeDataStructureSet( src, val, ec )
 integer function cxLatticeDimensionsArrayGet( src, ec )
 integer function cxLatticeDimensionsArrayLen( src, ec )
 subroutine cxLatticeDimensionsArrayRem( src, val, ec )
 subroutine cxLatticeDimensionsArraySet( src, val, ec )
 integer function cxLatticeDup( src )
 integer function cxLatticeNumDimensionsGet( src, ec )
 subroutine cxLatticeNumDimensionsSet( src, val, ec )
 integer function cxLatticeRead( fd )
 subroutine cxLatticeWrite( fd, mode, src )

PARAMETERS

src
In C, a pointer to the data structure to be accessed in whole or part. In Fortran, an opaque integer handle to the data structure to be accessed in whole or part.
val
The val argument (if present) is the new value to be assigned to the structure member. See the section on Set routines below for more information on the val argument.
*Ind
Arguments following src and preceding ec with variable name ending in Ind (if any) are integer array bounds. If such an argument exists, the requested member is part of an array of structures, for which the *Ind variable provides the array index.
ec
In C, a pointer to a returned error code (if present). In Fortran, an integer output error code (if present). The ec output is an enumerated integer with cx_err_none (zero) indicating success. Any other value indicates an improper src input or an out-of-bounds Ind argument.

FUNCTION RETURN VALUE

The return value (if present) is the accessed member, member type or length, allocated array or structure, duplicated structure, or read structure. See the section on the appropriate routines below for more information.

DESCRIPTION

The cxLattice IRIS Explorer data structure is used to communicate data between modules in the IRIS Explorer scientific visualization system. The cxLattice structure is defined using the IRIS Explorer Typing Language; the actual datatype specification is given at the bottom of the manual page. Derived from this datatype are several C and Fortran language routines that support manipulation of the cxLattice structure members. The name of each routine is derived from the label of the associated member in the cxLattice along with a keyword to denote the routine's action. Each routine name has the three parts type, member, and action, where type is either cxLattice or a subsidiary reference-counted type, the optional member indicates the member to be accessed (or, if missing, indicates that the entire structure is the subject of the action), and action names the action the routine performs. Routines are generated to support only the actions which make sense for the cxLattice structure. Not all types of routines may be represented if cxLattice does not contain all types of structure members. Routines may be generated to support getting, setting and allocating structure members. Other routines compute the type, length, or array dimension product of appropriate structure members. Additional routines support copying, duplication, reading and writing of the entire cxLattice data structure and of its subordinate reference counted sub-structures (if any). Similar routines are described together in a section below. Each description gives the information common to the routines in that section, with a table of the details particular to each routine. While the section headings mention only the cxLattice routines, their discussions also pertain to similar routines for reference-counted types within cxLattice. While most routines for the cxLattice structure deal with the entire structure or a single member of it, some routines may access several members that have been aliased together (see, for instance, the data and coordinates arrays in the cxData and cxCoord structures of the cxLattice type). The routines that manipulate the non-uniquely labelled members in the cases of a switch structure have a special structure. Whereas a routine accessing a single structure member can have arguments and a return value of known type, the argument types of the union-based routine are not known at compile time. Therefore, such a routine expects as input or returns as output a pointer to memory; the pointer is either the pointer to the scalar member, or the actual member address in the case of an array or referenced structure. Some Get, Set, Type and Len routines may have this behavior.

GENERATING THE INTERFACE ROUTINES

All of the routines documented above are automatically generated from the type file (whose suffix is .t). If you wish to examine the generated code for a given type (user- or IRIS Explorer-defined), you can recreate those files at will. Once you have created a .t file containing the type specification, you must also create a file named TYPES, which has on a single line the name of your type (without the .t suffix). Then create a Makefile by executing cxmkmf; you use the Makefile to build the type library. In the process of doing this, the generated code will be written to the file with suffix .api.c.

For example, assuming that the cxLattice.t file exists, you would take the following steps:

        echo cxLattice > TYPES
        cxmkmf
        make
Now your automatically generated code will reside in cxLattice.api.c.

Note that this process will create several files in the local directory, so it is often helpful to use a separate directory for types, just as modules are developed in their own directories.

GET ROUTINES

Routines in this group return the value of the appropriate structure member. The label of the member is used to construct the name of the routine, which has the three parts type, member, and Get. If the label refers to several members in disjoint cases of a switch statement, then the return value is a pointer to storage. This pointer is either a reference to the scalar member, or the actual member pointer, depending on the type of the member.

C DESCRIPTION

 signed long* cxCoordCDimsGet( cxCoord *src, cxErrorCode *ec );
 signed long cxCoordCnDimGet( cxCoord *src, cxErrorCode *ec );
 cxCoordType cxCoordCoordTypeGet( cxCoord *src, cxErrorCode *ec );
 void* cxCoordCoordinatesArrayGet( cxCoord *src, cxErrorCode *ec );
 signed long cxCoordNumCoordDimensionsGet( cxCoord *src, cxErrorCode *ec );
 void* cxCoordNumCoordDimsGet( cxCoord *src );
 signed long cxCoordPerimCoordArrayLengthGet( cxCoord *src, cxErrorCode *ec );
 signed long* cxDataDDimsGet( cxData *src, cxErrorCode *ec );
 void* cxDataDataArrayGet( cxData *src, cxErrorCode *ec );
 signed long cxDataDnDimGet( cxData *src, cxErrorCode *ec );
 signed long cxDataNumDataVariablesGet( cxData *src, cxErrorCode *ec );
 cxPrimType cxDataPrimitiveDataTypeGet( cxData *src, cxErrorCode *ec );
 cxCoord* cxLatticeCoordStructureGet( cxLattice *src, cxErrorCode *ec );
 cxData* cxLatticeDataStructureGet( cxLattice *src, cxErrorCode *ec );
 signed long* cxLatticeDimensionsArrayGet( cxLattice *src, cxErrorCode *ec );
 signed long cxLatticeNumDimensionsGet( cxLattice *src, cxErrorCode *ec );

FORTRAN DESCRIPTION

 integer function cxCoordCDimsGet( src, ec )
 integer function cxCoordCnDimGet( src, ec )
 integer function cxCoordCoordTypeGet( src, ec )
 integer function cxCoordCoordinatesArrayGet( src, ec )
 integer function cxCoordNumCoordDimensionsGet( src, ec )
 integer function cxCoordNumCoordDimsGet( src )
 integer function cxCoordPerimCoordArrayLengthGet( src, ec )
 integer function cxDataDDimsGet( src, ec )
 integer function cxDataDataArrayGet( src, ec )
 integer function cxDataDnDimGet( src, ec )
 integer function cxDataNumDataVariablesGet( src, ec )
 integer function cxDataPrimitiveDataTypeGet( src, ec )
 integer function cxLatticeCoordStructureGet( src, ec )
 integer function cxLatticeDataStructureGet( src, ec )
 integer function cxLatticeDimensionsArrayGet( src, ec )
 integer function cxLatticeNumDimensionsGet( src, ec )
<ans>
The returned argument represents the structure member of interest. There are two cases, with different interpretations of the returned argument. The first case, in which the return type is not a generic pointer (in C a void* pointer, in Fortran an integer), returns the member of interest, whether scalar or pointer. In the second case, in which the return type is a generic pointer (in C a void* pointer), the returned value is a pointer to storage. If the requested member is a scalar, the returned value is a reference to that scalar. If the requested member is a pointer, the returned value is actually that pointer. This case happens when several members in different cases of a switch structure are given the same label in the IRIS Explorer Typing Language file cxLattice.t. It may be difficult to distinguish the two cases in Fortran based on the function return type (if that type is integer). In this case the user should consult the definition of cxLattice to determine whether several members have the same label string. In Fortran, the Get routines that return a character string or array of character strings are implemented as subroutines having that string as their last argument. They are not written as character functions. Such a subroutine returning an array of character strings assumes the caller has passed in enough storage to hold all the strings; the number of elements necessary to form the array can be found by calling the related Len routine.

SET ROUTINES

Routines in this group set the value of the appropriate structure member. The label of the member is used to construct the name of the routine, which has the three parts type, member, and Set. If the label refers to several members in disjoint cases of a switch statement, then the input value must be a pointer to storage. This pointer is either a reference to a scalar value used to override the old member value, or the actual pointer used to replace the member, depending on the type of the member. The old member is deleted, if an array, or has its reference count decremented, if a shared structure.

C DESCRIPTION

 void cxCoordCDimsSet( cxCoord *src, signed long* val, cxErrorCode *ec );
 void cxCoordCnDimSet( cxCoord *src, signed long val, cxErrorCode *ec );
 void cxCoordCoordTypeSet( cxCoord *src, cxCoordType val, cxErrorCode *ec );
 void cxCoordCoordinatesArraySet( cxCoord *src, void *member, cxErrorCode *ec );
 void cxCoordNumCoordDimensionsSet( cxCoord *src, signed long val, cxErrorCode *ec );
 void cxCoordNumCoordDimsSet( cxCoord *src, void *member );
 void cxCoordPerimCoordArrayLengthSet( cxCoord *src, signed long val, cxErrorCode *ec );
 void cxDataDDimsSet( cxData *src, signed long* val, cxErrorCode *ec );
 void cxDataDataArraySet( cxData *src, void *member, cxErrorCode *ec );
 void cxDataDnDimSet( cxData *src, signed long val, cxErrorCode *ec );
 void cxDataNumDataVariablesSet( cxData *src, signed long val, cxErrorCode *ec );
 void cxDataPrimitiveDataTypeSet( cxData *src, cxPrimType val, cxErrorCode *ec );
 void cxLatticeCoordStructureSet( cxLattice *src, cxCoord* val, cxErrorCode *ec );
 void cxLatticeDataStructureSet( cxLattice *src, cxData* val, cxErrorCode *ec );
 void cxLatticeDimensionsArraySet( cxLattice *src, signed long* val, cxErrorCode *ec );
 void cxLatticeNumDimensionsSet( cxLattice *src, signed long val, cxErrorCode *ec );

FORTRAN DESCRIPTION

 subroutine cxCoordCDimsSet( src, val, ec )
 subroutine cxCoordCnDimSet( src, val, ec )
 subroutine cxCoordCoordTypeSet( src, val, ec )
 subroutine cxCoordCoordinatesArraySet( src, member, ec )
 subroutine cxCoordNumCoordDimensionsSet( src, val, ec )
 subroutine cxCoordNumCoordDimsSet( src, member )
 subroutine cxCoordPerimCoordArrayLengthSet( src, val, ec )
 subroutine cxDataDDimsSet( src, val, ec )
 subroutine cxDataDataArraySet( src, member, ec )
 subroutine cxDataDnDimSet( src, val, ec )
 subroutine cxDataNumDataVariablesSet( src, val, ec )
 subroutine cxDataPrimitiveDataTypeSet( src, val, ec )
 subroutine cxLatticeCoordStructureSet( src, val, ec )
 subroutine cxLatticeDataStructureSet( src, val, ec )
 subroutine cxLatticeDimensionsArraySet( src, val, ec )
 subroutine cxLatticeNumDimensionsSet( src, val, ec )
val
The val argument (if present) is the new value to be assigned to the structure member. There are two cases, with different interpretations of val. The first case, in which the type of val is not a generic pointer (in C a void* pointer, in Fortran an integer), assigns val, whether scalar or pointer. In the second case, in which the type of val is a generic pointer (in C a void* pointer), val is a pointer to storage. If the requested member is a scalar, val is a reference to that scalar. If the requested member is a pointer, val is interpreted as actually that pointer. This case happens when several members in different cases of a switch structure are given the same label in the IRIS Explorer Typing Language file cxLattice.t. It may be difficult to distinguish the two cases in Fortran based on the argument type (if that type is integer). In this case the user should consult the definition of cxLattice to determine whether several members have the same label string.

TYPE ROUTINES

Routines in this group return the type of the appropriate structure member, which is one of several members sharing the same label. The label of the member is used to construct the name of the routine, which has the three parts type, member, and Type.

C DESCRIPTION

 cxPrimType cxCoordCoordinatesArrayType( cxCoord *src, cxErrorCode *ec );
 cxPrimType cxDataDataArrayType( cxData *src, cxErrorCode *ec );

FORTRAN DESCRIPTION

 integer function cxCoordCoordinatesArrayType( src, ec )
 integer function cxDataDataArrayType( src, ec )

LENGTH ROUTINES

Routines in this group return the length in words of the appropriate array member. This length is calculated as the product of the dimensioning scalars and variables used to declare the array. The label of the member is used to construct the name of the routine, which has the three parts type, member, and Len.

C DESCRIPTION

 long cxCoordCDimsLen( cxCoord *src, cxErrorCode *ec );
 long cxCoordCoordinatesArrayLen( cxCoord *src, cxErrorCode *ec );
 long cxDataDDimsLen( cxData *src, cxErrorCode *ec );
 long cxDataDataArrayLen( cxData *src, cxErrorCode *ec );
 long cxLatticeDimensionsArrayLen( cxLattice *src, cxErrorCode *ec );

FORTRAN DESCRIPTION

 integer function cxCoordCDimsLen( src, ec )
 integer function cxCoordCoordinatesArrayLen( src, ec )
 integer function cxDataDDimsLen( src, ec )
 integer function cxDataDataArrayLen( src, ec )
 integer function cxLatticeDimensionsArrayLen( src, ec )
<ans>
The type of the requested switch discriminator variable. In C, the return value is a cxPrimType enumerated integer. In Fortran, the return value is an integer. See the file /usr/explorer/include/cx/Typedefs.h for more information.

DIMENSION PRODUCT ROUTINES

Routines in this group compute the product of an array member's elements, to reflect the contribution to the length of an array that uses this member as a dimensioning variable. The label of the member to be allocated is used to construct the name of the routine, which has the three parts type, member, and Prod.

C DESCRIPTION

 long cxCoordCDimsProd( cxCoord *src, cxErrorCode *ec );
 long cxDataDDimsProd( cxData *src, cxErrorCode *ec );

FORTRAN DESCRIPTION

 integer function cxCoordCDimsProd( src, ec )
 integer function cxDataDDimsProd( src, ec )
<ans>
The returned integer value is the length of an array dimensioned by the specified member, computed by taking the product of the member's values.

DUPLICATION ROUTINES

Routines in this group duplicate the entire data structure. The type of the structure is used to construct the name of the routine, which has the two parts type and Dup.

C DESCRIPTION

 cxCoord* cxCoordDup( cxCoord *src );
 cxData* cxDataDup( cxData *src );
 cxLattice* cxLatticeDup( cxLattice *src );

FORTRAN DESCRIPTION

 integer function cxCoordDup( src )
 integer function cxDataDup( src )
 integer function cxLatticeDup( src )
<ans>
The return value references the duplicated structure, or is zero if an error was encountered. In C, the return value is a pointer to the structure. In Fortran, the return value is an opaque integer handle to the duplicated data structure.

COPYING ROUTINES

Routines in this group copy the data structure, but not its reference counted children. The children of the input structure are referenced from the output structure and their reference counts incremented. For instance, a copied lattice would have a new cxLattice structure and a new dims vector, but would refer to the original cxData and cxCoord structures. The type of the structure is used to construct the name of the routine, which has the two parts type and Copy.

C DESCRIPTION

 cxCoord* cxCoordCopy( cxCoord *src );
 cxData* cxDataCopy( cxData *src );
 cxLattice* cxLatticeCopy( cxLattice *src );

FORTRAN DESCRIPTION

 integer function cxCoordCopy( src )
 integer function cxDataCopy( src )
 integer function cxLatticeCopy( src )
<ans>
The return value references the copied structure, or is zero if an error was encountered. In C, the return value is a pointer to the structure. In Fortran, the return value is an opaque integer handle to the duplicated data structure.

STORAGE ALLOCATION ROUTINES

Routines in this group allocate a reference-counted structure, an array member, or one of several union members sharing the same label. The label of the member to be allocated is used to construct the name of the routine, which has the three parts type, (optionally) member, and Alloc. If there is no member designated, the routine allocates the entire reference-counted structure.

C DESCRIPTION

 cxCoord* cxCoordAlloc( signed long CnDim, signed long * CDims, cxCoordType CoordType,
 signed long PerimCoordArrayLength, signed long NumCoordDimensions );
 void* cxCoordCoordinatesArrayAlloc( cxCoord *src );
 cxData* cxDataAlloc( signed long DnDim, signed long * DDims, signed long NumDataVariables,
 cxPrimType PrimitiveDataType );
 void* cxDataDataArrayAlloc( cxData *src );
 cxLattice* cxLatticeAlloc( signed long NumDimensions, signed long * DimensionsArray );

FORTRAN DESCRIPTION

 integer function cxCoordAlloc( CnDim, CDims, CoordType, PerimCoordArrayLength, NumCoordDimensions )
 integer function cxCoordCoordinatesArrayAlloc( src )
 integer function cxDataAlloc( DnDim, DDims, NumDataVariables, PrimitiveDataType )
 integer function cxDataDataArrayAlloc( src )
 integer function cxLatticeAlloc( NumDimensions, DimensionsArray )
There are two types of allocation routines, those that allocate an array and those that allocate a reference-counted structure.
src
If src is an argument, then the allocation creates an array needed by the src structure. It is assumed that the src structure has been constructed to contain all the information needed to dimension the array. In C, src is a pointer to the structure. In Fortran, src is an opaque integer handle to the data structure.
<other>
The arguments other than src, if any, are dimensioning scalars, dimensioning arrays, and discriminating switches of some enumerated type. In C, the respective types of these arguments are long, long*, and enumerated types. In Fortran, their respective types are integer, integer array, and enumerated integer. These arguments are included in the argument list if they are needed to compute the size of an array or which case of a switch to take in allocating a reference-counted structure. It is possible that a structure allocation routine will not fully allocate the structure. This happens when an array or switch contains several items to also be allocated; there is no acceptable way to put all of the dimensioning information into the function call, so the array is not allocated (a null pointer is used instead) and the user is expected to use array allocation and member setting routines to complete the structure allocation. The return value references the allocated array or structure, or is zero if an error was encountered. In C, the return value is a pointer to the allocated structure. In Fortran, the return value is an opaque integer handle to the allocated data structure.

STORAGE REMOVAL ROUTINES

Routines in this group remove an array of objects, which may be scalars, structures, or reference-counted structures. Simple arrays are freed, arrays of structures are operated on recursively to remove their contents, and reference-counted structures have their reference counts decremented. The label of the member to be removed is used to construct the name of the routine, which has the three parts type, member, and Rem. No routine is created for removal of single reference-counted structures, use cxDataRefDec for that purpose. These routines are internal utilities used only by the Set routines. They are not meant for public use. No Fortran interface is provided. To delete a reference-counted object and the members it contains, use cxDataRefDec. To replace a member, use the related Set routine.

C DESCRIPTION

 void cxCoordCDimsRem( cxCoord *src, signed long* *val, cxErrorCode *ec );
 void cxCoordCoordinatesArrayRem( cxCoord *src, void *val, cxErrorCode *ec );
 void cxDataDDimsRem( cxData *src, signed long* *val, cxErrorCode *ec );
 void cxDataDataArrayRem( cxData *src, void *val, cxErrorCode *ec );
 void cxLatticeDimensionsArrayRem( cxLattice *src, signed long* *val, cxErrorCode *ec );
src
src is the reference-counted structure containing the member to be removed. In C, src is a pointer to the structure.
val
val is the address of the member to be removed. An array is deleted, while a shared structure has its reference count decremented. In C, val is a pointer to the member.

TYPE READING ROUTINES

Routines in this group use the IRIS Explorer transcription mechanism to read an ASCII or binary IRIS Explorer data structure from a file descriptor. The name of the type is used to construct the name of the routine, which has the two parts type and Read.

C DESCRIPTION

 cxCoord* cxCoordRead( FILE *fd );
 cxData* cxDataRead( FILE *fd );
 cxLattice* cxLatticeRead( FILE *fd );

FORTRAN DESCRIPTION

 integer function cxCoordRead( fd )
 integer function cxDataRead( fd )
 integer function cxLatticeRead( fd )
fd
The fd argument is the file descriptor from which to read data. In C, fd is of type FILE*. In Fortran, its type is integer.

TYPE WRITING ROUTINES

Routines in this group use the IRIS Explorer transcription mechanism to write an ASCII or binary IRIS Explorer data structure to a file descriptor. The name of the type is used to construct the name of the routine, which has the two parts type and Write. The IRIS Explorer ASCII transcription format is not documented (to preserve the option of change at a future date), but is a straightforward ASCII presentation of the input structure; a careful comparison of such an output file with the input dataset will elucidate the format.

C DESCRIPTION

 void cxCoordWrite( FILE *fd, int mode, cxCoord *src );
 void cxDataWrite( FILE *fd, int mode, cxData *src );
 void cxLatticeWrite( FILE *fd, int mode, cxLattice *src );

FORTRAN DESCRIPTION

 subroutine cxCoordWrite( fd, mode, src )
 subroutine cxDataWrite( fd, mode, src )
 subroutine cxLatticeWrite( fd, mode, src )
fd
The fd argument is the file descriptor to which to write data. In C, fd is of type FILE*. In Fortran, its type is integer.
mode
The integer mode argument determines whether the output file is transcribed in ASCII (mode == 0) or binary (mode != 0) IRIS Explorer format.

DEFINITION OF cxLattice

This is the cxLattice data structure definition as specified in the file cxLattice.t.
#include 	<cx/Typedefs.t>
shared root typedef struct {
    long		nDim	    "Num Dimensions";
    long		dims[nDim]  "Dimensions Array";
    cxData(nDim, dims)	data	    "Data Structure";
    cxCoord(nDim, dims) coord	    "Coord Structure";
} cxLattice;
shared typedef struct {		
    long            nDim		"C nDim";
    long            dims[nDim]		"C Dims";
    cxCoordType     coordType		"Coord Type";
    switch          (coordType) {
	case            cx_coord_uniform:
	    float           bBox[2, nDim]		"Coordinates Array";
	case            cx_coord_perimeter:
	    long            sumCoord			"Perim Coord Array Length";
	    float           perimCoord[sumCoord]	"Coordinates Array";
	case            cx_coord_curvilinear:
	    long            nCoordVar			"Num Coord Dimensions";
	    float           values[nCoordVar, dims]	"Coordinates Array";
    }               c;
} cxCoord(nDim, dims);
shared typedef struct {		
    long            nDim		"D nDim";
    long            dims[nDim]		"D Dims";
    long            nDataVar	    "Num Data Variables";
    cxPrimType      primType	    "Primitive Data Type";
    switch          (primType) {
	case cx_prim_byte:
	    char            values[nDataVar, dims]  "Data Array";
	case cx_prim_short:
	    short           values[nDataVar, dims]  "Data Array";
	case cx_prim_int:
	    int             values[nDataVar, dims]  "Data Array";
	case cx_prim_long:
	    long            values[nDataVar, dims]  "Data Array";
	case cx_prim_float:
	    float           values[nDataVar, dims]  "Data Array";
	case cx_prim_double:
	    double          values[nDataVar, dims]  "Data Array";
    } d;
} cxData(nDim, dims);
typedef enum {
    cx_coord_uniform,
    cx_coord_perimeter,
    cx_coord_curvilinear
} cxCoordType;

SEE ALSO

cxDataRefInc(3E), cxDataRefDec(3E), cxDataMalloc(3E), cxDataObjNew(3E), cxmkmf(1E).
Last modified: May 27 11:57 1999
[ Documentation Home ]
© The Numerical Algorithms Group Ltd, Oxford UK. 1999