*DECK PRO2P1
      SUBROUTINE INITAL
C...
C...  SUBROUTINE INITAL IS CALLED BY MAIN PROGRAM PRO1P3 TO DEFINE THE
C...  INITIAL CONDITION IN THE NUMOL SOLUTION OF EQUATIONS (1.21) TO
C...  (1.24)
C...
      COMMON/T/   TIME
     1      /Y/  T(51)
     2      /F/ TT(51)
     3      /R/  X(51),   TX(51),  TXX(51),   TE(51), DIFF(51),
     4               L,       PI,       DX
     5      /I/      N
C...
C...  TYPE SELECTED VARIABLES AS REAL
      REAL L
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 (1.22)
      DO 1 I=1,N
         X(I)=FLOAT(I-1)*DX
         T(I)=SIN(PI*X(I)/L)
1     CONTINUE
      RETURN
      END
      SUBROUTINE DERV
C...
C...  SUBROUTINE DERV IS CALLED BY INTEGRATOR RKF45 TO DEFINE THE
C...  ODES IN THE NUMOL SOLUTION OF EQUATIONS (1.21) TO (1.24)
C...
      COMMON/T/   TIME
     1      /Y/  T(51)
     2      /F/ TT(51)
     3      /R/  X(51),   TX(51),  TXX(51),   TE(51), DIFF(51),
     4               L,       PI,       DX
     5      /I/      N
C...
C...  TYPE SELECTED VARIABLES AS REAL
      REAL L
C...
C...  BOUNDARY CONDITION (1.23)
       T(1)=0.
      TT(1)=0.
C...
C...  BOUNDARY CONDITION (1.24)
       T(N)=0.
      TT(N)=0.
C...
C...  DERIVATIVE TX
      CALL DSS002(0.,L,N,T,TX)
C...
C...  DERIVATIVE TXX
      CALL DSS002(0.,L,N,TX,TXX)
C...
C...  EQUATION (1.21)
      DO 2 I=2,N-1
      TT(I)=TXX(I)
2     CONTINUE
      RETURN
      END
      SUBROUTINE PRINT(NI,NO)
C...
C...  SUBROUTINE PRINT IS CALLED BY MAIN PROGRAM PRO1P3 TO PRINT THE
C...  NUMOL SOLUTION OF EQUATIONS (1.21) TO (1.24)
C...
      COMMON/T/   TIME
     1      /Y/  T(51)
     2      /F/ TT(51)
     3      /R/  X(51),   TX(51),  TXX(51),   TE(51), DIFF(51),
     4               L,       PI,       DX
     5      /I/      N
C...
C...  TYPE SELECTED VARIABLES AS REAL
      REAL L
C...
C...  CALCULATE THE EXACT SOLUTION, AND THE DIFFERENCE BETWEEN THE
C...  NUMOL AND EXACT SOLUTIONS
      DO 3 I=1,N,10
      TE(I)=EXACT(I)
      DIFF(I)=T(I)-TE(I)
3     CONTINUE
C...
C...  PRINT THE NUMOL SOLUTION TO EQUATIONS (1.21) TO (1.24)
      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)
C...
C...  FUNCTION EXACT COMPUTES THE EXACT SOLUTION TO EQUATIONS (1.21)
C...  TO (1.24), I.E., EQUATION (1.25), AT GRID INDEX I AND TIME T
C...
      COMMON/T/   TIME
     1      /Y/  T(51)
     2      /F/ TT(51)
     3      /R/  X(51),   TX(51),  TXX(51),   TE(51), DIFF(51),
     4               L,       PI,       DX
     5      /I/      N
C...
C...  TYPE SELECTED VARIABLES AS REAL
      REAL L
C...
C...  EXACT SOLUTION AT X AND T
      EXACT=EXP((-PI**2/L**2)*TIME)*SIN(PI*X(I)/L)
      RETURN
      END
