Node Management Routines

cgio_get_node_id

C Signature:
int cgio_get_node_id(int cgio_num, double pid, const char *pathname, double *id)
Fortran Signature:
subroutine  cgio_get_node_id_f(cgio_num, pid, pathname, id, ier)
Parameters:

cgio_num

IN: Database identifier.

pid

IN: Parent node identifier.

pathname

IN: Absolute or relative path name for a node.

id

OUT: Node identifier.

Returns:

ier - Error status

Modes:

r w m

Description:

Gets the node identifier for the node specified by pathname in the database given by cgio_num. if pathname starts with '/', then it is taken as an absolute path and is located based on the root id of the database, otherwise it is taken to be a relative path from the parent node identified by pid. The function returns 0 and the node identifier in id on success, else an error code.

cgio_get_name

C Signature:
int cgio_get_name(int cgio_num, double id, char *name)
Fortran Signature:
subroutine  cgio_get_name_f(cgio_num, id, name, ier)
Parameters:

cgio_num

IN: Database identifier.

id

IN: Node identifier.

name

OUT: Node name (max length 32).

Returns:

ier - Error status

Modes:

r w m

Description:

Gets the name of the node identified by id in the database given by cgio_num. The name is returned in name, and has a maximum length of CGIO_MAX_NAME_LENGTH (32). In C, name should be dimensioned at least 33 to allow for the terminating '0'. The function returns 0 for success, else an error code.

cgio_set_name

C Signature:
int cgio_set_name(int cgio_num, double pid, double id, const char *name)
Fortran Signature:
subroutine  cgio_set_name_f(cgio_num, pid, id, name, ier)
Parameters:

cgio_num

IN: Database identifier.

pid

IN: Parent node identifier.

id

IN: Node identifier.

name

IN: Node name (max length 32).

Returns:

ier - Error status

Modes:

- w m

Description:

Sets (renames) the node identified by id in the database given by cgio_num to name. The parent node identifier is given by pid. There must not already exist a child node of pid with that name. The function return 0 on success, else an error code.

cgio_get_label

C Signature:
int cgio_get_label(int cgio_num, double id, char *label)
Fortran Signature:
subroutine  cgio_get_label_f(cgio_num, id, label, ier)
Parameters:

cgio_num

IN: Database identifier.

id

IN: Node identifier.

label

OUT: Node label (max length 32).

Returns:

ier - Error status

Modes:

r w m

Description:

Gets the label of the node identified by id in the database given by cgio_num. The label is returned in label, and has a maximum length of CGIO_MAX_LABEL_LENGTH (32). In C, label should be dimensioned at least 33 to allow for the terminating ‘0’. The function returns 0 for success, else an error code.

cgio_set_label

C Signature:
int cgio_set_label(int cgio_num, double id, const char *label)
Fortran Signature:
subroutine  cgio_set_label_f(cgio_num, id, label, ier)
Parameters:

cgio_num

IN: Database identifier.

id

IN: Node identifier.

label

IN: Node label (max length 32).

Returns:

ier - Error status

Modes:

- w m

Description:

Sets the label of the node identified by id in the database given by cgio_num to label. The function return 0 on success, else an error code.

cgio_get_data_type

C Signature:
int cgio_get_data_type(int cgio_num, double id, char *data_type)
Fortran Signature:
subroutine  cgio_get_data_type_f(cgio_num, id, data_type, ier)
Parameters:

cgio_num

IN: Database identifier.

id

IN: Node identifier.

data_type

OUT: Type of data contained in the node. One of “MT”, “I4”, “I8”, “U4”, “U8”, “R4”, “R8, “C1”, or “B1”.

Returns:

ier - Error status

Modes:

r w m

Description:

Gets the data type of the data associated with the node identified by id in the database given by cgio_num. The data type is returned in data_type, and has a maximum length of CGIO_MAX_DATATYPE_LENGTH (2). In C, data_type should be dimensioned at least 3 to allow for the terminating '0'. The function returns 0 for success, else an error code.

cgio_get_dimensions

C Signature:
int cgio_get_dimensions(int cgio_num, double id, int *ndims, cgsize_t *dims)
Fortran Signature:
subroutine  cgio_get_dimensions_f(cgio_num, id, ndims, dims, ier)
Parameters:

cgio_num

IN: Database identifier.

id

IN: Node identifier.

ndims

OUT: Number of dimensions for the data (max 12).

dims

OUT: Data dimension values (ndims values).

Returns:

ier - Error status

Modes:

r w m

Description:

Gets the dimensions of the data associated with the node identified by id in the database given by cgio_num. The number of dimensions is returned in ndims and the dimension values in dims. Since the maximum number of dimensions is CGIO_MAX_DIMENSIONS (12), dims should be dimensioned 12, unless the actual number of dimensions is already known. The function returns 0 for success, else an error code.

cgio_set_dimensions

C Signature:
int cgio_set_dimensions(int cgio_num, double id, const char *data_type, int ndims, const cgsize_t *dims)
Fortran Signature:
subroutine  cgio_set_dimensions_f(cgio_num, id, data_type, ndims, dims, ier)
Parameters:

cgio_num

IN: Database identifier.

id

IN: Node identifier.

data_type

IN: Type of data contained in the node. One of “MT”, “I4”, “I8”, “U4”, “U8”, “R4”, “R8, “C1”, or “B1”.

ndims

IN: Number of dimensions for the data (max 12).

dims

IN: Data dimension values (ndims values).

Returns:

ier - Error status

Modes:

- w m

Description:

Sets the data type and dimensions for data associated with the node identified by id in the database given by cgio_num. The data type (data_type) as one of:

“MT”

An empty node containing no data

“I4”

32-bit integer (int or integer*4)

“I8”

64-bit integer (cglong_t or integer*8)

“U4”

32-bit unsigned integer (unsigned int or integer*4)

“U8”

64-bit unsigned integer (cgulong_t or integer*8)

“R4”

32-bit real (float or real*4)

“R8”

64-bit real (double or real*8)

“X4”

64-bit complex (complex or complex*8)

“X8”

128-bit complex (complex double or complex*16)

“C1”

character (char or character)

“B1”

unsigned bytes (unsigned char or character*1)

The number of dimensions is given by ndims (maximum is 12), and the dimension values by dims. Note that any existing data for the node will be destroyed. To add the data to the node, use one of the data writing routines. The function returns 0 for success, else an error code.