next up previous
Next: Referring to Subsets and Super-sets
Up: NDF SECTIONS
Previous: Creating NDF Sections

The Distinction between Base NDFs and Sections  

An NDF identifier which refers to an entire NDF dataset (not just a section of it) is said to refer to a base NDF. A base NDF represents a data structure whose shape and other attributes are uniquely defined. Any changes made to the attributes of a base NDF are reflected by actual changes to the contents of the data file in which the NDF is stored. Any such changes are also immediately apparent through any other base NDF identifiers which refer to the same structure (multiple identifiers for the same structure can be generated by means of the routine NDF_CLONE for instance).

In contrast, an NDF section simply represents a ``window'' into a base NDF. Any number of identifiers may refer to sections derived from the same base NDF, but each represents a separate window. As a consequence, the shapes of all NDF sections are completely independent and may be altered, if required, without affecting each other. One consequence of this is that the NDF_CLONE routine, when applied to an NDF section, has the effect of producing a duplicate NDF section rather than simply a duplicate NDF identifier.

It is possible to discover if an identifier refers to a base NDF or to an NDF section using the routine NDF_ISBAS. For instance:

      CALL NDF_ISBAS( INDF, ISBAS, STATUS )

will return a logical value of .TRUE. via the ISBAS argument if the identifier INDF refers to a base NDF. It is also possible to obtain an identifier for the base NDF to which an NDF section refers by using the routine NDF_BASE, thus:

      CALL NDF_BASE( INDF1, INDF2, STATUS )

However, this routine should be used sparingly because it tends to subvert the program modularity which the use of NDF sections allows, and permits access to regions of the base NDF which a well-structured application perhaps ought not to be touching.



next up previous
Next: Referring to Subsets and Super-sets
Up: NDF SECTIONS
Previous: Creating NDF Sections


Starlink User Note 33
R.F. Warren-Smith
11th January 2000
E-mail:rfws@star.rl.ac.uk

Copyright © 2000 Council for the Central Laboratory of the Research Councils