      PROGRAM PRO2P2
C...
C...  EULER INTEGRATION OF EQUATION (1.7) USING EQUATION (2.2)
C...
C...  OPEN INPUT/OUTPUT FILES
      OPEN(1,FILE='INPUT')
      OPEN(2,FILE='OUTPUT')
C...
C...  (1)  INITIALIZATION
C...
C...       INDEX I
           I=0
C...
C...       TIME
           T=0.
C...
C...       INITIAL HEIGHT
           H0=100.
           H=H0
C...
C...       INTEGRATION INTERVAL
           DT=50.
C...
C...       TOTAL NUMBER OF INTERVALS
           ITOTAL=20
C...
C...       MODEL PARAMETERS
           AC=5000.
           Q0=10000.
           CV=500.
           A= Q0/AC
           B=-CV/AC
C...
C...       INITIAL DERIVATIVE
           DHDT=(A+B*SQRT(H))
C...
C...  (2)  PRINT THE SOLUTION
C...
1          WRITE(2,10)T,H,DHDT
10         FORMAT(20X,F10.0,F10.1,F10.3)
C...
C...  (3)  TAKE A STEP ALONG THE SOLUTION USING EQUATION (2.2)
C...
           H=H+DHDT*DT
           T=T+DT
           I=I+1
C...
C...  (4)  EVALUATE THE ODE DERIVATIVE
C...
           DHDT=(A+B*SQRT(H))
C...
C...  (5)  CHECK IF I = ITOTAL
C...
           IF(I.LE.ITOTAL)THEN
              GO TO 1
           ELSE
C...
C...          PRINT THE FINAL (STEADY STATE) VALUE OF H
              HS=(A/B)**2
              WRITE(2,11)HS
11            FORMAT(//,25X,'FINAL VALUE OF H = ',F6.1)
              WRITE(3,11)HS
           END IF
           STOP
           END
