set all basic characteristics of a single Node_Data component in one call
int FLDset_node_data_comp (
OMobj_id field,
int comp,
int veclen,
const char *label,
const char *units);
FLDset_node_data_comp sets all the basic characteristics of a single Node_Data component in one call, except the actual data. You would use it to quickly establish the structure of an output Node_Data component.
This example, a fragment from modules/down.c, shows downsize first retrieving a description of its input field's Node_Data, then setting up each component of the output field accordingly.
int FUNCdownsize (in, stride, out)
OMobj_id in, out;
...
int ndim, *dims, npoints, fld_type, i, j, n, stat, comp, ncomp
null_flag, data_id;
int size, type, in_type, veclen, nspace, out_nspace;
...
char units[MAX_NAME_SIZE], label[MAX_NAME_SIZE];
...
if (FLDget_node_data_ncomp(in, &ncomp)!= 1) {
ERR_RETURN("Error getting ncomp");
}
if (FLDset_node_data_ncomp (out, ncomp)!= 1) {
ERR_RETURN("Error setting nnode_data");
}
for (comp=0; comp<ncomp; comp++) {
if (FLDget_node_data_units(in, comp, units, MAX_NAME_SIZE)!= 1) {
strcpy(units, "");
}
if (FLDget_node_data_label(in, comp, label, MAX_NAME_SIZE)!= 1) {
strcpy(label, "");
}
if (FLDget_node_data_veclen(in, comp, &veclen)!= 1) {
ERR_RETURN("Error getting veclen");
}
if (FLDset_node_data_comp (out, comp, veclen, label, units)!= 1)
ERR_RETURN("Error setting node component");
}