      module variables
      real :: dist,t
c
c    t  - the time of fall (seconds)
c    dist - distance fallen in time "t" (meters)
c
      end module 
      module constants
      real, parameter :: g=9.807
c
c     g  -  gravitational acceleration constant (meters/sec**2)
c
      end module
c
      program fall
c
      implicit none
c
c   Calculate the distance a ball will fall in a given time
c   assuming that it starts at rest, and ignoring air friction.
c
c   Programmed by: John Mahaffy  1/2/97
c
      call input
c
      call distance
c
      call output
      stop
      end
c
      subroutine distance
      use variables
      use constants
      implicit none
c
c   Calculate the distance that a ball falls in time
c   "t"
c
c   Programmed by: John Mahaffy  1/2/97
c   Modified by:
c
c---------------------------------------------------------
	dist = .5* g * t**2
c---------------------------------------------------------
      return
      end
c
      subroutine input 
      use variables
      implicit none
c
c   Prompt for and read a time (in seconds)
c
c   Programmed by: John Mahaffy  1/2/97
c
      write(*,2000,advance='no')
 2000 format(' Time of Fall (seconds): ')
      read *, t
      return
      end
c
      subroutine output
      use variables
      implicit none
c
c   Print the distance fallen in the given time
c
c   Programmed by: John Mahaffy  1/2/97
c
      write  (*,2000) dist, t
 2000 format (' Ball  Falls' , 1p,e10.2,' meters in ',
     &  0p, f7.2, ' seconds')
      return
      end
