C IN ALLE PLOT4AUFRUFE WIRD DER PARAMETER TEXT VERWENDET

      SUBROUTINE GRAPH(RWORK,NRWORK,IWORK,NIWORK,KFLAG)
      REAL RWORK(NRWORK)
      INTEGER IWORK(NIWORK)
      REAL C(500)
      INTEGER ISUB(10),ICOL(10),ISIG(10)
      INTEGER TEXT(8)
      LOGICAL WARN
      LOGICAL LOGT,LOGY,LOGZ,BLN
      INTEGER ITIN,ITOUT,CIN,HDS,POUT,SIN,DOUT
      REAL CLOG0
      CHARACTER*4 CNAME,CHARIS
      REAL SPNAME,XAMI,XAMA,YAMI,YAMA
      INTEGER IFLAG
      COMMON / LUNIT / ITIN,ITOUT,CIN,HDS,POUT,SIN,DOUT
      COMMON /LOG0/ CLOG0
      COMMON / PLOPC / SPNAME(3,8),XAMI,XAMA,YAMI,YAMA,IFLAG(10)
      DATA NHELP/500/
      DATA CNAME/4H &NA/,IBLANK/1H /
      DATA N1/18/,N2/5/
      DATA XL/20.0/,YL/10.0/,NLINES/100/
      DATA ISUB/1,2,3,4,5,6,7,8,9,10/
      DATA ICOL/2,3,1,2,3,1,2,3,1,2/
      DATA ISIG(1)/1HA/,ISIG(2)/1HB/,ISIG(3)/1HC/,
     @     ISIG(4)/1HD/,ISIG(5)/1HE/,ISIG(6)/1HF/,
     @     ISIG(7)/1HG/,ISIG(8)/1HH/,ISIG(9)/1HI/,ISIG(10)/1HK/
      DATA YMIN/0./,YMAX/0./,ZMIN/0./,ZMAX/0./
      DATA TEXT(1)/1H /,TEXT(2)/1H /,TEXT(3)/1H /,TEXT(4)/1H /,
     @     TEXT(5)/1H /,TEXT(6)/1H /,TEXT(7)/1H /,TEXT(8)/1H /
      MAXPLO=125
      IFLAG(1)=0
      IFLAG(2)=0
      IFLAG(3)=0
      IART=1
      LOGT=.FALSE.
      LOGY=.FALSE.
      LOGZ=.FALSE.
      IPOL=1
      MARKP=1
      NP=5
      BLN=.FALSE.
      YMIN=0.
      YMAX=0.
      ZMIN=0.
      ZMAX=0.
      KFI=KFLAG
      KFLAG=0
      MARKP=0
      CLOG0=1.0E-30
      WARN=.FALSE.
      NB=NIWORK-90
      REWIND DOUT
      READ(DOUT,5001) IZ
      DO 12 I=NB,NIWORK
      IWORK(I)=IBLANK
   12 CONTINUE
      IF(IZ.LE.0) GOTO 13
      IZ=18*IZ+NB-1
      READ(DOUT,5002) (IWORK(L),L=NB,IZ)
      DO 7 L=1,8
7     TEXT(L)=IWORK(NB-1+L)
13    READ(DOUT,8110) CHARIS
      READ(DOUT,8110) CHARIS
      READ(DOUT,8106) NSP,NCEQ,IEL
      READ(DOUT,8110) CHARIS
8106  FORMAT(5X,I6,7X,I6,6X,I6)
8110  FORMAT(A4)
      IF (NSP.LE.NIWORK/3-90 .AND. NSP.LE.NHELP) GOTO 10
      IF (NSP.GT.NIWORK/3-90) WRITE(ITOUT,7001)
      IF (NSP.GT.NHELP) WRITE(ITOUT,7007)
      GOTO 99
   10 CONTINUE
   11 CONTINUE
      READ(DOUT,5003) CHARIS
      IF (CHARIS.NE.CNAME) GOTO 11
      NIW=3*NSP
      READ(DOUT,5004) (RWORK(I),I=1,NIW)
      NP=1
      ISUB(1)=1
      IF(KFI.NE.0) CALL DIALG1(IART,LOGT,LOGY,LOGZ,RWORK(1),NSP,ISUB,NP,
     1   KFI)
      IF (IART.EQ.0) RETURN
      NRW=NRWORK/(NP+1)
      N=0
      DO 20 K=1,NRW
      N=N+1
      CALL NLCONC (DOUT,T,C,NSP,KFOUND)
      IF(KFOUND.LT.0) GOTO 30
      IF (.NOT.LOGT .OR. T.GT.0.) GOTO 21
      N=N-1
      IF (WARN) GOTO 20
      WARN=.TRUE.
      WRITE(ITOUT,7002)
      GOTO 20
   21 CONTINUE
      DO 22 M=1,NP
      RWORK(N)=T
      SCR=C(ISUB(M))
      IF (SCR.LT.CLOG0) SCR=CLOG0
      RWORK(M*NRW+N)=SCR
   22 CONTINUE
      IF(N.GT.MAXPLO) WRITE(ITOUT,7777)
      IF(N.GT.MAXPLO) GOTO 30
   20 CONTINUE
      WRITE(ITOUT,7003)
      GOTO 99
   30 CONTINUE
      N=N-1
      IF (N.GE.4) GOTO 40
      WRITE(ITOUT,7005)
      GOTO 99
   40 CONTINUE
      DO 45 J=1,NP
      DO 45 I=1,N
      RWORK(J*N+I)=RWORK(J*NRW+I)
   45 CONTINUE
      TMIN=RWORK(1)
      TMAX=RWORK(N)
      IF(KFI.GE.2)
     @CALL DIALG2(IART,XL,YL,NLINES,IPOL,MARKP,ICOL,ISIG,NP,TMIN,TMAX,
     @YMIN,YMAX,ZMIN,ZMAX,BLN,TEXT)
      IF (IART.EQ.0) RETURN
      IF (.NOT. BLN) GOTO 53
      DO 54 IP=1,NP
      IWORK(3*ISUB(IP)-2)=IBLANK
      IWORK(3*ISUB(IP)-1)=IBLANK
      IWORK(3*ISUB(IP))=IBLANK
   54 CONTINUE
   53 CONTINUE
      KBEG=0
      KEND=N-1
      DO 50 K=1,N
      SCR=RWORK(K)
      IF (SCR.GT.TMIN .AND. KBEG.EQ.0) KBEG=K-1
      IF (SCR.GT.TMAX .AND. KEND.EQ.N-1) KEND=K-1
      IF (LOGT) RWORK(K)=ALOG10(SCR)
   50 CONTINUE
      NN=KEND-KBEG+4
      IF (.NOT. LOGT) GOTO 60
      TMIN=ALOG10(TMIN)
      TMAX=ALOG10(TMAX)
   60 CONTINUE
      NGET=(NP+1)*N
      IF (IART.LT.3) NGET=NGET+8*N
      IF (IART.EQ.2) NGET=NGET+5*N
      NREST=(NRWORK-NGET)/2
      IF(NREST.GT.250) NREST=250
      IF (IART.NE.1) NGET=NGET+2*NN
      IF (NGET.LE.NRWORK) GOTO 46
      WRITE(ITOUT,7003)
      GOTO 99
   46 CONTINUE
      IF(IART.EQ.1 .AND. LOGT) IFLAG(1)=1
      IF(IART.EQ.1 .AND. LOGY) IFLAG(2)=1
      IF(IART.EQ.2 .AND. LOGY) IFLAG(1)=1
      IF(IART.EQ.2 .AND. LOGZ) IFLAG(2)=1
      IF (IART.EQ.1) CALL TIMCO(N,RWORK(1),RWORK(N+1),KBEG,KEND,
     @NSP,IWORK(1),ISUB,XL,YL,LOGT,LOGY,IPOL,MARKP,ICOL,TMIN,TMAX,
     @YMIN,YMAX,TEXT,IWORK(NB),N1,N2,NP,NREST,
     @RWORK((NP+1)*N+1),RWORK((NP+2)*N+1),RWORK((NP+3)*N+1),
     @RWORK((NP+4)*N+1),RWORK((NP+5)*N+1),RWORK((NP+6)*N+1),
     @RWORK((NP+7)*N+1),RWORK((NP+8)*N+1),RWORK((NP+9)*N+1),
     @RWORK((NP+9)*N+NREST+1))
      IF (IART.EQ.2) CALL COCO(N,RWORK(1),RWORK(N+1),RWORK(2*N+1),
     @KBEG,KEND,IWORK(3*(ISUB(1)-1)+1),IWORK(3*(ISUB(2)-1)+1),XL,YL,
     @LOGY,LOGZ,IPOL,MARKP,ICOL(1),TMIN,TMAX,YMIN,YMAX,ZMIN,ZMAX,
     @TEXT,IWORK(NB),N1,N2,NREST,
     @RWORK(3*N+1),RWORK(4*N+1),RWORK(5*N+1),RWORK(6*N+1),
     @RWORK(7*N+1),RWORK(8*N+1),RWORK(9*N+1),RWORK(10*N+1),
     @RWORK(11*N+1),RWORK(12*N+1),RWORK(13*N+1),RWORK(14*N+1),
     @RWORK(15*N+1),RWORK(16*N+1),RWORK(16*N+NREST+1))
      IF (IART.EQ.3) CALL PAPLO1(N,RWORK(1),RWORK(N+1),KBEG,KEND,NSP,
     @IWORK(1),ISUB,NLINES,LOGT,LOGY,ISIG,TMIN,TMAX,YMIN,YMAX,TEXT,
     @IWORK(NB),N1,N2,NP)
      IF (IART.EQ.4) CALL PAPLO2(N,RWORK(1),RWORK(N+1),KBEG,KEND,NSP,
     @IWORK(1),ISUB,NLINES,LOGT,LOGY,ISIG,TMIN,TMAX,YMIN,YMAX,TEXT,
     @IWORK(NB),N1,N2,NP)
      IF (.NOT. LOGY) GOTO 71
      YMIN=10.0**YMIN
      YMAX=10.0**YMAX
   71 CONTINUE
      IF (.NOT. LOGZ) GOTO 72
      ZMIN=10.0**ZMIN
      ZMAX=10.0**ZMAX
   72 CONTINUE
      RETURN
   99 CONTINUE
      KFLAG=-1
      RETURN
 5001 FORMAT (15X,I3)
 5002 FORMAT (1X,18A4)
 5003 FORMAT (A4)
 5004 FORMAT (5(1X,3A4,1X))
 7001 FORMAT (//39H ***ERROR***  WORKSPACE IWORK EXHAUSTED//)
 7002 FORMAT (//41H **WARNING**  NONPOSITIV T-VALUES ENTERED,
     @17H - VALUES SKIPPED//)
 7003 FORMAT (//39H ***ERROR***  WORKSPACE RWORK EXHAUSTED//)
 7005 FORMAT (//40H ***ERROR***  TOO FEW INTEGRATION POINTS,
     @20H TO GENERATE SPLINES//)
 7007 FORMAT (//35H ***ERROR***  WORKSPACE C EXHAUSTED//)
 7777 FORMAT (//41H **WARNING**  TOO MUCH INTEGRATION POINTS,/,
     1          36H              FURTHER VALUES SKIPPED//)
      END
      SUBROUTINE DIALG1(IART,LOGT,LOGY,LOGZ,SUBNM,NSP,ISUB,NP,KFI)
      REAL SUBNM(3,NSP),FT(5),TT(5),TEST(3)
      INTEGER TEXT(8)
      INTEGER ISUB(10),ICOL(10),ISIG(10)
      LOGICAL LOGT,LOGY,LOGZ,BLN
      INTEGER ITIN,ITOUT,CIN,HDS,POUT,SIN,DOUT
      REAL CLOG0
      COMMON / LUNIT / ITIN,ITOUT,CIN,HDS,POUT,SIN,DOUT
      COMMON /LOG0/ CLOG0
      DATA QC/1HQ/,QL/1Hq/,IBC/1H /
      DATA FT(1)/4HABSO/,FT(2)/4HLUTE/,FT(3)/4H SCA/,
     @     FT(4)/4HLING/,FT(5)/4H    /
      DATA TT(1)/4HLOGA/,TT(2)/4HRITH/,TT(3)/4HMIC /,
     @     TT(4)/4HSCAL/,TT(5)/4HING /
      IART=1
      IF(KFI.LT.2) GOTO 19
      WRITE(ITOUT,7002)
   11 CONTINUE
      READ(ITIN,*,ERR=10) IART
      IF (IART.LT.0 .OR. IART.GT.4) GOTO 10
      IF (IART.EQ.0) RETURN
      IF (IART.EQ.2) LOGT=.FALSE.
      GOTO 19
   10 CONTINUE
      WRITE(ITOUT,7001)
      GOTO 11
   19 CONTINUE
      NPMAX=8
      IF (IART.EQ.2) NPMAX=2
      NP=0
      DO 20 IP=1,NPMAX
   23 CONTINUE
      WRITE(ITOUT,7003) IP
      READ(ITIN,7004) TEST
      IF (TEST(1).NE.QC.AND.TEST(1).NE.QL) GOTO 28
      IF (NP.GT.1 .OR. (NP.EQ.1 .AND. IART.NE.2)) GOTO 29
      WRITE(ITOUT,7006)
      IART=0
      RETURN
   28 CONTINUE
      DO 21 I=1,NSP
      IF (TEST(1).NE.SUBNM(1,I)) GOTO 21
      IF (TEST(2).NE.SUBNM(2,I)) GOTO 21
      IF (TEST(3).NE.SUBNM(3,I)) GOTO 21
      ISUB(IP)=I
      NP=IP
      GOTO 20
   21 CONTINUE
      WRITE(ITOUT,7005) TEST
      GOTO 23
   20 CONTINUE
   29 CONTINUE
      IF(KFI.LT.2) RETURN
      IF (IART.EQ.2) GOTO 31
   34 CONTINUE
      WRITE(ITOUT,7010)
      IF (LOGT .AND. LOGY) WRITE(ITOUT,7007) TT,TT
      IF (.NOT.LOGT .AND. LOGY) WRITE(ITOUT,7007) FT,TT
      IF (LOGT .AND. .NOT.LOGY) WRITE(ITOUT,7007) TT,FT
      IF (.NOT.LOGT .AND. .NOT.LOGY) WRITE(ITOUT,7007) FT,FT
      GOTO 32
   31 CONTINUE
      WRITE(ITOUT,7010)
      IF (LOGY .AND. LOGZ) WRITE(ITOUT,7008) TT,TT
      IF (.NOT.LOGY .AND. LOGZ) WRITE(ITOUT,7008) FT,TT
      IF (LOGY .AND. .NOT.LOGZ) WRITE(ITOUT,7008) TT,FT
      IF (.NOT.LOGY .AND. .NOT.LOGZ) WRITE(ITOUT,7008) FT,FT
   32 CONTINUE
      WRITE(ITOUT,7009)
   35 CONTINUE
      READ(ITIN,*,ERR=30) IO
      IF (IO.EQ.0) RETURN
      IF (IO.LT.1 .OR. IO.GT.2) GOTO 30
      IF (IART.EQ.2) GOTO 33
      IF (IO.EQ.1) LOGT=.NOT.LOGT
      IF (IO.EQ.2) LOGY=.NOT.LOGY
      GOTO 34
   33 CONTINUE
      IF (IO.EQ.1) LOGY=.NOT.LOGY
      IF (IO.EQ.2) LOGZ=.NOT.LOGZ
      GOTO 31
   30 CONTINUE
      WRITE(ITOUT,7001)
      GOTO 35
      ENTRY DIALG2(IART,XL,YL,NLINES,IPOL,MARKP,ICOL,ISIG,NP,
     @TMIN,TMAX,YMIN,YMAX,ZMIN,ZMAX,BLN,TEXT)
      TMIN0=TMIN
      TMAX0=TMAX
 9999 CONTINUE
      WRITE(ITOUT,7010)
      GOTO (1000,2000,3000,3000),IART
 1000 CONTINUE
      IO=1
      WRITE(ITOUT,7011) IO,XL,YL
      IO=2
      WRITE(ITOUT,7013) IO,TMIN,TMAX
      IO=3
      IF (YMIN.EQ.YMAX) WRITE(ITOUT,7014) IO
      IF (YMIN.NE.YMAX) WRITE(ITOUT,7015) IO,YMIN,YMAX
      IO=4
      IF (IPOL.EQ.1) WRITE(ITOUT,7020) IO
      IF (IPOL.EQ.2) WRITE(ITOUT,7021) IO
      IF (IPOL.EQ.3) WRITE(ITOUT,7022) IO
      IO=5
      WRITE(ITOUT,7023) IO,(ICOL(I),I=1,NP)
      IO=6
      IF (MARKP.EQ.0) WRITE(ITOUT,7025) IO
      IF (MARKP.EQ.1) WRITE(ITOUT,7026) IO
      IO=7
      IF (BLN) WRITE(ITOUT,7030) IO
      IF (.NOT.BLN) WRITE(ITOUT,7029) IO
      IO=8
      WRITE(ITOUT,7031) IO,TEXT
      WRITE(ITOUT,7009)
  199 CONTINUE
      READ(ITIN,*,ERR=198) IO
      IF (IO.EQ.0) GOTO 1900
      IF (IO.LT.1 .OR. IO.GT.8) GOTO 198
      GOTO (910,920,930,940,950,960,970,980),IO
  198 CONTINUE
      WRITE(ITOUT,7001)
      GOTO 199
 2000 CONTINUE
      IO=1
      WRITE(ITOUT,7011) IO,XL,YL
      IO=2
      WRITE(ITOUT,7013) IO,TMIN,TMAX
      IO=3
      IF (YMIN.EQ.YMAX) WRITE(ITOUT,7016) IO
      IF (YMIN.NE.YMAX) WRITE(ITOUT,7017) IO,YMIN,YMAX
      IO=4
      IF (ZMIN.EQ.ZMAX) WRITE(ITOUT,7018) IO
      IF (ZMIN.NE.ZMAX) WRITE(ITOUT,7019) IO,ZMIN,ZMAX
      IO=5
      IF (IPOL.EQ.1) WRITE(ITOUT,7020) IO
      IF (IPOL.EQ.2) WRITE(ITOUT,7021) IO
      IF (IPOL.EQ.3) WRITE(ITOUT,7022) IO
      IO=6
      WRITE(ITOUT,7023) IO,ICOL(1)
      IO=7
      IF (MARKP.EQ.0) WRITE(ITOUT,7027) IO
      IF (MARKP.NE.0) WRITE(ITOUT,7028) IO,MARKP
      IO=8
      IF (BLN) WRITE(ITOUT,7030) IO
      IF (.NOT.BLN) WRITE(ITOUT,7029) IO
      IO=9
      WRITE(ITOUT,7031) IO,TEXT
      WRITE(ITOUT,7009)
  299 CONTINUE
      READ(ITIN,*,ERR=298) IO
      IF (IO.EQ.0) GOTO 1900
      IF (IO.LT.1 .OR. IO.GT.9) GOTO 298
      GOTO (910,920,930,990,940,905,915,970,980),IO
  298 CONTINUE
      WRITE(ITOUT,7001)
      GOTO 299
 3000 CONTINUE
      IO=1
      WRITE(ITOUT,7012) IO,NLINES
      IO=2
      WRITE(ITOUT,7013) IO,TMIN,TMAX
      IO=3
      IF (YMIN.EQ.YMAX) WRITE(ITOUT,7014) IO
      IF (YMIN.NE.YMAX) WRITE(ITOUT,7015) IO,YMIN,YMAX
      IO=4
      WRITE(ITOUT,7024) IO,(ISIG(I),I=1,NP)
      IO=5
      WRITE(ITOUT,7031) IO,TEXT
      WRITE(ITOUT,7009)
  399 CONTINUE
      READ(ITIN,*,ERR=398) IO
      IF (IO.EQ.0) RETURN
      IF (IO.LT.1 .OR. IO.GT.5) GOTO 398
      GOTO (925,920,930,935,980),IO
  398 CONTINUE
      WRITE(ITOUT,7001)
      GOTO 399
  910 CONTINUE
      WRITE(ITOUT,7032)
  912 CONTINUE
      READ(ITIN,*,ERR=911) XL,YL
      IF (XL.LT.25. .OR. XL.GT.195.) GOTO 911
      IF (YL.LT.20. .OR. YL.GT.60.) GOTO 911
      GOTO 9999
  911 CONTINUE
      WRITE(ITOUT,7001)
      GOTO 912
  920 CONTINUE
      WRITE(ITOUT,7033)
  922 CONTINUE
      READ(ITIN,*,ERR=921) TMIN,TMAX
      IF (TMIN.LT.TMIN0 .OR. TMAX.GT.TMAX0 .OR. TMIN.GE.TMAX) GOTO 921
      GOTO 9999
  921 CONTINUE
      WRITE(ITOUT,7001)
      GOTO 922
  930 CONTINUE
      WRITE(ITOUT,7034)
  932 CONTINUE
      READ(ITIN,*,ERR=931) YMIN,YMAX
      IF (YMIN.LT.0. .OR. YMAX.LT.YMIN) GOTO 931
      IF (YMIN.LT.CLOG0) YMIN=CLOG0
      IF (YMAX.LT.CLOG0) YMAX=CLOG0
      GOTO 9999
  931 CONTINUE
      WRITE(ITOUT,7001)
      GOTO 932
  940 CONTINUE
      WRITE(ITOUT,7035)
  942 CONTINUE
      READ(ITIN,*,ERR=941) IPOL
      IF (IPOL.LT.1 .OR. IPOL.GT.3) GOTO 941
      GOTO 9999
  941 CONTINUE
      WRITE(ITOUT,7001)
      GOTO 942
  950 CONTINUE
      WRITE(ITOUT,7036) NP
  952 CONTINUE
      READ(ITIN,*,ERR=951) (ICOL(I),I=1,NP)
      DO 953 I=1,NP
      IF (ICOL(I).LT.1 .OR. ICOL(I).GT.3) GOTO 951
  953 CONTINUE
      GOTO 9999
  951 CONTINUE
      WRITE(ITOUT,7001)
      GOTO 952
  960 CONTINUE
      MARKP=1-MARKP
      GOTO 9999
  970 CONTINUE
      BLN=.NOT.BLN
      GOTO 9999
  980 CONTINUE
      WRITE(ITOUT,7037)
      READ(ITIN,7038) TEXT
      GOTO 9999
  990 CONTINUE
      WRITE(ITOUT,7039)
  992 CONTINUE
      READ(ITIN,*,ERR=991) ZMIN,ZMAX
      IF (ZMIN.LT.0. .OR. ZMAX.LT.ZMIN) GOTO 991
      IF (ZMIN.LT.CLOG0) ZMIN=CLOG0
      IF (ZMAX.LT.CLOG0) ZMAX=CLOG0
      GOTO 9999
  991 CONTINUE
      WRITE(ITOUT,7001)
      GOTO 992
  905 CONTINUE
      WRITE(ITOUT,7040)
  907 CONTINUE
      READ(ITIN,*,ERR=906) ICOL(1)
      IF (ICOL(1).LT.1 .OR. ICOL(1).GT.3) GOTO 906
      GOTO 9999
  906 CONTINUE
      WRITE(ITOUT,7001)
      GOTO 907
  915 CONTINUE
      WRITE(ITOUT,7041)
  917 CONTINUE
      READ(ITIN,*,ERR=916) MARKP
      IF (MARKP.LT.0) GOTO 916
      GOTO 9999
  916 CONTINUE
      WRITE(ITOUT,7001)
      GOTO 917
  925 CONTINUE
      WRITE(ITOUT,7042)
  927 CONTINUE
      READ(ITIN,*,ERR=926) NLINES
      IF (NLINES.LT.20) GOTO 926
      GOTO 9999
  926 CONTINUE
      WRITE(ITOUT,7001)
      GOTO 927
  935 CONTINUE
      WRITE(ITOUT,7043) NP
  937 CONTINUE
      READ(ITIN,7044) (ISIG(I),I=1,NP)
      DO 938 I=1,NP
      IF (ISIG(I).EQ.IBC) GOTO 936
  938 CONTINUE
      GOTO 9999
  936 CONTINUE
      WRITE(ITOUT,7001)
      GOTO 937
1900  CONTINUE
      IF((LOGT.OR.LOGY.OR.LOGZ).AND.IPOL.NE.1) WRITE(ITOUT,7777)
      IF((LOGT.OR.LOGY.OR.LOGZ).AND.IPOL.NE.1) GOTO 9999
7777  FORMAT(49H COMBINATION: LOG. SCALE AND SPLINE INTERPOLATION,/,
     1       36H              INVALID; RESET OPTIONS,/)
      RETURN
 7001 FORMAT(34H YOUR INPUT IS INVALID  -  REENTER)
 7002 FORMAT(20H LARKIN PLOT ROUTINE//27H PLEASE CHOOSE KIND OF PLOT/
     @20H ENTER  0  FOR  EXIT/8X,30H1  FOR  PLOTTER  TIME <-> CONC/
     @8X,30H2  FOR  PLOTTER  CONC <-> CONC/8X,21H3  FOR  PRINTER  TIME,
     @9H <-> CONC,/,
     @8X,30H4  FOR  TERMINAL TIME <-> CONC)
 7003 FORMAT(6H ENTER,I3,32H. SPECIES TO BE PLOTTED  OR  Q  ,
     @8HFOR QUIT)
 7004 FORMAT(2A4,A2)
 7005 FORMAT(2H ",2A4,A2,33H" NOT FOUND IN NAMELIST - REENTER)
 7006 FORMAT(38H TOO FEW SPECIES ENTERED - EXIT CALLED)
 7007 FORMAT(6X,1H1,5X,4HTIME,23X,5A4/6X,1H2,5X,14HCONCENTRATIONS,
     @13X,5A4)
 7008 FORMAT(6X,1H1,5X,15HCONCENTRATION 1,12X,5A4/6X,1H2,5X,
     @15HCONCENTRATION 2,12X,5A4)
 7009 FORMAT(/20H ENTER OPTION NUMBER)
 7010 FORMAT(12H  OPTION NO.,6X,6HOPTION,22X,15HACTUAL SETTINGS/
     @6X,1H0,5X,4HQUIT)
 7011 FORMAT(4X,I3,5X,6HFORMAT,21X,3HXL=,F4.1,14H CM        YL=,
     @F4.1,3H CM)
 7012 FORMAT(4X,I3,5X,6HLENGTH,21X,I5,6H LINES)
 7013 FORMAT(4X,I3,5X,13HTIME INTERVAL,14X,
     @5HTMIN=,E10.3,8H   TMAX=,E10.3)
 7014 FORMAT(4X,I3,5X,14HCONCENTRATIONS,13X,10HAUTOSCALED)
 7015 FORMAT(4X,I3,5X,14HCONCENTRATIONS,13X,
     @5HYMIN=,E10.3,8H   YMAX=,E10.3)
 7016 FORMAT(4X,I3,5X,15HCONCENTRATION 1,12X,10HAUTOSCALED)
 7017 FORMAT(4X,I3,5X,15HCONCENTRATION 1,12X,
     @5HYMIN=,E10.3,8H   YMAX=,E10.3)
 7018 FORMAT(4X,I3,5X,15HCONCENTRATION 2,12X,10HAUTOSCALED)
 7019 FORMAT(4X,I3,5X,15HCONCENTRATION 2,12X,
     @5HZMIN=,E10.3,8H   ZMAX=,E10.3)
 7020 FORMAT(4X,I3,5X,18HINTERPOLATION TYPE,9X,6HLINEAR)
 7021 FORMAT(4X,I3,5X,18HINTERPOLATION TYPE,9X,12HCUBIC SPLINE)
 7022 FORMAT(4X,I3,5X,18HINTERPOLATION TYPE,9X,18HEXPONENTIAL SPLINE)
 7023 FORMAT(4X,I3,5X,7HCOLOURS,20X,I1,9I3)
 7024 FORMAT(4X,I3,5X,10HCHARACTERS,17X,A1,9(2X,A1))
 7025 FORMAT(4X,I3,5X,18HINTEGRATION POINTS,9X,10HNOT MARKED)
 7026 FORMAT(4X,I3,5X,18HINTEGRATION POINTS,9X,6HMARKED)
 7027 FORMAT(4X,I3,5X,27HEQUIDISTANT TIME INTERVALS ,10HNOT MARKED)
 7028 FORMAT(4X,I3,5X,27HEQUIDISTANT TIME INTERVALS ,6HMARKED)
 7029 FORMAT(4X,I3,5X,16HNAMES OF SPECIES,11X,7HPLOTTED)
 7030 FORMAT(4X,I3,5X,16HNAMES OF SPECIES,11X,11HNOT PLOTTED)
 7031 FORMAT(4X,I3,5X,4HTEXT,23X,1H",8A4,1H")
 7032 FORMAT(36H ENTER X-LENGTH AND Y-LENGTH OF PLOT)
 7033 FORMAT(20H ENTER TMIN AND TMAX)
 7034 FORMAT(49H ENTER YMIN AND YMAX  (YMIN=YMAX FOR AUTOSCALING))
 7035 FORMAT(36H ENTER  1  FOR  LINEAR INTERPOLATION/8X,
     @20H2  FOR  CUBIC SPLINE/8X,26H3  FOR  EXPONENTIAL SPLINE)
 7036 FORMAT(6H ENTER,I3,10H COLOURS  ,
     @34H( 1 - BLACK   2 - BLUE   3 - RED ))
 7037 FORMAT(34H ENTER TEXT  (UP TO 32 CHARACTERS))
 7038 FORMAT(8A4)
 7039 FORMAT(49H ENTER ZMIN AND ZMAX  (ZMIN=ZMAX FOR AUTOSCALING))
 7040 FORMAT(19H ENTER  1 COLOUR   ,
     @34H( 1 - BLACK   2 - BLUE   3 - RED ))
 7041 FORMAT(44H ENTER NUMBER OF TIME INTERVALS TO BE MARKED)
 7042 FORMAT(22H ENTER NUMBER OF LINES)
 7043 FORMAT(6H ENTER,I3,28H CHARACTERS  (IN ONE STRING))
 7044 FORMAT(10A1)
      END
      SUBROUTINE TIMCO(N,T,SUB,KBEG,KEND,NSP,SUBNM,ISUB,XL,YL,
     @LOGT,LOGY,IPOL,MARKP,ICOL,TMIN,TMAX,YMIN,YMAX,TEXT,TITLE,N1,N2,
     @NP,NREST,P,D,DQ,H,HP,PH,R,Q,XPLOT,YPLOT)
      REAL T(N),SUB(N,NP)
      INTEGER TEXT(8)
      INTEGER SUBNM(3,NSP),TITLE(N1,N2)
      INTEGER ISUB(NP),ICOL(NP)
      LOGICAL LOGT,LOGY
      REAL P(N),D(N),DQ(N),H(N),HP(N),PH(N),R(N),Q(N)
      REAL TXTTN(10),TXTTL(10),TXTYN(10),TXTYL(10)
      REAL SPNAME,XAMI,XAMA,YAMI,YAMA
      REAL XPLOT(NREST),YPLOT(NREST)
      COMMON / PLOPC / SPNAME(3,8),XAMI,XAMA,YAMI,YAMA,IFLAG(10)
      DATA TXTTN(1)/4HTIME/,TXTTN(2)/4H    /,TXTTN(3)/4H    /,
     @     TXTTN(4)/4H    /,TXTTN(5)/4H    /,TXTTN(6)/4H    /,
     @     TXTTN(7)/4H    /,TXTTN(8)/4H    /,TXTTN(9)/4H    /,
     @     TXTTN(10)/4H    /
      DATA TXTTL(1)/4H LOG/,TXTTL(2)/4H OF /,TXTTL(3)/4HTIME/,
     @     TXTTL(4)/4H    /,TXTTL(5)/4H    /,TXTTL(6)/4H    /,
     @     TXTTL(7)/4H    /,TXTTL(8)/4H    /,TXTTL(9)/4H    /,
     @     TXTTL(10)/4H    /
      DATA TXTYN(1)/4HCONC/,TXTYN(2)/4HENTR/,TXTYN(3)/4HATIO/,
     @     TXTYN(4)/4HN   /,TXTYN(5)/4H    /,TXTYN(6)/4H    /,
     @     TXTYN(7)/4H    /,TXTYN(8)/4H    /,TXTYN(9)/4H    /,
     @     TXTYN(10)/4H    /
      DATA TXTYL(1)/4H LOG/,TXTYL(2)/4H OF /,TXTYL(3)/4HCONC/,
     @     TXTYL(4)/4HENTR/,TXTYL(5)/4HATIO/,TXTYL(6)/4HN   /,
     @     TXTYL(7)/4H    /,TXTYL(8)/4H    /,TXTYL(9)/4H    /,
     @     TXTYL(10)/4H    /
      DATA IER/0/,SIGMA/0.01/
C      open (unit=33, file='GRAOUT')
      IFF=KEND+1
      IF (YMIN.NE.YMAX) GOTO 10
      YMIN=SUB(KBEG,1)
      YMAX=YMIN
      DO 11 I=KBEG,IFF
      DO 11 J=1,NP
      SCR=SUB(I,J)
      IF (SCR.LT.YMIN) YMIN=SCR
      IF (SCR.GT.YMAX) YMAX=SCR
   11 CONTINUE
   10 CONTINUE
      IF (.NOT.LOGY .OR. IPOL.NE.1) GOTO 20
      DO 21 I=1,N
      DO 21 J=1,NP
      SUB(I,J)=ALOG10(SUB(I,J))
   21 CONTINUE
   20 CONTINUE
      YMINT=YMIN
      YMAXT=YMAX
      IF (.NOT. LOGY) GOTO 22
      YMIN=ALOG10(YMIN)
      YMAX=ALOG10(YMAX)
   22 CONTINUE
      XAMI=TMIN
      XAMA=TMAX
      YAMI=YMIN
      YAMA=YMAX
      XLQ=XL-5.
      YLQ=YL-4.
      TF=TMAX-TMIN
      YF=YMAX-YMIN
      TM=(XLQ-1.)/TF
      YM=(YLQ-1.)/YF
      TMIN=TMIN*TM
      YMIN=YMIN*YM
      TMAX=TMAX*TM
      YMAX=YMAX*YM
      TMINS=TMIN
      YMINS=YMIN
      TMINQ=TMINS/TM
      YMINQ=YMINS/YM
      DELTAT=1./TM
      DELTAY=1./YM
      IF (LOGY) GOTO 24
      YMINT=YMIN
      YMAXT=YMAX
   24 CONTINUE
      DO 30 I=1,N
      T(I)=T(I)*TM
   30 CONTINUE
      IF (LOGY .AND. IPOL.NE.1) GOTO 39
      DO 31 I=1,N
      DO 31 J=1,NP
      SUB(I,J)=SUB(I,J)*YM
   31 CONTINUE
   39 CONTINUE
      YM=1.
      CORRF=1.
      IF (.NOT. LOGY) GOTO 32
      YM=(YLQ-1.)/(YMAXT-YMINT)
      CORRF=(YLQ-1.)/(ALOG10(YMAXT)-ALOG10(YMINT))
      FAC=(YLQ-1.)/YF
   32 CONTINUE
      IF (.NOT.LOGT .AND. .NOT.LOGY) CALL PLOT1(NREST,XPLOT,YPLOT,
     @XL,YL,TITLE,N1,N2,TEXT,XLQ,YLQ,TXTTN,TXTYN,-4,13,TMINQ,YMINQ,
     @DELTAT,DELTAY)
      IF (.NOT.LOGT .AND. LOGY) CALL PLOT1(NREST,XPLOT,YPLOT,
     @XL,YL,TITLE,N1,N2,TEXT,XLQ,YLQ,TXTTN,TXTYL,-4,21,TMINQ,YMINQ,
     @DELTAT,DELTAY)
      IF (LOGT .AND. .NOT.LOGY) CALL PLOT1(NREST,XPLOT,YPLOT,
     @XL,YL,TITLE,N1,N2,TEXT,XLQ,YLQ,TXTTL,TXTYN,-12,13,TMINQ,YMINQ,
     @DELTAT,DELTAY)
      IF (LOGT .AND. LOGY) CALL PLOT1(NREST,XPLOT,YPLOT,
     @XL,YL,TITLE,N1,N2,TEXT,XLQ,YLQ,TXTTL,TXTYL,-12,21,TMINQ,YMINQ,
     @DELTAT,DELTAY)
      XVS=XLQ-0.25
      IF (IPOL.NE.1) GOTO 40
      IF (TMIN.EQ.T(KBEG)) GOTO 41
      DO 42 I=1,NP
      SUB(KBEG,I)=(SUB(KBEG+1,I)-SUB(KBEG,I))/(T(KBEG+1)-T(KBEG))*
     @(TMIN-T(KBEG))+SUB(KBEG,I)
   42 CONTINUE
      T(KBEG)=TMIN
   41 CONTINUE
      IF (TMAX.EQ.T(KEND+1)) GOTO 43
      DO 44 I=1,NP
      SUB(KEND+1,I)=(SUB(KEND+1,I)-SUB(KEND,I))/(T(KEND+1)-T(KEND))*
     @(TMAX-T(KEND))+SUB(KEND,I)
   44 CONTINUE
      T(KEND+1)=TMAX
   43 CONTINUE
      IPLOT=KEND-KBEG+2
      DO 47 I=1,IPLOT
      XPLOT(I)=T(KBEG+I-1)
   47 CONTINUE
      XPLOT(IPLOT+1)=TMINS
      XPLOT(IPLOT+2)=1.
      YPLOT(IPLOT+1)=YMINS
      YPLOT(IPLOT+2)=1.
      DO 45 J=1,NP
      DO 46 I=1,IPLOT
      SCR=SUB(KBEG+I-1,J)
      IF (SCR.LT.YMIN) SCR=YMIN
      IF (SCR.GT.YMAX) SCR=YMAX
      YPLOT(I)=SCR
   46 CONTINUE
      YVS=YPLOT(IPLOT)-YMINS-0.105
      CALL PLOT2(NREST,XPLOT,YPLOT,IPLOT,MARKP,ICOL(J),XVS,YVS,
     @SUBNM(1,ISUB(J)))
   45 CONTINUE
      CALL PLOT4(NREST,XPLOT,YPLOT,TEXT)
      RETURN
   40 CONTINUE
      LBEG=KBEG
      LEND=KEND
      IF (TMIN.NE.T(KBEG)) LBEG=LBEG+1
      IF (TMAX.EQ.T(KEND+1)) LEND=LEND+1
      IZ=LEND-LBEG+1
      DO 90 IP=1,NP
      DO 50 I=1,N
      P(I)=0.
   50 CONTINUE
      CALL EXSPLC(N,T,SUB(1,IP),P,D,DQ,H,HP,PH,R,Q,IER)
      IF (IPOL.EQ.2) GOTO 60
      CALL GENER(N,T,SUB(1,IP),P,D,DQ,H)
      CALL EXSPLC(N,T,SUB(1,IP),P,D,DQ,H,HP,PH,R,Q,IER)
   60 CONTINUE
      CALL EXPLO1(N,T,SUB(1,IP),P,D,H,HP,PH,XPLOT,YPLOT,IPLOT,SIGMA,
     @KBEG,KEND,TMIN,TMAX,YMINT,YMAXT,NREST,YM,CORRF,LOGY)
      XPLOT(IPLOT+1)=TMINS
      XPLOT(IPLOT+2)=1.
      IF (.NOT. LOGY) YPLOT(IPLOT+1)=YMINS
      IF (LOGY) YPLOT(IPLOT+1)=-0.5
      YPLOT(IPLOT+2)=1.
      IF (.NOT. LOGY) YVS=YPLOT(IPLOT)-YMINS-0.105
      IF (LOGY) YVS=YPLOT(IPLOT)+0.395
      CALL PLOT2(NREST,XPLOT,YPLOT,IPLOT,0,ICOL(IP),XVS,YVS,
     @SUBNM(1,ISUB(IP)))
      IF (LBEG.GT.LEND .OR. MARKP.EQ.0) GOTO 70
      DO 71 I=1,IZ
      SCR=SUB(LBEG+I-1,IP)
      IF (SCR.LT.YMINT) SCR=YMINT
      IF (SCR.GT.YMAXT) SCR=YMAXT
      IF (LOGY) SCR=ALOG10(SCR)*FAC
      YPLOT(I)=SCR
      XPLOT(I)=T(LBEG+I-1)
   71 CONTINUE
      YPLOT(IZ+1)=YMINS
      YPLOT(IZ+2)=1.
      XPLOT(IZ+1)=TMINS
      XPLOT(IZ+2)=1.
      CALL PLOT3(NREST,XPLOT,YPLOT,IZ)
   70 CONTINUE
   90 CONTINUE
      CALL PLOT4(NREST,XPLOT,YPLOT,TEXT)
      RETURN
      END
      SUBROUTINE COCO(N,T,Y,Z,KBEG,KEND,SNY,SNZ,XL,YL,LOGY,LOGZ,
     @IPOL,MARKP,IC,TMIN,TMAX,YMIN,YMAX,ZMIN,ZMAX,TEXT,TITLE,N1,N2,
     @NREST,PY,DY,DQY,HPY,PHY,PZ,DZ,DQZ,HPZ,PHZ,H,R,Q,XPLOT,YPLOT)
      REAL T(N),Y(N),Z(N),SNY(3),SNZ(3),BN(3)
      REAL TITLE(N1,N2)
      INTEGER TEXT(8)
      LOGICAL LOGY,LOGZ
      REAL PY(N),DY(N),DQY(N),HPY(N),PHY(N)
      REAL PZ(N),DZ(N),DQZ(N),HPZ(N),PHZ(N)
      REAL H(N),R(N),Q(N)
      REAL TXTYN(10),TXTYL(10),TXTZN(10),TXTZL(10)
      REAL SPNAME,XAMI,XAMA,YAMI,YAMA
      REAL XPLOT(NREST),YPLOT(NREST)
      COMMON / PLOPC / SPNAME(3,8),XAMI,XAMA,YAMI,YAMA,IFLAG(10)
      DATA TXTYN(1)/4H    /,TXTYN(2)/4H    /,TXTYN(3)/4H    /,
     @     TXTYN(4)/4HCONC/,TXTYN(5)/4HENTR/,TXTYN(6)/4HATIO/,
     @     TXTYN(7)/4HN   /,TXTYN(8)/4H    /,TXTYN(9)/4H    /,
     @     TXTYN(10)/4H    /
      DATA TXTYL(1)/4H    /,TXTYL(2)/4H    /,TXTYL(3)/4H    /,
     @     TXTYL(4)/4HLOG /,TXTYL(5)/4HOF C/,TXTYL(6)/4HONCE/,
     @     TXTYL(7)/4HNTRA/,TXTYL(8)/4HTION/,TXTYL(9)/4H    /,
     @     TXTYL(10)/4H    /
      DATA TXTZN(1)/4H    /,TXTZN(2)/4H    /,TXTZN(3)/4H    /,
     @     TXTZN(4)/4HCONC/,TXTZN(5)/4HENTR/,TXTZN(6)/4HATIO/,
     @     TXTZN(7)/4HN   /,TXTZN(8)/4H    /,TXTZN(9)/4H    /,
     @     TXTZN(10)/4H    /
      DATA TXTZL(1)/4H    /,TXTZL(2)/4H    /,TXTZL(3)/4H    /,
     @     TXTZL(4)/4HLOG /,TXTZL(5)/4HOF C/,TXTZL(6)/4HONCE/,
     @     TXTZL(7)/4HNTRA/,TXTZL(8)/4HTION/,TXTZL(9)/4H    /,
     @     TXTZL(10)/4H    /
      DATA IER/0/,SIGMA/0.01/
      DATA XVS/0./,YVS/0./,BN(1)/4H    /,BN(2)/4H    /,BN(3)/4H    /
      IFLAG(3)=1
      SPNAME(1,1)=SNY(1)
      SPNAME(2,1)=SNY(2)
      SPNAME(3,1)=SNY(3)
      SPNAME(1,2)=SNZ(1)
      SPNAME(2,2)=SNZ(2)
      SPNAME(3,2)=SNZ(3)
      TXTYN(1)=SNY(1)
      TXTYN(2)=SNY(2)
      TXTYN(3)=SNY(3)
      TXTYL(1)=SNY(1)
      TXTYL(2)=SNY(2)
      TXTYL(3)=SNY(3)
      TXTZN(1)=SNZ(1)
      TXTZN(2)=SNZ(2)
      TXTZN(3)=SNZ(3)
      TXTZL(1)=SNZ(1)
      TXTZL(2)=SNZ(2)
      TXTZL(3)=SNZ(3)
      IF=KEND+1
      IF (YMIN.NE.YMAX) GOTO 10
      YMIN=Y(KBEG)
      YMAX=YMIN
      DO 11 I=KBEG,IF
      SCR=Y(I)
      IF (SCR.LT.YMIN) YMIN=SCR
      IF (SCR.GT.YMAX) YMAX=SCR
   11 CONTINUE
   10 CONTINUE
      IF (.NOT. LOGY) GOTO 20
      DO 21 I=1,N
      Y(I)=ALOG10(Y(I))
   21 CONTINUE
      YMIN=ALOG10(YMIN)
      YMAX=ALOG10(YMAX)
   20 CONTINUE
      IF (ZMIN.NE.ZMAX) GOTO 30
      ZMIN=Z(KBEG)
      ZMAX=ZMIN
      DO 31 I=KBEG,IF
      SCR=Z(I)
      IF (SCR.LT.ZMIN) ZMIN=SCR
      IF (SCR.GT.ZMAX) ZMAX=SCR
   31 CONTINUE
   30 CONTINUE
      IF (.NOT. LOGZ) GOTO 40
      DO 41 I=1,N
      Z(I)=ALOG10(Z(I))
   41 CONTINUE
      ZMIN=ALOG10(ZMIN)
      ZMAX=ALOG10(ZMAX)
   40 CONTINUE
      XAMI=YMIN
      XAMA=YMAX
      YAMI=ZMIN
      YAMA=ZMAX
      XLQ=XL-5.
      YLQ=YL-4.
      YF=YMAX-YMIN
      ZF=ZMAX-ZMIN
      YM=(XLQ-1.)/YF
      ZM=(YLQ-1.)/ZF
      YMIN=YMIN*YM
      ZMIN=ZMIN*ZM
      YMAX=YMAX*YM
      ZMAX=ZMAX*ZM
      YMINS=YMIN
      ZMINS=ZMIN
      YMINQ=YMINS/YM
      ZMINQ=ZMINS/ZM
      DELTAY=1./YM
      DELTAZ=1./ZM
      DO 50 I=1,N
      Y(I)=Y(I)*YM
      Z(I)=Z(I)*ZM
   50 CONTINUE
      IF (.NOT.LOGY .AND. .NOT.LOGZ) CALL PLOT1(NREST,XPLOT,YPLOT,
     @XL,YL,TITLE,N1,N2,TEXT,XLQ,YLQ,TXTYN,TXTZN,-25,25,YMINQ,ZMINQ,
     @DELTAY,DELTAZ)
      IF (.NOT.LOGY .AND. LOGZ) CALL PLOT1(NREST,XPLOT,YPLOT,
     @XL,YL,TITLE,N1,N2,TEXT,XLQ,YLQ,TXTYN,TXTZL,-25,32,YMINQ,ZMINQ,
     @DELTAY,DELTAZ)
      IF (LOGY .AND. .NOT.LOGZ) CALL PLOT1(NREST,XPLOT,YPLOT,
     @XL,YL,TITLE,N1,N2,TEXT,XLQ,YLQ,TXTYL,TXTZN,-32,25,YMINQ,ZMINQ,
     @DELTAY,DELTAZ)
      IF (LOGY .AND. LOGZ) CALL PLOT1(NREST,XPLOT,YPLOT,
     @XL,YL,TITLE,N1,N2,TEXT,XLQ,YLQ,TXTYL,TXTZL,-32,32,YMINQ,ZMINQ,
     @DELTAY,DELTAZ)
      XVS=XLQ-0.25
      IF (IPOL.NE.1) GOTO 60
      IF (TMIN.EQ.T(KBEG)) GOTO 61
      Y(KBEG)=(Y(KBEG+1)-Y(KBEG))/(T(KBEG+1)-Y(KBEG))*(TMIN-T(KBEG))+
     @Y(KBEG)
      Z(KBEG)=(Z(KBEG+1)-Z(KBEG))/(T(KBEG+1)-T(KBEG))*(TMIN-T(KBEG))+
     @Z(KBEG)
      T(KBEG)=TMIN
   61 CONTINUE
      IF (TMAX.EQ.T(KEND+1)) GOTO 62
      Y(KEND+1)=(Y(KEND+1)-Y(KEND))/(T(KEND+1)-Y(KEND))*(TMAX-T(KEND))+
     @Y(KEND)
      Z(KEND+1)=(Z(KEND+1)-Z(KEND))/(T(KEND+1)-T(KEND))*(TMAX-T(KEND))+
     @Z(KEND)
      T(KEND+1)=TMAX
   62 CONTINUE
      IPLOT=KEND-KBEG+2
      DO 63 I=1,IPLOT
      SCR=Y(KBEG+I-1)
      IF (SCR.LT.YMIN) SCR=YMIN
      IF (SCR.GT.YMAX) SCR=YMAX
      XPLOT(I)=SCR
      SCR=Z(KBEG+I-1)
      IF (SCR.LT.ZMIN) SCR=ZMIN
      IF (SCR.GT.ZMAX) SCR=ZMAX
      YPLOT(I)=SCR
   63 CONTINUE
      XPLOT(IPLOT+1)=YMINS
      XPLOT(IPLOT+2)=1.
      YPLOT(IPLOT+1)=ZMINS
      YPLOT(IPLOT+2)=1.
      CALL PLOT2(NREST,XPLOT,YPLOT,IPLOT,0,IC,XVS,YVS,BN)
      GOTO 80
   60 CONTINUE
      DO 65 I=1,N
      PY(I)=0.
      PZ(I)=0.
   65 CONTINUE
      CALL EXSPLC(N,T,Y,PY,DY,DQY,H,HPY,PHY,R,Q,IER)
      CALL EXSPLC(N,T,Z,PZ,DZ,DQZ,H,HPZ,PHZ,R,Q,IER)
      IF (IPOL.EQ.2) GOTO 70
      CALL GENER(N,T,Y,PY,DY,DQY,H)
      CALL GENER(N,T,Z,PZ,DZ,DQZ,H)
      CALL EXSPLC(N,T,Y,PY,DY,DQY,H,HPY,PHY,R,Q,IER)
      CALL EXSPLC(N,T,Z,PZ,DZ,DQZ,H,HPZ,PHZ,R,Q,IER)
   70 CONTINUE
      CALL EXPLO2(N,T,Y,Z,PY,DY,HPY,PHY,PZ,DZ,HPZ,PHZ,H,XPLOT,YPLOT,
     @IPLOT,SIGMA,KBEG,KEND,TMIN,TMAX,YMIN,YMAX,ZMIN,ZMAX,NREST)
      XPLOT(IPLOT+1)=YMINS
      XPLOT(IPLOT+2)=1.
      YPLOT(IPLOT+1)=ZMINS
      YPLOT(IPLOT+2)=1.
      CALL PLOT2(NREST,XPLOT,YPLOT,IPLOT,0,IC,XVS,YVS,BN)
   80 CONTINUE
      IF (MARKP.EQ.0) GOTO 90
      DELTAT=(TMAX-TMIN)/MARKP
      IPLOT=0
      M1=MARKP+1
      TLAUF=TMIN
      DO 91 INTER=KBEG,KEND
   95 CONTINUE
      IF (TLAUF.GT.T(INTER+1)) GOTO 92
      IPLOT=IPLOT+1
      IF (IPOL.EQ.1) GOTO 93
      CALL EVAL(N,T,Y,PY,DY,H,HPY,PHY,TLAUF,SCR,INTER,IER)
      IF (SCR.LT.YMIN) SCR=YMIN
      IF (SCR.GT.YMAX) SCR=YMAX
      XPLOT(IPLOT)=SCR
      CALL EVAL(N,T,Z,PZ,DZ,H,HPZ,PHZ,TLAUF,SCR,INTER,IER)
      IF (SCR.LT.ZMIN) SCR=ZMIN
      IF (SCR.GT.ZMAX) SCR=ZMAX
      YPLOT(IPLOT)=SCR
      GOTO 94
   93 CONTINUE
      SCR=(Y(INTER+1)-Y(INTER))/(T(INTER+1)-T(INTER))*
     @(TLAUF-T(INTER))+Y(INTER)
      IF (SCR.LT.YMIN) SCR=YMIN
      IF (SCR.GT.YMAX) SCR=YMAX
      XPLOT(IPLOT)=SCR
      SCR=(Z(INTER+1)-Z(INTER))/(T(INTER+1)-T(INTER))*
     @(TLAUF-T(INTER))+Z(INTER)
      IF (SCR.LT.ZMIN) SCR=ZMIN
      IF (SCR.GT.ZMAX) SCR=ZMAX
      YPLOT(IPLOT)=SCR
   94 CONTINUE
      IF (IPLOT.EQ.M1) GOTO 99
      TLAUF=TMIN+DELTAT*FLOAT(IPLOT)
      GOTO 95
   92 CONTINUE
   91 CONTINUE
   99 CONTINUE
      XPLOT(IPLOT+1)=YMINS
      XPLOT(IPLOT+2)=1.
      YPLOT(IPLOT+1)=ZMINS
      YPLOT(IPLOT+2)=1.
      CALL PLOT3(NREST,XPLOT,YPLOT,IPLOT)
   90 CONTINUE
      CALL PLOT4(NREST,XPLOT,YPLOT,TEXT)
      RETURN
      END
      SUBROUTINE PAPLO1(N,T,SUB,KBEG,KEND,NSP,SUBNM,ISUB,NLINES,
     @LOGT,LOGY,ISIG,TMIN,TMAX,YMIN,YMAX,TEXT,TITLE,N1,N2,NP)
      REAL T(N),SUB(N,NP),SUBNM(3,NSP),TITLE(N1,N2)
      INTEGER TEXT(8)
      INTEGER ISUB(NP),ISIG(NP)
      INTEGER YPLOT(121),IYMEM(10),BL,RD
      LOGICAL LOGT,LOGY
      REAL TXT1(10),TXT2(10),TXT3(10),TXT4(10)
      INTEGER ITIN,ITOUT,CIN,HDS,POUT,SIN,DOUT
      REAL WERT(7)
      COMMON / LUNIT / ITIN,ITOUT,CIN,HDS,POUT,SIN,DOUT
      DATA TXT1(1)/4HTIME/,TXT1(2)/4H <->/,TXT1(3)/4H CON/,
     @     TXT1(4)/4HCENT/,TXT1(5)/4HRATI/,TXT1(6)/4HON  /,
     @     TXT1(7)/4H    /,TXT1(8)/4H    /,TXT1(9)/4H    /,
     @     TXT1(10)/4H    /
      DATA TXT2(1)/4HTIME/,TXT2(2)/4H <->/,TXT2(3)/4H LOG/,
     @     TXT2(4)/4H OF /,TXT2(5)/4HCONC/,TXT2(6)/4HENTR/,
     @     TXT2(7)/4HATIO/,TXT2(8)/4HN   /,TXT2(9)/4H    /,
     @     TXT2(10)/4H    /
      DATA TXT3(1)/4HLOG /,TXT3(2)/4HOF T/,TXT3(3)/4HIME /,
     @     TXT3(4)/4H<-> /,TXT3(5)/4HCONC/,TXT3(6)/4HENTR/,
     @     TXT3(7)/4HATIO/,TXT3(8)/4HN   /,TXT3(9)/4H    /,
     @     TXT3(10)/4H    /
      DATA TXT4(1)/4HLOG /,TXT4(2)/4HOF T/,TXT4(3)/4HIME /,
     @     TXT4(4)/4H<-> /,TXT4(5)/4HLOG /,TXT4(6)/4HOF C/,
     @     TXT4(7)/4HONCE/,TXT4(8)/4HNTRA/,TXT4(9)/4HTION/,
     @     TXT4(10)/4H    /
      DATA YPLOT(1)/1H^/,YPLOT(121)/1H^/,BL/1H /,RD/1H^/
      DATA IYMEM(1)/1/,IYMEM(2)/1/,IYMEM(3)/1/,IYMEM(4)/1/,IYMEM(5)/1/,
     @     IYMEM(6)/1/,IYMEM(7)/1/,IYMEM(8)/1/,IYMEM(9)/1/,IYMEM(10)/1/
      LOUT=POUT
      DO 15 I=2,120
      YPLOT(I)=BL
   15 CONTINUE
      WRITE(LOUT,8001) TITLE,TEXT
      IF (.NOT. LOGT .AND. .NOT. LOGY) WRITE(LOUT,8002) TXT1
      IF (.NOT. LOGT .AND. LOGY) WRITE(LOUT,8002) TXT2
      IF (LOGT .AND. .NOT. LOGY) WRITE(LOUT,8002) TXT3
      IF (LOGT .AND. LOGY) WRITE(LOUT,8002) TXT4
      IF=KEND+1
      IF (YMIN.NE.YMAX) GOTO 10
      YMIN=SUB(KBEG,1)
      YMAX=YMIN
      DO 11 I=KBEG,IF
      DO 11 J=1,NP
      SCR=SUB(I,J)
      IF (SCR.LT.YMIN) YMIN=SCR
      IF (SCR.GT.YMAX) YMAX=SCR
   11 CONTINUE
   10 CONTINUE
      IF (.NOT. LOGY) GOTO 20
      DO 21 I=KBEG,IF
      DO 21 J=1,NP
      SUB(I,J)=ALOG10(SUB(I,J))
   21 CONTINUE
      YMIN=ALOG10(YMIN)
      YMAX=ALOG10(YMAX)
   20 CONTINUE
      TF=TMAX-TMIN
      YF=YMAX-YMIN
      NF=NLINES+1
      MINT=KBEG
      DO 40 J=1,7
      IPOS=20*(J-1)
      WERT(J)=YMIN+YF/120.*FLOAT(IPOS)
   40 CONTINUE
      WRITE(LOUT,8009) WERT
      WRITE(LOUT,8007)
      WRITE(LOUT,8003)
      DO 30 IL=1,NF
      TMX=TMIN+FLOAT(IL-1)/FLOAT(NLINES)*TF
   32 CONTINUE
      IF (TMX.LE.T(MINT+1)) GOTO 31
      MINT=MINT+1
      GOTO 32
   31 CONTINUE
      DO 33 IP=1,NP
      Y=(SUB(MINT+1,IP)-SUB(MINT,IP))/(T(MINT+1)-T(MINT))*
     @(TMX-T(MINT))+SUB(MINT,IP)
      IY=INT((Y-YMIN)/YF*120.0+1.5)
      IF (IY.LT.1 .OR. IY.GT.121) GOTO 34
      YPLOT(IY)=ISIG(IP)
      IYMEM(IP)=IY
   34 CONTINUE
   33 CONTINUE
      IF (MOD(IL-1,10).EQ.0) GOTO 35
      WRITE(LOUT,8004) YPLOT
      GOTO 36
   35 CONTINUE
      WRITE(LOUT,8005) TMX,YPLOT
   36 CONTINUE
      DO 37 IP=1,NP
      YPLOT(IYMEM(IP))=BL
   37 CONTINUE
      YPLOT(1)=RD
      YPLOT(121)=RD
   30 CONTINUE
      WRITE(LOUT,8003)
      WRITE(LOUT,8007)
      WRITE(LOUT,8009) WERT
      WRITE(LOUT,8006)
      WRITE(LOUT,8010)
      DO 50 IP=1,NP
      WRITE(LOUT,8008) ISIG(IP),SUBNM(1,ISUB(IP)),SUBNM(2,ISUB(IP)),
     @SUBNM(3,ISUB(IP))
   50 CONTINUE
      RETURN
 8001 FORMAT (1H1,18A4/1X,18A4/1X,18A4/1X,18A4/1X,18A4///,15X,8A4/)
 8002 FORMAT (1X,10A4//)
 8003 FORMAT (11X,40H0....;....1....;....2....;....3....;....,
     @            40H4....;....5....;....6....;....7....;....,
     @            41H8....;....9....;....0....;....1....;....2)
 8004 FORMAT (11X,121A1)
 8005 FORMAT (1X,E10.3,121A1)
 8006 FORMAT (//)
 8007 FORMAT (11X,6(1H^,19X),1H^)
 8008 FORMAT (50X,A1,3H - ,2A4,A2)
 8009 FORMAT (1X,E11.4,6(9X,E11.4))
 8010 FORMAT (49X,11HL E G E N D)
      END
      SUBROUTINE PAPLO2(N,T,SUB,KBEG,KEND,NSP,SUBNM,ISUB,NLINES,
     @LOGT,LOGY,ISIG,TMIN,TMAX,YMIN,YMAX,TEXT,TITLE,N1,N2,NP)
      REAL T(N),SUB(N,NP),SUBNM(3,NSP),TITLE(N1,N2)
      INTEGER TEXT(8)
      INTEGER ISUB(NP),ISIG(NP)
      INTEGER YPLOT(61),IYMEM(10),BL,RD
      LOGICAL LOGT,LOGY
      REAL TXT1(10),TXT2(10),TXT3(10),TXT4(10)
      REAL WERT(7)
      INTEGER ITIN,ITOUT,CIN,HDS,POUT,SIN,DOUT
      COMMON / LUNIT / ITIN,ITOUT,CIN,HDS,POUT,SIN,DOUT
      DATA TXT1(1)/4HTIME/,TXT1(2)/4H <->/,TXT1(3)/4H CON/,
     @     TXT1(4)/4HCENT/,TXT1(5)/4HRATI/,TXT1(6)/4HON  /,
     @     TXT1(7)/4H    /,TXT1(8)/4H    /,TXT1(9)/4H    /,
     @     TXT1(10)/4H    /
      DATA TXT2(1)/4HTIME/,TXT2(2)/4H <->/,TXT2(3)/4H LOG/,
     @     TXT2(4)/4H OF /,TXT2(5)/4HCONC/,TXT2(6)/4HENTR/,
     @     TXT2(7)/4HATIO/,TXT2(8)/4HN   /,TXT2(9)/4H    /,
     @     TXT2(10)/4H    /
      DATA TXT3(1)/4HLOG /,TXT3(2)/4HOF T/,TXT3(3)/4HIME /,
     @     TXT3(4)/4H<-> /,TXT3(5)/4HCONC/,TXT3(6)/4HENTR/,
     @     TXT3(7)/4HATIO/,TXT3(8)/4HN   /,TXT3(9)/4H    /,
     @     TXT3(10)/4H    /
      DATA TXT4(1)/4HLOG /,TXT4(2)/4HOF T/,TXT4(3)/4HIME /,
     @     TXT4(4)/4H<-> /,TXT4(5)/4HLOG /,TXT4(6)/4HOF C/,
     @     TXT4(7)/4HONCE/,TXT4(8)/4HNTRA/,TXT4(9)/4HTION/,
     @     TXT4(10)/4H    /
      DATA YPLOT(1)/1H^/,YPLOT(61)/1H^/,BL/1H /,RD/1H^/
      DATA IYMEM(1)/1/,IYMEM(2)/1/,IYMEM(3)/1/,IYMEM(4)/1/,IYMEM(5)/1/,
     @     IYMEM(6)/1/,IYMEM(7)/1/,IYMEM(8)/1/,IYMEM(9)/1/,IYMEM(10)/1/
      LOUT=ITOUT
      DO 15 I=2,60
      YPLOT(I)=BL
   15 CONTINUE
      WRITE(LOUT,8001) TITLE,TEXT
      IF (.NOT. LOGT .AND. .NOT. LOGY) WRITE(LOUT,8002) TXT1
      IF (.NOT. LOGT .AND. LOGY) WRITE(LOUT,8002) TXT2
      IF (LOGT .AND. .NOT. LOGY) WRITE(LOUT,8002) TXT3
      IF (LOGT .AND. LOGY) WRITE(LOUT,8002) TXT4
      IF=KEND+1
      IF (YMIN.NE.YMAX) GOTO 10
      YMIN=SUB(KBEG,1)
      YMAX=YMIN
      DO 11 I=KBEG,IF
      DO 11 J=1,NP
      SCR=SUB(I,J)
      IF (SCR.LT.YMIN) YMIN=SCR
      IF (SCR.GT.YMAX) YMAX=SCR
   11 CONTINUE
   10 CONTINUE
      IF (.NOT. LOGY) GOTO 20
      DO 21 I=KBEG,IF
      DO 21 J=1,NP
      SUB(I,J)=ALOG10(SUB(I,J))
   21 CONTINUE
      YMIN=ALOG10(YMIN)
      YMAX=ALOG10(YMAX)
   20 CONTINUE
      TF=TMAX-TMIN
      YF=YMAX-YMIN
      NF=NLINES+1
      MINT=KBEG
      DO 40 J=1,7
      IPOS=10*(J-1)
      WERT(J)=YMIN+YF/60.*FLOAT(IPOS)
   40 CONTINUE
      WRITE(LOUT,8009) WERT
      WRITE(LOUT,8007)
      WRITE(LOUT,8003)
      DO 30 IL=1,NF
      TMX=TMIN+FLOAT(IL-1)/FLOAT(NLINES)*TF
   32 CONTINUE
      IF (TMX.LE.T(MINT+1)) GOTO 31
      MINT=MINT+1
      GOTO 32
   31 CONTINUE
      DO 33 IP=1,NP
      Y=(SUB(MINT+1,IP)-SUB(MINT,IP))/(T(MINT+1)-T(MINT))*
     @(TMX-T(MINT))+SUB(MINT,IP)
      IY=INT((Y-YMIN)/YF*60.0+1.5)
      IF (IY.LT.1 .OR. IY.GT.61) GOTO 34
      YPLOT(IY)=ISIG(IP)
      IYMEM(IP)=IY
   34 CONTINUE
   33 CONTINUE
      IF (MOD(IL-1,10).EQ.0) GOTO 35
      WRITE(LOUT,8004) YPLOT
      GOTO 36
   35 CONTINUE
      WRITE(LOUT,8005) TMX,YPLOT
   36 CONTINUE
      DO 37 IP=1,NP
      YPLOT(IYMEM(IP))=BL
   37 CONTINUE
      YPLOT(1)=RD
      YPLOT(61)=RD
   30 CONTINUE
      WRITE(LOUT,8003)
      WRITE(LOUT,8007)
      WRITE(LOUT,8009) WERT
      WRITE(LOUT,8006)
      WRITE(LOUT,8010)
      DO 50 IP=1,NP
      WRITE(LOUT,8008) ISIG(IP),SUBNM(1,ISUB(IP)),SUBNM(2,ISUB(IP)),
     @SUBNM(3,ISUB(IP))
   50 CONTINUE
      RETURN
 8001 FORMAT (1H ,18A4/1X,18A4/1X,18A4/1X,18A4/1X,18A4///,15X,8A4/)
 8002 FORMAT (1X,10A4//)
 8003 FORMAT (11X,40H0....;....1....;....2....;....3....;....,
     @            21H4....;....5....;....6)
 8004 FORMAT (11X,61A1)
 8005 FORMAT (1X,E10.2,61A1)
 8006 FORMAT (//)
 8007 FORMAT (11X,6(1H^,9X),1H^)
 8008 FORMAT (30X,A1,3H - ,2A4,A2)
 8009 FORMAT (2X,E10.2,6(E10.2))
 8010 FORMAT (29X,11HL E G E N D)
      END
      SUBROUTINE EXPLO1(N,X,Y,P,D,H,HP,PH,XPLOT,YPLOT,IPLOT,SIGMA,
     @KBEG,KEND,XMIN,XMAX,YMIN,YMAX,IPMAX,YM,CORRF,LOGY)
      DIMENSION X(N),Y(N),P(N),D(N),H(N),HP(N),PH(N)
      DIMENSION XPLOT(IPMAX),YPLOT(IPMAX)
      LOGICAL WHINT,LOGY
      INTEGER ITIN,ITOUT,CIN,HDS,POUT,SIN,DOUT
      COMMON / LUNIT / ITIN,ITOUT,CIN,HDS,POUT,SIN,DOUT
      CORR=1.
      IPLOT=1
      XPLOT(1)=X(KBEG)
      YPLOT(1)=Y(KBEG)
      DO 10 INTER=KBEG,KEND
      INTER1=INTER+1
      XL=X(INTER)
      XH=X(INTER1)
      YL=Y(INTER)
      YH=Y(INTER1)
      DL=D(INTER)
      DH=D(INTER1)
      HI=H(INTER)
      RMY=HP(INTER)/2.
      WHINT=.TRUE.
   30 CONTINUE
      HI2=HI*HI
      IF (IPLOT.GE.IPMAX-2) GOTO 90
      SIGMAQ=HI2/8.*(ABS(DL)+ABS(DH))
      CALL EVAL(N,X,Y,P,D,H,HP,PH,XH,YH,INTER,IER)
      IF (LOGY) CORR=CORRF*ABS(ALOG10(YH)-ALOG10(YL))
      VGL=SIGMA/YM/CORR
      IF (SIGMAQ.LE.VGL) GOTO 20
      WHINT=.FALSE.
      EXPRMY=EXP(RMY)
      DH=(DL+DH)/(EXPRMY+1./EXPRMY)
      HI=HI/2.
      RMY=RMY/2.
      XH=(XL+XH)/2.
      GOTO 30
   20 CONTINUE
      IF (WHINT) GOTO 40
      IF (XH.LT.XMIN) GOTO 50
      IPLOT=IPLOT+1
   50 CONTINUE
      XPLOT(IPLOT)=XH
      YPLOT(IPLOT)=YH
      IF (IPLOT.NE.2) GOTO 60
      YPLOT(1)=(YPLOT(2)-YPLOT(1))/(XPLOT(2)-XPLOT(1))*
     @(XMIN-XPLOT(1))+YPLOT(1)
      XPLOT(1)=XMIN
   60 CONTINUE
      IF (XH.LT.XMAX) GOTO 70
      YPLOT(IPLOT)=(YPLOT(IPLOT)-YPLOT(IPLOT-1))/(XPLOT(IPLOT)-
     @XPLOT(IPLOT-1))*(XMAX-XPLOT(IPLOT))+YPLOT(IPLOT)
      XPLOT(IPLOT)=XMAX
      GOTO 100
   70 CONTINUE
      XL=XH
      XH=X(INTER1)
      YL=YH
      YH=Y(INTER1)
      DL=DH
      DH=D(INTER1)
      HI=XH-XL
      RMY=P(INTER)*HI/2.
      WHINT=.TRUE.
      GOTO 30
   40 CONTINUE
      IPLOT=IPLOT+1
      XPLOT(IPLOT)=X(INTER1)
      YPLOT(IPLOT)=Y(INTER1)
      IF (IPLOT.NE.2) GOTO 80
      YPLOT(1)=(YPLOT(2)-YPLOT(1))/(XPLOT(2)-XPLOT(1))*
     @(XMIN-XPLOT(1))+YPLOT(1)
      XPLOT(1)=XMIN
   80 CONTINUE
      IF (XH.LT.XMAX) GOTO 10
      YPLOT(IPLOT)=(YPLOT(IPLOT)-YPLOT(IPLOT-1))/(XPLOT(IPLOT)-
     @XPLOT(IPLOT-1))*(XMAX-XPLOT(IPLOT))+YPLOT(IPLOT)
      XPLOT(IPLOT)=XMAX
      GOTO 100
   10 CONTINUE
      GOTO 100
   90 CONTINUE
      WRITE(ITOUT,7001)
  100 CONTINUE
      DO 110 I=1,IPLOT
      SCR=YPLOT(I)
      IF (SCR.LT.YMIN) SCR=YMIN
      IF (SCR.GT.YMAX) SCR=YMAX
      IF (LOGY) SCR=CORRF*(ALOG10(SCR)-ALOG10(YMIN))
      YPLOT(I)=SCR
  110 CONTINUE
      RETURN
 7001 FORMAT(50H **WARNING**  NUMBER OF PLOT POINTS EXCEEDS BOUNDS)
      END
      SUBROUTINE EXPLO2(N,T,Y,Z,PY,DY,HPY,PHY,PZ,DZ,HPZ,PHZ,H,XPLOT,
     @YPLOT,IPLOT,SIGMA,KBEG,KEND,TMIN,TMAX,YMIN,YMAX,ZMIN,ZMAX,IPMAX)
      DIMENSION T(N),Y(N),Z(N),H(N)
      DIMENSION PY(N),DY(N),HPY(N),PHY(N)
      DIMENSION PZ(N),DZ(N),HPZ(N),PHZ(N)
      DIMENSION XPLOT(IPMAX),YPLOT(IPMAX)
      LOGICAL WHINT
      INTEGER ITIN,ITOUT,CIN,HDS,POUT,SIN,DOUT
      COMMON / LUNIT / ITIN,ITOUT,CIN,HDS,POUT,SIN,DOUT
      IPLOT=1
      XPLOT(1)=Y(KBEG)
      YPLOT(1)=Z(KBEG)
      DO 10 INTER=KBEG,KEND
      INTER1=INTER+1
      XL=T(INTER)
      XH=T(INTER1)
      DLY=DY(INTER)
      DHY=DY(INTER1)
      DLZ=DZ(INTER)
      DHZ=DZ(INTER1)
      HI=H(INTER)
      RMYY=HPY(INTER)/2.
      RMYZ=HPZ(INTER)/2.
      WHINT=.TRUE.
   30 CONTINUE
      HI2=HI*HI
      IF (IPLOT.GE.IPMAX-2) GOTO 90
      IF (.177*HI2*AMAX1(ABS(DLY)+ABS(DHY),ABS(DLZ)+ABS(DHZ)).LE.
     @SIGMA) GOTO 20
      WHINT=.FALSE.
      EXPRMY=EXP(RMYY)
      DHY=(DLY+DHY)/(EXPRMY+1./EXPRMY)
      EXPRMZ=EXP(RMYZ)
      DHZ=(DLZ+DHZ)/(EXPRMZ+1./EXPRMZ)
      HI=HI/2.
      RMYY=RMYY/2.
      RMYZ=RMYZ/2.
      XH=(XL+XH)/2.
      GOTO 30
   20 CONTINUE
      IF (WHINT) GOTO 40
      CALL EVAL(N,T,Y,PY,DY,H,HPY,PHY,XH,YY,INTER,IER)
      CALL EVAL(N,T,Z,PZ,DZ,H,HPZ,PHZ,XH,ZZ,INTER,IER)
      IF (XH.LT.TMIN) GOTO 50
      IPLOT=IPLOT+1
   50 CONTINUE
      XPLOT(IPLOT)=YY
      YPLOT(IPLOT)=ZZ
      IF (IPLOT.NE.2) GOTO 60
      XPLOT(1)=(XPLOT(2)-XPLOT(1))/HI*(TMIN-XL)+XPLOT(1)
      YPLOT(1)=(YPLOT(2)-YPLOT(1))/HI*(TMIN-XL)+YPLOT(1)
   60 CONTINUE
      IF (XH.LT.TMAX) GOTO 70
      XPLOT(IPLOT)=(XPLOT(IPLOT)-XPLOT(IPLOT-1))/HI*
     @(TMAX-XH)+XPLOT(IPLOT)
      YPLOT(IPLOT)=(YPLOT(IPLOT)-YPLOT(IPLOT-1))/HI*
     @(TMAX-XH)+YPLOT(IPLOT)
      GOTO 100
   70 CONTINUE
      XL=XH
      XH=T(INTER1)
      DLY=DHY
      DHY=DY(INTER1)
      DLZ=DHZ
      DHZ=DZ(INTER1)
      HI=XH-XL
      RMYY=PY(INTER)*HI/2.
      RMYZ=PZ(INTER)*HI/2.
      WHINT=.TRUE.
      GOTO 30
   40 CONTINUE
      IPLOT=IPLOT+1
      XPLOT(IPLOT)=Y(INTER1)
      YPLOT(IPLOT)=Z(INTER1)
      IF (IPLOT.NE.2) GOTO 80
      XPLOT(1)=(XPLOT(2)-XPLOT(1))/HI*(TMIN-XL)+XPLOT(1)
      YPLOT(1)=(YPLOT(2)-YPLOT(1))/HI*(TMIN-XL)+YPLOT(1)
   80 CONTINUE
      IF (XH.LT.TMAX) GOTO 10
      XPLOT(IPLOT)=(XPLOT(IPLOT)-XPLOT(IPLOT-1))/HI*
     @(TMAX-XH)+XPLOT(IPLOT)
      YPLOT(IPLOT)=(YPLOT(IPLOT)-YPLOT(IPLOT-1))/HI*
     @(TMAX-XH)+YPLOT(IPLOT)
      GOTO 100
   10 CONTINUE
      GOTO 100
   90 CONTINUE
      WRITE(ITOUT,7001)
  100 CONTINUE
      DO 110 I=1,IPLOT
      SCR=XPLOT(I)
      IF (SCR.LT.YMIN) SCR=YMIN
      IF (SCR.GT.YMAX) SCR=YMAX
      XPLOT(I)=SCR
      SCR=YPLOT(I)
      IF (SCR.LT.ZMIN) SCR=ZMIN
      IF (SCR.GT.ZMAX) SCR=ZMAX
      YPLOT(I)=SCR
  110 CONTINUE
      RETURN
 7001 FORMAT(50H **WARNING**  NUMBER OF PLOT POINTS EXCEEDS BOUNDS)
      END
      SUBROUTINE EXSPLC(N,X,Y,P,D,DQ,H,HP,PH,R,Q,IER)
      REAL X(N),Y(N),D(N),DQ(N),H(N),HP(N),PH(N),P(N)
      REAL R(N),Q(N)
      PHI(A)=((0.277140E-5*A+0.198409E-3)*A+
     A0.833333E-2)*A+0.166666
      IF(N.GT.4) GOTO 100
      IER=1
      RETURN
100   CONTINUE
      U=Y(1)
      DO 10 I=2,N
      I1=I-1
      H(I1)=X(I)-X(I1)
      IF(H(I1).GE.0.) GOTO 110
      IER=2
      RETURN
110   CONTINUE
      HP(I1)=ABS(P(I1)*H(I1))
      V=Y(I)
      IF(H(I1).GT.0.) GOTO 11
      D(I)=V
      GOTO 12
11    D(I)=(V-U)/H(I1)
12    U=V
      IF(HP(I1).LE.0.5) GOTO 13
      PH(I1)=EXP(-HP(I1))
      C=PH(I1)*PH(I1)
      C1=1.-C
      C11=C1
      C2=C1/HP(I1)
      C1=C1*HP(I1)/H(I1)
      Q(I)=(1.-C2+C)/C1
      R(I)=(C2-2.*PH(I1))/C1
      PH(I1)=C11
      GOTO 10
13    C=HP(I1)*HP(I1)
      PH(I1)=PHI(C)
      W=H(I1)/(1.+C*PH(I1))
      C=C*0.25
      C2=1.+C*PHI(C)
      Q(I)=(0.5*C2*C2-PH(I1))*W
      R(I)=PH(I1)*W
10    CONTINUE
      N1=N-1
      U=0.
      D(1)=0.
      DO 20 I=2,N1
      Q(I)=Q(I)+Q(I+1)-U*R(I)
      DQ(I)=D(I+1)-D(I)
      D(I)=DQ(I)-U*D(I-1)
20    U=R(I+1)/Q(I)
      D(N)=0.
      DO 21 II=2,N1
      I=N-II+1
21    D(I)=(D(I)-R(I+1)*D(I+1))/Q(I)
      RETURN
      END
      SUBROUTINE GENER(N,X,Y,P,D,DQ,H)
      REAL X(N),Y(N),P(N),D(N),DQ(N),H(N)
      N2=N-2
      Y11=Y(1)
      IF(H(1).GT.0.) Y11=Y(2)
      Y1=ABS(Y11)
      D1=D(2)*DQ(2)
      DO 10 I=2,N2
      I1=I+1
      D2=D(I1)*DQ(I1)
      Y2=ABS(Y(I1))
      IF(Y2.GT.Y1) Y1=Y2
      IF(D1*D2.GT.0.) GOTO 110
      IF(Y1.GT.0.) GOTO 111
      P(I)=15./H(I)
      GOTO 100
111   P(I)=(4.+1./(0.1+ABS(Y(I1)-Y11)/Y1))/H(I)
      GOTO 100
110   P(I)=0.
100   Y11=Y(I1)
      Y1=Y2
      D1=D2
10    CONTINUE
      IF(H(1).GT.0.) P(1)=P(2)*H(2)/H(1)
      IF(H(N-1).GT.0.) P(N-1)=P(N2)*H(N2)/H(N-1)
      RETURN
      END
      SUBROUTINE EVAL(N,X,Y,P,D,H,HP,PH,XX,EX,I,IER)
      REAL X(N),Y(N),P(N),D(N),H(N),HP(N),PH(N)
      PHI(A)=((0.277140E-5*A+0.198409E-3)*A+
     A0.833333E-2)*A+0.166666
      IF(I.LT.N) GOTO 10
      IER=1
      RETURN
10    CONTINUE
      I1=I+1
      T=(XX-X(I))/H(I)
      T1=1.-T
      IF(T.LE.1. .AND. T.GE.0.) GOTO 20
      IER=2
      RETURN
20    CONTINUE
      IF(HP(I).GT.0.5) GOTO 30
      E=T*HP(I)
      E1=T1*HP(I)
      C=H(I)*H(I)/(1.+HP(I)*HP(I)*PH(I))
      EX=T*(Y(I1)+D(I1)*C*(T*T*PHI(E*E)-PH(I))) +
     A   T1*(Y(I)+D(I)*C*(T1*T1*PHI(E1*E1)-PH(I)))
      RETURN
30    CONTINUE
      E=EXP(-T*HP(I))
      E1=EXP(-T1*HP(I))
      EX=Y(I1)*T+Y(I)*T1+
     A   (D(I1)*(E1*(1.-E*E)/PH(I)-T)+D(I)*(E*(1.-E1*E1)/PH(I)-T1))/
     B   (P(I)*P(I))
      RETURN
      END
      SUBROUTINE PLOT1(NREST,XPLOT,YPLOT,XL,YL,TITLE,N1,N2,TEXT,
     @XLQ,YLQ,TXTX,TXTY,ILX,ILY,XMINQ,YMINQ,DELTAX,DELTAY)
      REAL TITLE(N1,N2)
      INTEGER TEXT(8)
      REAL TXTX(10),TXTY(10)
      REAL XPLOT(NREST),YPLOT(NREST)
      REAL SN(3)
      INTEGER NPLO(8),NMPLO,NCURVE,IMARK
      REAL XMI,XMA,YMI,YMA
      REAL XP(250,8),YP(250,8),XMP(125,8),YMP(125,8)
      REAL SPNAME,XAMI,XAMA,YAMI,YAMA
      COMMON / PLOPC / SPNAME(3,8),XAMI,XAMA,YAMI,YAMA,IFLAG(10)
      NDCL1=8
      NDCL2=250
      NDCL3=125
      NCURVE=0
      NMPLO=0
      IMARK=1
      XEND=XL-2.5
      YEND=YL-2.0
      YLS=YL+5.0
      DO 1 I=1,5
      YLS=YLS-0.6
    1 CONTINUE
      RETURN
      ENTRY PLOT2(NREST,XPLOT,YPLOT,IPLOT,M,IC,XVS,YVS,SN)
      NCURVE=NCURVE+1
      DO 100 I=1,IPLOT
      XP(I,NCURVE)=XPLOT(I)
      IF(M.EQ.1) XMP(I,NCURVE)=XPLOT(I)
      YP(I,NCURVE)=YPLOT(I)
      IF(M.EQ.1) YMP(I,NCURVE)=YPLOT(I)
100   CONTINUE
      NPLO(NCURVE)=IPLOT
      IF(M.EQ.1) NMPLO=IPLOT
      IF(IFLAG(3).EQ.1) RETURN
      SPNAME(1,NCURVE)=SN(1)
      SPNAME(2,NCURVE)=SN(2)
      SPNAME(3,NCURVE)=SN(3)
      RETURN
      ENTRY PLOT3(NREST,XPLOT,YPLOT,IPLOT)
      DO 200 I=1,IPLOT
      XMP(I,NCURVE)=XPLOT(I)
      YMP(I,NCURVE)=YPLOT(I)
200   CONTINUE
      NMPLO=IPLOT
      RETURN
      ENTRY PLOT4(NREST,XPLOT,YPLOT,TEXT)
      IF(NMPLO.EQ.0) IMARK=0
      XMI=XP(1,1)
      XMA=XP(NPLO(1),1)
      YMI=1.E30
      YMA=-1.E30
      YMA=-1.E30
      YMA=-1.E30
      YMA=-1.E30
      YMA=-1.E30
      DO 300 ICC=1,NCURVE
      IPLT=NPLO(ICC)
      DO 300 I=1,IPLT
      IF(XP(I,ICC).GT.XMA) XMA=XP(I,ICC)
      IF(XP(I,ICC).LT.XMI) XMI=XP(I,ICC)
      IF(YP(I,ICC).GT.YMA) YMA=YP(I,ICC)
      IF(YP(I,ICC).LT.YMI) YMI=YP(I,ICC)
300   CONTINUE 
      CALL PLOTPC (XMI,XMA,YMI,YMA,XP,YP,XMP,YMP,NPLO,NMPLO,IMARK,
     1          NCURVE,NDCL1,NDCL2,NDCL3,TEXT,SPNAME,IFLAG,
     2          XAMI,XAMA,YAMI,YAMA)
      RETURN
      END
 
