10 SUBSETS OF OBJECTS

The routine DAT_CELL accesses a single element of an array (an example was shown in §5). The routine DAT_SLICE accesses a subset of an arbitrarily dimensioned object. This subset can then be treated for most purposes as if it were an object in its own right. For example:

        ...
        CHARACTER * ( DAT__SZLOC ) SLICE
        INTEGER LOWER( 2 ), UPPER( 2 )
        DATA LOWER / 100, 100 /
        DATA UPPER / 200, 200 /
  
  *  Get a locator to the subset DATA_ARRAY(100:200,100:200).
        CALL DAT_FIND( NLOC, ’DATA_ARRAY’, LOC, STATUS )
        CALL DAT_SLICE( LOC, 2, LOWER, UPPER, SLICE, STATUS )
  
  *  Map the subset as a vector.
        CALL DAT_MAPV( SLICE, ’_REAL’, ’UPDATE’, PNTR, EL, STATUS )
        ...

In contrast to DAT_SLICE, DAT_ALTER makes a permanent change to a non-scalar object. The object can be made larger or smaller, but only the last dimension can be ALTERed. This function is entirely dynamic, i.e. can be done at any time provided that the object is not mapped for access. Note that DAT_ALTER works on both primitives and structures. It is important to realise that the number of dimensions cannot be changed by DAT_ALTER.