Next: The DEMO program Up: Fortran interface Previous: Subroutine PLT
The complete source code for the
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
PLT interprets the PLT commands and plots the data.
If the user enters an end-of-file character at the
Web Page Maintained by: Dr. Lawrence E. Brown firstname.lastname@example.org