      SUBROUTINE INITAL
C...
C...  NUMOL SOLUTION OF FOUR PROBLEMS (THROUGH THE SELECTION OF
C...  SUBROUTINE DERV1, DERV2, DERV3 OR DERV4 IN SUBROUTINE DERV)
C...
      COMMON/T/   TIME,   NSTOP,   NORUN
     1      /Y/  T(51)
     2      /F/ TT(51)
     3      /S/     XL,      DX,  TX(51), TXX(51)
     4      /I/      N
C...
C...  LENGTH
      XL=1.0
C...
C...  NUMBER OF GRID POINTS, GRID SPACING
      N=51
      DX=XL/FLOAT(N-1)
C...
C...  INITIAL CONDITION (7.59)
      DO 1 I=1,N
         T(I)=0.
1     CONTINUE
      RETURN
      END
      SUBROUTINE DERV
      COMMON/T/   TIME,   NSTOP,   NORUN
     1      /Y/  T(51)
     2      /F/ TT(51)
     3      /S/     XL,      DX,  TX(51), TXX(51)
     4      /I/      N
C...
C...  SELECT PROBLEM
      IF(NORUN.EQ.1)CALL DERV1
      IF(NORUN.EQ.2)CALL DERV2
      IF(NORUN.EQ.3)CALL DERV3
      IF(NORUN.EQ.4)CALL DERV4
      RETURN
      END
      SUBROUTINE DERV1
      COMMON/T/   TIME,   NSTOP,   NORUN
     1      /Y/  T(51)
     2      /F/ TT(51)
     3      /S/     XL,      DX,  TX(51), TXX(51)
     4      /I/      N
C...
C...  NONLINEAR PROBLEM, T  = (KT ) , K = 1 + T
C...                      T      X X
C...
C...  BOUNDARY CONDITION (7.58)
      T(N)=1.0
C...
C...  DERIVATIVE TX
      CALL DSS002(0.,XL,N,T,TX)
C...
C...  BOUNDARY CONDITION (7.57)
      TX(1)=0.
C...
C...  NONLINEARITY
      DO 1 I=1,N
      TX(I)=(1.0+T(I))*TX(I)
1     CONTINUE
C...
C...  DERIVATIVE TXX
      CALL DSS002(0.,XL,N,TX,TXX)
C...
C...  EQUATION (7.54)
      DO 2 I=1,N
      TT(I)=TXX(I)
2     CONTINUE
      RETURN
      END
      SUBROUTINE DERV2
      COMMON/T/   TIME,   NSTOP,   NORUN
     1      /Y/  T(51)
     2      /F/ TT(51)
     3      /S/     XL,      DX,  TX(51), TXX(51)
     4      /I/      N
C...
C...  NONLINEAR PROBLEM, T  = KT  + (DK/DT)*(T )*(T ), K = 1 + T
C...                      T     XX            X    X
C...
C...  BOUNDARY CONDITION (7.58)
      T(N)=1.0
C...
C...  DERIVATIVE TX
      CALL DSS002(0.,XL,N,T,TX)
C...
C...  BOUNDARY CONDITION (7.57)
      TX(1)=0.
C...
C...  DERIVATIVE TXX
      CALL DSS002(0.,XL,N,TX,TXX)
C...
C...  EQUATION (7.55)
      DO 2 I=1,N
      TT(I)=(1.0+T(I))*TXX(I)+TX(I)**2
2     CONTINUE
      RETURN
      END
      SUBROUTINE DERV3
      COMMON/T/   TIME,   NSTOP,   NORUN
     1      /Y/  T(51)
     2      /F/ TT(51)
     3      /S/     XL,      DX,  TX(51), TXX(51)
     4      /I/      N
C...
C...  TYPE SELECTED VARIABLES AS REAL
      REAL KIP1, KI, KIM1
C...
C...  NONLINEAR PROBLEM, T  = (KT ) , K = 1 + T
C...                      T      X X
C...
C...  BOUNDARY CONDITION (7.58)
      T(N)=1.0
C...
C...  EQUATIONS (7.54) AND (7.56)
      DO 2 I=1,N
C...
C...     X=0
         IF(I.EQ.1)THEN
            T0=T(2)
            KIP1=1.0+T(2)
            KI  =1.0+T(1)
            KIM1=1.0+T0
            TERM1=0.5*(KIP1+KI)*(T(2)-T(1))/DX
            TERM2=0.5*(KI+KIM1)*(T(1)-T0  )/DX
            TT(1)=(TERM1-TERM2)/DX
C...
C...     X=1
         ELSE IF(I.EQ.N)THEN
            TT(N)=0.
C...
C...     X NE 0 OR 1
         ELSE
            KIP1=1.0+T(I+1)
            KI  =1.0+T(I)
            KIM1=1.0+T(I-1)
            TERM1=0.5*(KIP1+KI)*(T(I+1)-T(I))/DX
            TERM2=0.5*(KI+KIM1)*(T(I)-T(I-1))/DX
            TT(I)=(TERM1-TERM2)/DX
         END IF
2     CONTINUE
      RETURN
      END
      SUBROUTINE DERV4
      COMMON/T/   TIME,   NSTOP,   NORUN
     1      /Y/  T(51)
     2      /F/ TT(51)
     3      /S/     XL,      DX,  TX(51), TXX(51)
     4      /I/      N
C...
C...  LINEAR PROBLEM T  = T
C...                  T    XX
C...
C...  BOUNDARY CONDITION (7.58)
      T(N)=1.0
C...
C...  DERIVATIVE TX
      CALL DSS002(0.,XL,N,T,TX)
C...
C...  BOUNDARY CONDITION (7.57)
      TX(1)=0.
C...
C...  DERIVATIVE TXX
      CALL DSS002(0.,XL,N,TX,TXX)
C...
C...  EQUATION (7.11)
      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)
     3      /S/     XL,      DX,  TX(51), TXX(51)
     4      /I/      N
C...
C...  PRINT THE NUMOL SOLUTION 
      WRITE(NO,2)TIME,(T(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,/)
      RETURN
      END
