      Program PLTPRG
c
c ************************************************************************
c *                                                                      *
c *      PROGRAM PLTPRG - To plot data on terminals , plotters, and      *
c *      printers.  This program                                         *
c *      actually does not do the plotting; this is done by PLOTFL       *
c *      because the Multiware subroutines used to plot take up too      *
c *      much memory to fit in this program.  PLTPRG is used to input    *
c *      data, set up the plot presentation, analyze data (interpol-     *
c *      ation, integration, differentiation, scaling data, etc),        *
c *      and write out the data in tabular form.  To plot data, PLTPRG   *
c *      saves all of its current values on disk, then calls PLOTFL.     *
c *      This is transparent to the user.  After the plotting is         *
c *      completed, PLOTFL calls PLTPRG, and the data is automatically   *
c *      reloaded into the program.                                      *
c *                                                                      *
c *      THIS PROGRAM CAN ONLY BE RUN ON DEC COMPATABLE TERMINALS        *
c *      THAT SUPPORT THE VT100 and/or VT200 command set.                *
c *                                                                      *
c *         Programmed by Steven C. Fisher, DTNSRDC Code 1522            *
c *                                                                      *
c ************************************************************************
c
      Include 'Cflags'
c
      Call Main
c
      End
      Subroutine Main
c
c ***********************************************************************
c *                                                                     *
c *         Subroutine MAIN - This subroutine reads in the PLTPRG       *
c *         scratch files when the program starts, and calls the        *
c *         options that the user selects.  This separation from the    *
c *         "main" program was done so that an entry could be inserted  *
c *         into this subroutine so I could abort, and in the abort     *
c *         routine call into here.  By calling into here, I didn't     *
c *         to worry about the virtual array DATA not being an          *
c *         arguement into the abort subroutine.                        *
c *                                                                     *
c *             Programmed by Steven C. Fisher, DTNSRDC Code 1522       *
c *                                                                     *
c ***********************************************************************
c
c       Data Arrays
c
      Include 'Cmain'
c
      Virtual Data(25000)
      Integer Option
c
c  *****************************************************************
c          Data    - Array (Virtual!) containing the users data
c          Ncols   - Number of data columns stored in "DATA"
c          Npoint  - Number of points in each data "column".
c          Title   - The title of each of the data columns
c          Ttllen  - The length of each data title
c          X       - A scratch array to hold the X values currently being
c                    evaluated
c          Y       - A scratch array to hold the Y values currently being
c                    evaluated
c *****************************************************************
c
c       Plotting Information Arrays
c
      Include 'Cplot'
      Include 'Caxis'
      Include 'Clabls'
      Include 'Clegnd'
      Include 'Cgrid'
      Include 'Ctxblk'
      Include 'Cdefl'
c
c *****************************************************************
c         **************   Plot Label Data  **************
c        Just   - Array containing the justification of the label
c        Labcrd - Indicates the label coordinate system
c        Label  - Array containing the labels on the plot
c        Llabel - The length of each label on the plot
c        Nlab   - Number of labels
c        Xlabel - The X location of each label on the plot
c        Ylabel - The Y location of each label on the plot
c        Sizlab - Label size
c        Iprot  - Flag indicating if the label text protection is on
c
c         **************   Plot Axis Data  **************
c        Textsz - The axes text size
c        Xaxis  - The X axis label
c        Yaxis  - The Y axis label
c        Xmin   - Minimum X value for the plot
c        Ymin   - Minimum Y value for the plot
c        Xmax   - Maximum X value for the plot
c        Ymax   - Maximum Y value for the plot
c        Xinc   - Distance between the tick marks on the X axis
c        Yinc   - Distance between the tick marks on the Y axis
c        Xnumbr - Number of X axes to plot
c        Ynumbr - Number of Y axes to plot
c
c         **************   Plot Grid Data  **************
c        Grdcmj - Color of the major grid lines
c        Grdcmr - Color of the minor grid lines
c        Thikmj - Line thickness of the major grid
c        Thikmr - Line thickness of the minor grid
c        Xgrdmj - Major grid spacing in the X direction
c        Xgrdmr - Minor grid spacing in the X direction
c        Ygrdmj - Major grid spacing in the Y direction
c        Ygrdmr - Minor grid spacing in the Y direction
c
c         **************   Plot Label Data  **************
c        Color  - Color of each line
c        Crvfit - Fitting method used on each curve
c        Cvline - The line type for each curve
c        Cvsymb - The symbol plotted at each data point
c        Ncurve - Number of curves to plot
c        Symbsz - Size of the symbols on the plot (1.0 is default)
c        Xcurve - The data column used as the X component
c        Xcvaxi - The X axis corresponding to this curve
c        Ycurve - The data column used as the Y component
c        Ycvaxi - The Y axis corresponding to this curve
c
c         **************   Plot Legend Data  **************
c        Boxleg - Flag to determine whether to draw a box around the legend
c        Lableg - Character array containing the legend labels
c        Lleg   - Array containing the length of each legend label
c        Nleg   - Number of labels in the legend (including the title)
c        Lcolor - Array describing the symbol and line colors of Linleg & Symleg
c        Legend - Not used
c        Legtit - Scratch variable
c        Linleg - Array containing the line types to plot out in the legend
c        Locleg - Flag describing which corner of the legend Xleg and Yleg
c                 correspond to
c        Sizleg - Text size for the legend
c        Symleg - Array containing the symbol types to plot out in the legend
c        Xleg   - X location of the legend
c        Yleg   - Y location of the legend
c
c         **************   Plot Defaults Data  **************
c        Atxclr - Axes text color
c        Axchst - Axes character set number
c        Axcolr - Axes line color
c        Axthik - Axes line thickness
c        Axtypx - X axes type (normal or logrithmic)
c        Axtypy - Y axes type (normal or logrithmic)
c        Cvthik - Thickess of the curves
c        Lachst - Label character set number
c        Lacolr - Color of the labels
c        Lechst - Legend character set number
c        Lecolr - Color of the legend test
c        Gdtkmr - Not used
c        Gdtkmj - Not used
c        Spchar - Flag for using uniform or proportional letter spacing
c        Ticdir - Direction of the plot ticks - inward, outward, or none
c
c *****************************************************************
c
c            Table presentation arrays
c
      Include 'Ctable'
c
c ******************************************************************
c
c     ************************   Table Common Blocks ***********************
c        Icom    - Array flag to determine whether commas are to be used
c        Isci    - Array containing the scientific notation exponenent
c        Lpag    - Number of lines per page to print (not functional)
c        Ndeci   - Array containing number of decimal places to print columns to
c        Nspac   - Array containing the spaces between each column in the table
c        Ntab    - Number of columns in the table + 1
c        Round   - Array containing the value to round each column to
c        Tabcol  - Array containing the column numbers for each table column
c        Table   - Character array containing the table title and column titles
c        Tablen  - Length of each title segment
c        Tcolen  - Number of title segments in each table or column title
c
c   ***********************   Flags Common Block  **********************
c        Term_Type The type of terminal being used
c        Idflag  - Flag to indicate whether the current data in the program
c                   was changed since the last time a data scratch file was made
c        Ipflag  - Flag to indicate whether the current plot data in the program
c                   was changed since the last time a plot scratch file was made
c        Idflag  - Flag to indicate whether the current table data in the
c                   program was changed since the last time a table scratch file
c                   was made
c
c ***********************************************************************
c
      Include 'Cflags'
c
c *****************************************************************
c
c       Initialize data and read in the scratch files (if any)
c
      Call Init(Data)
c
c       ************   MAJOR PROGRAM LOOP STARTS HERE   *************
c
      Entry Contin
c
 10   Continue
c
c       Select the desired option
c
      Call Dcoder(Option)
      Go To (15,15,20,25,30,35,40,45,50,55,60,65,70,75,80,83,85,86,
     $     90,90,93,95,87,88,89,91,92,94,96,98,71,72,73,74,77)  Option
15       Call Menu
         Go To 10
20       Call Input(Data)
         Go To 10
25       Call Modify(Data)
         Go To 10
30       Call Redfil(Data)
         Go To 10
35       Call Wrtfil(Data)
         Go To 10
40       Call Makepl
         Go To 10
45       Call Plott(Data,0)
         Go To 10
50       Call Modplt
         Go To 10
55       Call Liscol
         Go To 10
60       Call Interp(Data)
         Go To 10
65       Call Inplot(Data)
         Go To 10
70       Call Savplt(Data,1)
         Go To 10
71       Call Wrtbin(Data)
         Go To 10
72       Call Pltprg_VMS
         Go To 10
73       Call Savplt(Data,0)
         Go To 10
74       Call Version
         Go To 10
75       Call Lisdat(Data)
         Go To 10
77       Call Plott(Data,1)
         Go To 10
80       Call Scadat(Data)
         Go To 10
83       Call Mathcv(Data)
         Go To 10
85       Call Delcol(Data)
         Go To 10
86       Call Quikpl(Data)
         Go To 10
87       Call Tabopt(Data)
         Go To 10
88       Call Getdir
         Go To 10
89       Call Viegph
         Go To 10
93       Call Convrt(Data)
         Go To 10
94       Call Mms(Data)
         Go To 10
95       Call Intder(Data)
         Go To 10
96       Call Lisrng('CURRENT',7,0,0)
         Go To 10
98       Call Usrpgm(Data)
         Go To 10
91       Call Comp(Data)
         Go To 10
92       Continue
         Call Mods(Data)
         Go To 10
90    Continue
c
c       End it here
c
      Call Stopit
      Go To 10
      Entry Aborta
      Call Endabt(Data)
      Stop
      End
