

      SUBROUTINE PLOT(D,L,M)
C
C      AUTHOR K.J. JOHNSON
C
      INTEGER CHAR(4)
      DOUBLE PRECISION X(50),Y(50,3),D(20),XX,YMAX,YMID,YMIN,YSCALE
      DOUBLE PRECISION WIDTH
      DIMENSION LINE(51),NN(3)
      DATA LINE/51*' '/,CHAR/'+','-','*',' '/
      DATA LENGTH,WIDTH/50,50./
C     CALCULATE Y FOR X = 25 TO 1227 STEP 40
      X(1) = 300.
      DO 300 I=1,L
      XX=X(I)
      Y(I,M)=D(1)+D(2)/XX+D(3)*XX+D(4)/(XX*XX)+D(5)*DLOG10(XX)
      X(I+1)=X(I)+40.
  300 CONTINUE
C     FIND MINIMUM AND MAXIMUM Y AND SET SCALING FACTORS
      YMIN=Y(1,1)
      YMAX=Y(1,1)
      DO 10 I=1,L
      DO 10 J=1,M
      IF(Y(I,J).GT.YMAX)YMAX=Y(I,J)
   10 IF (Y(I,J).LT.YMIN) YMIN=Y(I,J)
      YSCALE=WIDTH/(YMAX-YMIN)
      YMID=(YMAX+YMIN)/2.
      ISKIP=L/LENGTH+1
      IF (MOD(L,LENGTH).EQ.0) ISKIP=ISKIP-1
      WRITE (6,11) YMIN,YMID,YMAX
C
C     PLOT ONE LINE AT A TIME
C
      DO 40 I=1,L,ISKIP
      DO 30 J=1,M
      NN(J)=(Y(I,J)-YMIN)*YSCALE + 1.5
   30 LINE(NN(J))=CHAR(J)
      NMAX=AMAX0(NN(1),NN(2),NN(3))
      WRITE (6,22) X(I), (LINE(JJ),JJ=1,NMAX)
      DO 25 J=1,M
   25 LINE(NN(J))=CHAR(4)
   40 CONTINUE
   11 FORMAT (/3X,'TEMP',25X,'   LOG (K)   ',//,9X,G12.3,12X,G12.3,12X
     1G12.3,/,14X,':',24X,':',24X,':',/,
     213X,':+----+----+----+----+----+----+----+----+----+----+')
   22 FORMAT (6X,F7.2,' :',51A1)
      RETURN
      END
