      SUBROUTINE INITAL
C...
C...  NUMOL SOLUTION OF EQUATIONS (7.22) TO (7.25)
C...
      COMMON/T/   TIME
     1      /Y/  T(51)
     2      /F/ TT(51)
C...
C...  TYPE SELECTED VARIABLES AS REAL
      REAL L, X(51)
C...
C...  CALCULATE PI FOR USE IN DO LOOP 1
      PI=ACOS(-1.0)
C...
C...  LENGTH
      L=1.0
C...
C...  GRID SPACING
      N=51
      DX=L/FLOAT(N-1)
C...
C...  INITIAL CONDITION (7.23)
      DO 1 I=1,N
         X(I)=FLOAT(I-1)*DX
         T(I)=COS(PI*X(I)/L)
1     CONTINUE
      RETURN
      END
      SUBROUTINE DERV
      COMMON/T/   TIME
     1      /Y/  T(51)
     2      /F/ TT(51)
C...
C...  TYPE SELECTED VARIABLES AS REAL
      REAL L, TX(51), TXX(51)
C...
C...  LENGTH
      L=1.
C...
C...  DERIVATIVE TX
      N=51
      CALL DSS002(0.,L,N,T,TX)
C...
C...  BOUNDARY CONDITION (7.24)
      TX(1)=0.
C...
C...  BOUNDARY CONDITION (7.25)
      TX(N)=0.
C...
C...  DERIVATIVE TXX
      CALL DSS002(0.,L,N,TX,TXX)
C...
C...  EQUATION (7.22)
      DO 2 I=1,N
      TT(I)=TXX(I)
2     CONTINUE
      RETURN
      END
      SUBROUTINE PRINT(NI,NO)
      COMMON/T/   TIME
     1      /Y/  T(51)
     2      /F/ TT(51)
C...
C...  TYPE SELECTED VARIABLES AS REAL
      REAL TE(51), DIFF(51)
C...
C...  CALCULATE THE EXACT SOLUTION (EQUATION (7.26)), AND THE DIFFERENCE 
C...  BETWEEN THE NUMOL AND EXACT SOLUTIONS
      N=51
      DO 3 I=1,N,10
      TE(I)=EXACT(I,TIME)
      DIFF(I)=T(I)-TE(I)
3     CONTINUE
C...
C...  PRINT THE NUMOL SOLUTION 
      WRITE(NO,2)TIME,(T(I),I=1,N,10),
     1               (TE(I),I=1,N,10),
     2             (DIFF(I),I=1,N,10)
2     FORMAT(' TIME = ',F6.2,/,15X,'  X=0',5X,'X=0.2',5X,'X=0.4',5X,
     1                             'X=0.6',5X,'X=0.8',5X,'  X=1',/,
     2                         '    T(X,T)',6F10.6,/,
     3                         '   TE(X,T)',6F10.6,/,
     4                         ' DIFF(X,T)',6F10.6,/)
      RETURN
      END
      REAL FUNCTION EXACT(I,T)
C...
C...  FUNCTION EXACT COMPUTES THE EXACT SOLUTION TO EQUATIONS (7.22)
C...  TO (7.25), I.E., EQUATION (7.26), AT GRID INDEX I AND TIME T
C...
C...  NUMBER OF GRID POINTS
      PARAMETER (N=51)
C...
C...  TYPE SELECTED VARIABLES AS REAL
      REAL L
C...
C...  PI FOR USE IN THE EXACT SOLUTION
      PI=ACOS(-1.)
C...
C...  LENGTH
      L=1.
C...
C...  GRID SPACING
      DX=L/FLOAT(N-1)
C...
C...  X FOR WHICH THE EXACT SOLUTION IS TO BE COMPUTED
      X=FLOAT(I-1)*DX
C...
C...  EXACT SOLUTION AT X AND T
      EXACT=EXP((-PI**2/L**2)*T)*COS(PI*X/L)
      RETURN
      END
