Node Management Routines#
cgio_get_node_id#
- C Signature:
-
int cgio_get_node_id(int cgio_num, double pid, const char *pathname, double *id)#
-
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_numIN: Database identifier.
pidIN: Parent node identifier.
pathnameIN: Absolute or relative path name for a node.
idOUT: Node identifier.
- Returns:
ier- Error status- Modes:
r w m
- Description:
Gets the node identifier for the node specified by
pathnamein the database given bycgio_num. ifpathnamestarts 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 bypid. The function returns 0 and the node identifier inidon success, else an error code.
cgio_get_name#
- C Signature:
-
int cgio_get_name(int cgio_num, double id, char *name)#
-
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_numIN: Database identifier.
idIN: Node identifier.
nameOUT: Node name (max length 32).
- Returns:
ier- Error status- Modes:
r w m
- Description:
Gets the name of the node identified by
idin the database given bycgio_num. The name is returned inname, and has a maximum length ofCGIO_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)#
-
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_numIN: Database identifier.
pidIN: Parent node identifier.
idIN: Node identifier.
nameIN: Node name (max length 32).
- Returns:
ier- Error status- Modes:
- w m
- Description:
Sets (renames) the node identified by
idin the database given bycgio_numtoname. The parent node identifier is given bypid. There must not already exist a child node ofpidwith 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)#
-
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_numIN: Database identifier.
idIN: Node identifier.
labelOUT: 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)#
-
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_numIN: Database identifier.
idIN: Node identifier.
labelIN: Node label (max length 32).
- Returns:
ier- Error status- Modes:
- w m
- Description:
Sets the label of the node identified by
idin the database given bycgio_numto 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)#
-
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_numIN: Database identifier.
idIN: Node identifier.
data_typeOUT: 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
idin the database given bycgio_num. The data type is returned indata_type, and has a maximum length ofCGIO_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)#
-
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_numIN: Database identifier.
idIN: Node identifier.
ndimsOUT: Number of dimensions for the data (max 12).
dimsOUT: 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
idin the database given bycgio_num. The number of dimensions is returned inndimsand the dimension values indims. Since the maximum number of dimensions isCGIO_MAX_DIMENSIONS(12),dimsshould 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)#
-
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_numIN: Database identifier.
idIN: Node identifier.
data_typeIN: Type of data contained in the node. One of “MT”, “I4”, “I8”, “U4”, “U8”, “R4”, “R8, “C1”, or “B1”.
ndimsIN: Number of dimensions for the data (max 12).
dimsIN: 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
idin the database given bycgio_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 bydims. 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.