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);
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.
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 */