Data Structure Management Routines#
cgio_create_node#
- C Signature:
-
int cgio_create_node(int cgio_num, double pid, const char *name, double *id)#
-
int cgio_create_node(int cgio_num, double pid, const char *name, double *id)#
- Fortran Signature:
- subroutine cgio_create_node_f(cgio_num, double pid, name, id, ier)#
- Parameters:
cgio_num
IN: Database identifier.
pid
IN: Parent node identifier.
name
IN: Node name (max length 32).
id
OUT: Node identifier.
- Returns:
ier
- Error status- Modes:
- w m
- Description:
Creates a new empty node in the database given by
cgio_num
as a child of the node identified bypid
. The name of the new node is given byname
, and must not already exist as a child of the parent node. The node will contain no label, dimensions, or data. Use the Node Management Routines to change the properties of the node, and the Data I/O Routines to add data. Returns 0 and the identifier of the new node inid
on success, else an error code.
cgio_new_node#
- C Signature:
-
int cgio_new_node(int cgio_num, double pid, const char *name, const char *label, const char *data_type, int ndims, const cgsize_t *dims, const void *data, double *id)#
-
int cgio_new_node(int cgio_num, double pid, const char *name, const char *label, const char *data_type, int ndims, const cgsize_t *dims, const void *data, double *id)#
- Fortran Signature:
- subroutine cgio_new_node_f(cgio_num, pid, name, label, data_type, ndims, dims, data, id, ier)#
- Parameters:
cgio_num
IN: Database identifier.
pid
IN: Parent node identifier.
name
IN: Node name (max length 32).
label
IN: Node label (max length 32).
data_type
IN: Type of data contained in the node. Options are:MT - emptyC1 - character dataI4 - 32-bit integerI8 - 64-bit integerU4 - unsigned 32-bit integerU8 - unsigned 64-bit integerR4 - 32-bit realR8 - 64-bit realX4 - 64-bit complexX8 - 128-bit complexB1 - byte datandims
IN: Number of dimensions for the data (max 12).
dims
IN: Data dimension values (
ndims
values).data
IN: Data array to be stored with the node.
id
OUT: Node identifier.
- Returns:
ier
- Error status- Modes:
- w m
- Description:
Creates a new node in the database given by
cgio_num
as a child of the node identified bypid
. The name of the new node is given byname
, and must not already exist as a child of the parent node. The node label is given bylabel
, the type of data bydata_type
, the dimensions of the data byndims
anddims
, and the data to write to the node bydata
. This is equivalent to calling the routines:cgio_create_node()
cgio_set_label()
cgio_set_dimensions()
cgio_write_all_data()
Returns 0 and the identifier of the new node in
id
on success, else an error code.
cgio_delete_node#
- C Signature:
-
int cgio_delete_node(int cgio_num, double pid, double id)#
-
int cgio_delete_node(int cgio_num, double pid, double id)#
- Fortran Signature:
- subroutine cgio_delete_node_f(cgio_num, pid, id, ier)#
- Parameters:
cgio_num
IN: Database identifier.
pid
IN: Parent node identifier.
id
IN: Node identifier.
- Returns:
ier
- Error status- Modes:
- w m
- Description:
Deletes the node identified by
id
below the parent node identified bypid
in the database given bycgio_num
. All children of the deleted node will also be deleted unless a link is encountered. The link node will be deleted but nothing below it. Returns 0 on success, else an error code.
cgio_move_node#
- C Signature:
-
int cgio_move_node(int cgio_num, double pid, double id, double new_pid)#
-
int cgio_move_node(int cgio_num, double pid, double id, double new_pid)#
- Fortran Signature:
- subroutine cgio_move_node_f(cgio_num, pid, id, new_pid, ier)#
- Parameters:
cgio_num
IN: Database identifier.
pid
IN: Parent node identifier.
id
IN: Node identifier.
new_pid
IN: New parent node identifier under which the node is to be moved.
- Returns:
ier
- Error status- Modes:
- w m
- Description:
Moves the node identified by
id
below the parent node identified bypid
to below the new parent node identified bynew_pid
in the database given bycgio_num
. A node by the same name as that that for id must not already exist undernew_pid
. A node may only be moved if it and the parent nodes all reside in the same physical database. Returns 0 on success, else an error code.
cgio_number_children#
- C Signature:
-
int cgio_number_children(int cgio_num, double id, int *num_child)#
-
int cgio_number_children(int cgio_num, double id, int *num_child)#
- Fortran Signature:
- subroutine cgio_number_children_f(cgio_num, id, num_child, ier)#
- Parameters:
cgio_num
IN: Database identifier.
id
IN: Node identifier.
num_child
OUT: Number of children of the specified node.
- Returns:
ier
- Error status- Modes:
r w m
- Description:
Gets the number of children of the node identified by
id
in the database given bycgio_num
, Returns 0 and the number of children innum_child
on success, else an error code.
cgio_children_names#
- C Signature:
-
int cgio_children_names(int cgio_num, double id, int start, int max_ret, int name_len, int *num_ret, char *child_names)#
-
int cgio_children_names(int cgio_num, double id, int start, int max_ret, int name_len, int *num_ret, char *child_names)#
- Fortran Signature:
- subroutine cgio_children_names_f(cgio_num, id, start, max_ret, name_len, num_ret, child_names, ier)#
- Parameters:
cgio_num
IN: Database identifier.
id
IN: Node identifier.
start
IN: Starting index for returned child names or ids (1 <=
start
<=num_child
).max_ret
IN: Maximum child names or ids to be returned (1 <=
max_ret
<=num_child-start+1
).name_len
IN: Length reserved for each returned child name.
num_ret
OUT: Number of returned values of child names or identifiers.
child_names
OUT: Child node names (
num_ret
values). This array should be dimensioned at least (name_len * max_ret
).- Returns:
ier
- Error status- Modes:
r w m
- Description:
Gets the names of the children of the node identified by
id
in the database given bycgio_num
. The starting index for the array of names is given bystart
, and the maximum number of names to return bymax_ret
. Bothstart
andmax_ret
should be between 1 andnum_child
, inclusively. The size reserved for each name inchild_names
is given byname_len
. The arraychild_names
should be dimensioned at least (name_len * max_ret
). Since node names are limited to a length ofCGIO_MAX_NAME_LENGHT
(32),name_len
should be at least 32 to ensure the returned names are not truncated. In C, an additional byte should be added toname_len
allow for the terminating'0'
for each name. If successful, the function returns 0; the actual number of returned names is given bynum_ret
, and the array of names inchild_names
. In C, the names are ‘0’-terminated within each name field. In Fortran, any unused space is padded with blanks (space character).
cgio_children_ids#
- C Signature:
-
int cgio_children_ids(int cgio_num, double id, int start, int max_ret, int *num_ret, char *child_ids)#
-
int cgio_children_ids(int cgio_num, double id, int start, int max_ret, int *num_ret, char *child_ids)#
- Fortran Signature:
- subroutine cgio_children_ids_f(cgio_num, id, start, max_ret, num_ret, child_ids, ier)#
- Parameters:
cgio_num
IN: Database identifier.
id
IN: Node identifier.
start
IN: Starting index for returned child names or ids (1 <=
start
<=num_child
).max_ret
IN: Maximum child names or ids to be returned (1 <=
max_ret
<=num_child-start+1
).num_ret
OUT: Number of returned values of child names or identifiers.
child_ids
OUT: Child node identifiers (
num_ret
values). This array should be dimensioned at least (max_ret
).- Returns:
ier
- Error status- Modes:
r w m
- Description:
Gets the node identifiers of the children of the node identified by
id
in the database given bycgio_num
. The starting index for the array of ids is given bystart
, and the maximum ids to return bymax_ret
. Bothstart
andmax_ret
should be between 1 andnum_child
, inclusively. The arraychild_ids
should be dimensioned at least (max_ret
). If successful, the function returns 0; the actual number of returned ids is given bynum_ret
, and the array of identifiers inchild_ids
.