The QDP program


Next: The DEMO program Up: Fortran interface Previous: Subroutine PLT

The QDP program

The complete source code for the QDP program is:

C Program QDP, the Quick and Dandy Plotter.
C Reads and plots a QDP file.
C---
C [AFT]
C---
      INTEGER   MXPTS, MXVEC, MXCMD
      PARAMETER (MXPTS=131072)
      PARAMETER (MXVEC=64)
      PARAMETER (MXCMD=50)
C
      CHARACTER CMD(MXCMD)*100
      CHARACTER CNAM*72
      REAL      Y(MXPTS)
      INTEGER   IERY(MXVEC)
      INTEGER   ICHAT, IER, LUN, NCMD, NPTS, NROW, NVEC
C---
  100 CNAM=' '
      ICHAT=0
      LUN=0
      CALL RDQDP(ICHAT, LUN, CNAM, Y, MXPTS, IERY, MXVEC,
     :   NROW, NPTS, NVEC, CMD, MXCMD, NCMD, IER)
      IF(IER.NE.0) GOTO 900
      CALL PLT(Y,IERY,NROW,NPTS,NVEC,CMD,NCMD,IER)
      IF(IER.LT.0) GOTO 100
C---
  900 CONTINUE
      END

The QDP program calls the RDQDP subroutine to read the QDP file, and then passes the data read to PLT. The parameter statements show that this version can read a file containing up to 131,072 numbers, up to 64 different vectors, and up to 50 PLT command lines. RDQDP sets creates array dimensions to make maximum use of the data array. For example, if you read a file containing two columns, then you could read up to 65536 rows of data. If the file contains 64 vectors and none of the vectors contains errors i.e., there are 64 columns of numbers, then the maximum number of rows will be 2048. If, however, all 64 vectors contain two-sided errors, then only 512 rows can be read. Each PLT command line can be at most 100 characters long.

QDP sets both CNAM=' ' and LUN=0 to force RDQDP to prompt for a QDP file name. If the file is opened, then RDQDP proceeds to read the file, and initializes all the variables needed by the PLT routine. If RDQDP has set IER=0 then some data has been read and hence the PLT routine is called.

PLT interprets the PLT commands and plots the data. If the user enters an end-of-file character at the PLT> prompt, PLT exits with IER=-1. This causes the QDP program to loop back and call RDQDP again. For a normal exits, IER=0, the QDP program quietly exits.



Web Page Maintained by: Dr. Lawrence E. Brown elwin@redshift.gsfc.nasa.gov