14 PACKAGED ROUTINES

HDS provides families of routines which provide a more convenient method of access to objects than the basic routines. For instance DAT_PUTnx and DAT_GETnx package DAT_PUT and DAT_GET by dimensionality and type. Thus DAT_PUT0I will write a single INTEGER value to a scalar primitive. DAT_GET1R will read the value of a vector primitive and store it in a REAL program array. There are no DAT_GET2x routines; all dimensionalities higher than one are handled by DAT_GETNx and DAT_PUTNx.

Another family of routines are the CMP_ routines. These access components of the “current level”. This usually involves:

The CMP_ routines package this sort of operation, replacing three or so subroutine calls with one. The naming scheme is based on the associated DAT_ routines. An example is shown below.

        ...
        CHARACTER * 80 DLAB
        INTEGER DIMS( 2 )
        REAL IMVALS( 512, 1024 )
        DATA DIMS / 512, 1024 /
  
  *  Get REAL values from the DATA_ARRAY component.
        CALL CMP_GETNR( NLOC, ’DATA_ARRAY’, 2, DIMS, IMVALS, DIMS, STATUS )
  
  *  Get a character string from the LABEL component and store it in DLAB.
        CALL CMP_GET0C( NLOC, ’LABEL’, DLAB, STATUS )
        ...