This first example is trivial and simply serves to show the overall structure of an ADAM application which calls the NDF_ library. It outputs a message showing how many pixels there are in an NDF.
SUBROUTINE SHOW( STATUS ) *+ * Name: * SHOW * Purpose: * Show the size of an NDF. * Description: * This routine outputs a message showing how many pixels there are * in an NDF. * ADAM Parameters: * NDF = NDF (Read) * The NDF whose size is to be displayed. *- * Type Definitions: IMPLICIT NONE ! No implicit typing * Global Constants: INCLUDE 'SAE_PAR' ! Standard SAE constants * Status: INTEGER STATUS ! Global status * Local Variables: INTEGER INDF ! NDF identifier INTEGER NPIX ! Number of NDF pixels *. * Check inherited global status. IF ( STATUS .NE. SAI__OK ) RETURN * Obtain the input NDF and enquire its size. CALL NDF_ASSOC( 'NDF', 'READ', INDF, STATUS ) CALL NDF_SIZE( INDF, NPIX, STATUS ) * Display the size. CALL MSG_SETI( 'NPIX', NPIX ) CALL MSG_OUT( 'SHOW_SIZE', 'This NDF has ^NPIX pixels.', STATUS ) * Annul the NDF identifier. CALL NDF_ANNUL( INDF, STATUS ) END
The following is an example ADAM interface file (show.ifl) for the application above.
interface SHOW parameter NDF # NDF to be inspected position 1 prompt 'NDF data structure' endparameter endinterface