      program free_fall     ! free_fall     sp131.f
      implicit none
      integer i,imax
      real*8 t,y,v,g,a,dt

      t = 0.0d0             ! sec
      y = 10.0d0            ! meter
      v = 0.0d0             ! m/s
      g = 9.80217d0         ! m/s^2
      a = -g

      dt= 0.5d0             ! sec
      imax = 30

      write(*,'(a1,3x,a6,6x,a4,7x,a6,5x,a8)') 
     &         '#','T(s)','y(m)','v(m/s)','a(m/s^2)'

      write(*,'(1p4e12.4)') t, y, v, a

      open (1,file='sp131.dat')

      write(1,'(a1,3x,a6,6x,a4,7x,a6,5x,a8)') 
     &         '#','T(s)','y(m)','v(m/s)','a(m/s^2)'

      write(1,'( 1p4e12.4)') t, y, v, a

      do i = 1, imax
         y = y + v * dt
         a = - g
         v = v + a * dt
         t = t + dt
         write(*,'(1p4e12.4, i6)') t, y, v, a, i
         write(1,'(1p4e12.4, i6)') t, y, v, a, i

         if( y .lt. 0.0 ) go to 100

      enddo

 100  continue

      close(1)

      stop
      end
