Although the state of an NDF component is strictly an attribute of each individual component, it is nevertheless convenient to discuss it here because all components behave similarly in this respect, and the descriptions of component access which follow depend on understanding it.
A component's state is a logical value which indicates whether or not that
component has a value or is available for use.
If a component's state is .TRUE., then the component is said to be
defined or in a defined state, whereas if its state is
.FALSE., it is
undefined or in an undefined state.
The state of any NDF component can be determined from its identifier by
specifying the component name in a call to the routine NDF_STATE.
For example:
LOGICAL STATE
...
CALL NDF_STATE( INDF, 'Variance', STATE, STATUS )
will return a .TRUE. value if the NDF's variance component is defined, i.e. if there are variance values available in the NDF which could be read into an application and used if required. An attempt to read values from an undefined component can result in an error, although the NDF_ system may take other appropriate action in some circumstances, depending on the component.
In common with most NDF_ routines which take a component name as an input argument, a list of components may also be supplied to NDF_STATE, for example:
CALL NDF_STATE( INDF, 'Dat,Var,Lab', STATE, STATUS )
In this case, the routine will return the logical ``AND'' of the values which would have been obtained for each component alone, so in this example a .TRUE. value will be returned via the STATE argument only if all three of the data, variance and label components are available.