      PROGRAM PROJEC
************************************************************************
* This program calculates the velocity and height of a projectile      *
* given its initial height, initial velocity, and constant             *
* acceleration.  Variables used are:                                   *
*    HGHT0   :  initial height                                         *
*    HGHT    :  height at any time                                     *
*    VELOC0  :  initial vertical velocity                              *
*    VELOC   :  vertical velocity at any time                          *
*    ACCEL   :  vertical acceleration                                  *
*    TIME    :  time elapsed since projectile was launched             *
*                                                                      *
* Input (file):   HGHT0, VELOC0, TIME                                  *
* Output (file):  VELOC, HGHT                                          *
************************************************************************

      REAL HGHT0, HGHT, VELOC0, VELOC, ACCEL, TIME
      DATA ACCEL / -9.807 /

* Open disk files fig2-6.data and fig2-6.out
      OPEN(UNIT = 12, FILE = 'fig2-6.dat', STATUS = 'OLD')
         OPEN(UNIT = 13, FILE = 'fig2-6.out', STATUS = 'NEW')

* Read values for HGHT0, VELOC0, and TIME from fig2-6.dat
      READ (12, *), HGHT0, VELOC0, TIME

* Calculate the height and velocity
      HGHT = 0.5 * ACCEL * TIME ** 2  +  VELOC0 * TIME  +  HGHT0
      VELOC = ACCEL * TIME + VELOC0

* Write values of VELOC and HGHT to fig2-6.out
      WRITE(13, *) 'AT TIME ', TIME, ' THE VERTICAL VELOCITY IS '
      WRITE(13, *) VELOC, ' AND THE HEIGHT IS ', HGHT

* Signal user that program is finished
      PRINT *, '*** PROGRAM IS FINISHED ***'

      END
