*DECK PRO1P3
      SUBROUTINE INITAL
C...
C...  SUBROUTINE INITAL IS CALLED BY MAIN PROGRAM PRO1P3 TO DEFINE THE
C...  INITIAL CONDITION IN THE NUMOL SOLUTION OF EQUATIONS (3.73) TO
C...  (3.75)
C...
      COMMON/T/   TIME,  NSTOP,  NORUN
     1      /Y/  T(51)
     2      /F/ TT(51)
C...
C...  TYPE SELECTED VARIABLES AS REAL
      REAL L
C...
C...  LENGTH
      L=1.0
C...
C...  GRID SPACING
      N=51
C...
C...  INITIAL CONDITION (3.75)
      DO 1 I=1,N
      T(I)=0.
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 (3.73) TO (3.75) USING
C...  FIRST ORDER UPWIND APPROXIMATIONS (DSS012 CALLED WHEN NORUN = 1)
C...  OR SECOND ORDER UPWIND APPROXIMATIONS (DSS014 CALLED WHEN NORUN
C...  = 2)
C...
      COMMON/T/   TIME,  NSTOP,  NORUN
     1      /Y/  T(51)
     2      /F/ TT(51)
C...
C...  TYPE SELECTED VARIABLES AS REAL
      REAL L, TX(51)
C...
C...  LENGTH AND NUMBER OF GRID POINTS
      L=1.
      N=51
C...
C...  BOUNDARY CONDITION (3.74)
      T(1)=1.
      TT(1)=0.
C...
C...  DERIVATIVE TX
      V=1.
      IF(NORUN.EQ.1)THEN
         CALL DSS012(0.,L,N,T,TX,V)
      ELSE IF(NORUN.EQ.2)THEN
         CALL DSS014(0.,L,N,T,TX,V)
      END IF
C...
C...  EQUATION (3.73)
      DO 1 I=2,N
      TT(I)=-TX(I)
1     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 (3.73) TO (3.75)
C...
      COMMON/T/   TIME,  NSTOP,  NORUN
     1      /Y/  T(51)
     2      /F/ TT(51)
C...
C...  PRINT A HEADING FOR THE SOLUTION AND INITIALIZE THE SUM OF
C...  SQUARES OF THE ERRORS
      IF(TIME.LT.0.001)THEN
      WRITE(NO,1)
1     FORMAT('   ADVECTION EQUATION',//,
     1    3X,'   TIME      T(0,t)      T(1,t)     TE(1,t)       DIFF')
      SSE=0.
      END IF
C...
C...  CALCULATE THE EXACT SOLUTION, AND THE DIFFERENCE BETWEEN THE
C...  NUMOL AND EXACT SOLUTIONS
      N=51
      IF(TIME.LT.1.)TE=0.
      IF(TIME.EQ.1.)TE=0.5
      IF(TIME.GT.1.)TE=1.
      DIFF=T(N)-TE
C...
C...  PRINT THE NUMOL AND EXACT SOLUTIONS
      WRITE(NO,2)TIME,T(1),T(N),TE,DIFF
2     FORMAT(F10.1,4F12.4)
C...
C...  UPDATE THE SUM OF SQUARES OF THE ERRORS
      SSE=SSE+DIFF**2
C...
C...  PRINT THE SUM OF SQUARES OF THE ERRORS AT THE END OF THE RUN
      IF(TIME.GT.1.999)WRITE(NO,3)SSE
3     FORMAT(//,' SSE = ',F7.3,//)
      RETURN
      END
