Synopsis
create/get/set a double precision real subobject to an object
int FLDadd_real (
OMobj_id field,
const char *name);
int FLDset_real (
OMobj_id field;
const char *name,
double val);
int FLDget_real (
OMobj_id,
const char *name,
double *val);
Description
These routines add a single, new double precision real subobject to an existing field data schema object, and then set/get its value. They could also be used when you want to construct and reference an entirely new data object and add single double subobjects to it, but you want to do this within the code of a function, rather than using V.
Note: If you are accessing an existing, defined subobject, use the specific routine for that subobject (for example, FLDget_coord_extent). Use FLDadd/set/get_real only when you have created your own, unique, named subobject, or when no FLD routine exists for a pre-defined subobject.
FLDadd_real adds a single real subobject to the object specified by OMobj_id field. The object is named in the Object Manager by the string name. The new subobject is flagged as "not set."
FLDset_real sets the real object within field, named name, to val.
FLDget_real returns the value of the real subobject name within field in val.
Parameters
OMobj_id field
The OMobj_id of an object. This can be any object, not just a "Field".
const char *name
In FLDadd_real, name is an input argument specifying the name for the new real double-precision subobject.
In FLDset_real and FLDget_real, it is an input string argument that specifies which subobject of field to get/set.
double val
double *val
In FLDset_real, val is an input argument that sets the value of the real subobject. In FLDget_real, val is a pointer to a double-precision real in which the value of the subobject is returned.
Example
This section of code adds a new double-precision real subobject named timestep to an output field. It then sets timestep's value, and later gets it:
...
int FUNCmy_func (in, out, param);
OMobj_id in, out, param;
{
...
double timeval;
double new_timeval;
...
timeval =.0025;
if (FLDadd_real(out, "timestep")!= 1) {
ERR_RETURN("Could not create timeval");
}
if (FLDset_real (out, "timestep", timeval)!= OM_STAT_SUCCESS) {
ERR_RETURN("Could not set timeval");
{
...
if (FLDget_real(out,"timestep",&new_timeval)!= OM_STAT_SUCCESS)
{
ERR_RETURN("Could not get new_timeval");
}
...
} /*end FUNCmy_func */
Related routines