      Subroutine INPLOT
c
c ***********************************************************************
c *                                                                     *
c *         Subroutine INPLOT - To read the current plot presentation   *
c *         from a file.                                                *
c *                                                                     *
c *          Programmed by Steven C. Fisher, DTNSRDC Code 1522          *
c *                                                                     *
c ***********************************************************************
c
      Dimension Xmin(2),Ymin(2),Xmax(2),Ymax(2),Xinc(2),Yinc(2)
      Integer Xnumbr,Ynumbr,Axchst,Axtypx,Axtypy,Axcolr,Ticdir
      Byte Xaxis(2,80),Yaxis(2,80)
c
      Integer Grdcmj,Grdcmr,Spchar,Atxclr,Xtop
      Integer*4 Lib$Get_Symbol,Status,Level,Len
      Character File_Name*50,Symb*10,Proc_Pid*20
c
      Common/Labls/Nlab,Lachst,Lacolr,Nleg,Lechst,Lecolr,Legtit,Labcrd,
     $ Iprtot
      Common/Axis/Xmin,Xmax,Ymin,Ymax,Xinc,Yinc,Xlen,Ylen,Xnumbr,
     $ Ynumbr,Xaxis,Yaxis,Axthik,Axchst,Axtypx,Axtypy,Axcolr,Textsz,
     $ Ticdir,Atxclr
      Common/Grid/Xgrdmj,Xgrdmr,Ygrdmj,Ygrdmr,Thikmj,Thikmr,Grdcmj,
     $Grdcmr
      Common/Ptype/Idev,Xtop,Spchar,Chscal,Chsc1
      Common/Center/Xpmin,Xpmax,Ypmin,Ypmax,Xorg,Yorg,Xplotl,Yplotl
      Common/Pscale/Delx,Dely,Space
      Common/Textbl/Ntxbl
      Common/Pltfil/Iterm,File_Name
      Common/Graphp/Xr0,Yr0,Xr90,Yr90
c
100   Format(80A1)
c
c         Get the number of the process for the input & output file
c
      Symb   = 'Procpid'
      Status = Lib$Get_Symbol(Symb,Proc_Pid,Len,Level)
      If (.NOT. Status) Call Lib$Signal(%Val(Status))
      File_Name = 'Plotfl.'//Proc_Pid
c
      Open(Unit=12,NAME=File_Name,TYPE='OLD',Dispose='DELETE',ERR=98)
c
c         Read the plot device
c
      Read(12,*) Idev
c
      File_Name = 'Plt.'//Proc_Pid
c
c         Read axes, label, legend, and grid data
c
      Read(12,*,END=99,ERR=99)  Xlen,Ylen,Textsz,Axchst,Axthik,Spchar
      Read(12,*,END=99,ERR=99) Xpmin,Xpmax,Ypmin,Ypmax
c
      If (Textsz .EQ. 1.0) Textsz = 1.7
      If (Textsz .EQ. 2.0) Textsz = 2.3
c
      Read(12,*,END=99,ERR=99)  Xnumbr,Ynumbr,Axtypx,Axtypy,Ticdir,
     $                          Atxclr
      Read(12,*,END=99,ERR=99)  Xmin,Xmax,Xinc
      Read(12,*,END=99,ERR=99)  Ymin,Ymax,Yinc
      Read(12,*,END=99,ERR=99)  Xgrdmj,Xgrdmr,Ygrdmj,Ygrdmr
      Read(12,*,END=99,ERR=99)  Thikmj,Thikmr,Grdcmj,Grdcmr
      Read(12,*,END=99,ERR=99)  Xtop,Axcolr,Lecolr,Lacolr
      Read(12,*,END=99,ERR=99)  Delx,Dely,Space
c
c         Read the axis titles
c
      Read(12,150,END=99,ERR=99) (Xaxis(1,J),J=1,80)
      Read(12,150,END=99,ERR=99) (Xaxis(2,J),J=1,80)
      Read(12,150,END=99,ERR=99) (Yaxis(1,J),J=1,80)
      Read(12,150,END=99,ERR=99) (Yaxis(2,J),J=1,80)
150   Format(80A1)
      Read(12,*,END=99,ERR=99)  NLab,Lachst,Ntxbl,Nleg,Lechst,Legtit,
     $                        Labcrd,Iprtot
c
c                   If interactive plot modification,
c                   set the colors to black (or white)
c
      If (Idev .LE. 0) Then
         Axcolr = 1
         Lacolr = 1
         Lecolr = 1
         Grdcmj = 1
         Grdcmr = 1
         Atxclr = 1
      End If
c
      Return
c
c           Error returns
c
98    Continue
      Write(6,400)
400   Format(' WARNING - Error encountered in opening file - ',
     $         'routine aborted')
      Call Exit
99    Continue
c
      Write(6,500)
500   Format(' WARNING - Error encountered in reading data - ',
     $ 'routine aborted')
      Call Exit
      Return
c
      End
      Subroutine Cparam(Ncurve,Npt,Color,Crvfit,Cvsymb,Cvline,
     $           Xcvaxi,Ycvaxi,Symbsz,Cvthik)
c
c ***********************************************************************
c *                                                                     *
c *       Subroutine Cparam - To read the parameters for the curves to  *
c *       plot, such as curve fit and line type.                        *
c *                                                                     *
c *          Programmed by Steven C. Fisher, DTNSRDC Code 1522          *
c *                                                                     *
c ************************************************************************
c
      Dimension Color(20),Crvfit(20),Cvsymb(20),Cvline(20),Xcvaxi(20),
     $          Ycvaxi(20),Npt(20)
      Integer Color,Crvfit,Cvsymb,Cvline,Xcvaxi,Ycvaxi
      Integer Spchar,Xtop
c
      Common/Ptype/Idev,Xtop,Spchar,Chscal,Chsc1
c
      Read(12,*,END=99,ERR=99) Ncurve,Cvthik,Symbsz,Iz
c
      Symbsz = Chscal * Symbsz * 0.1
c
      Do 10 I=1,Ncurve
         Read(12,*,END=99,ERR=99) Npt(I),Cvline(I),
     $           Cvsymb(I),Crvfit(I),Color(I),Xcvaxi(I),Ycvaxi(I),
     $           Nx,Ny,Iz
 10   Continue
c
      Return
c
99    Continue
      Write(6,100)
100   Format(' WARNING - Error encountered in reading data - ',
     $ 'routine aborted')
c
      Return
      End
      Subroutine INCRV(X,Y,N)
c
c ***********************************************************************
c *                                                                     *
c *       Subroutine INCRV - To input the curve data to plot            *
c *                                                                     *
c *      Programmed by Steven C. Fisher, DTNSRDC Code 1522              *
c *                                                                     *
c ***********************************************************************
c
      Dimension X(1),Y(1)
c
         Read(12,*,END=99,ERR=99) (X(J),J=1,N)
         Read(12,*,END=99,ERR=99) (Y(J),J=1,N)
c
      Return
99    Continue
      Write(6,300)
300   Format(' ERROR encountered in reading the data')
      Return
      End
