      PROGRAM free_fall
*     example of strong typing
      IMPLICIT NONE
      REAL*8 a, dt, g, t, v, y
      INTEGER counter, nshow
      COMMON /GLBLD/a, dt, g, t, v, y
      COMMON /GLBLI/nshow
      CALL initial
      CALL print_table
      counter = 0
      DO WHILE(y .GE. 0)
         CALL Euler
         counter = counter + 1
         IF(mod(counter,nshow) .EQ. 0) THEN
            CALL print_table
         END IF
      END DO
      CALL print_table
      END
C
      SUBROUTINE initial
      IMPLICIT NONE
      REAL*8 a, dt, g, t, v, y
      INTEGER nshow
      COMMON /GLBLD/a, dt, g, t, v, y
      COMMON /GLBLI/nshow
      t = 0
      y = 10
      v = 0
      g = 9.8D0
      a = -g
      dt = 0.01D0
      END
C
      SUBROUTINE Euler
      IMPLICIT NONE
      REAL*8 a, dt, g, t, v, y
      INTEGER nshow
      COMMON /GLBLD/a, dt, g, t, v, y
      COMMON /GLBLI/nshow
      y = y + v*dt
      a = -g
      v = v + a*dt
      t = t + dt
      END
C
      SUBROUTINE print_table
      IMPLICIT NONE
      REAL*8 a, dt, g, t, v, y
      INTEGER nshow
      COMMON /GLBLD/a, dt, g, t, v, y
      COMMON /GLBLI/nshow
      IF(t .EQ. 0) THEN
         WRITE(*,'(A,$)') 'number of time steps between output = '
         READ(*,*) nshow
         WRITE(*,*)
         WRITE(*,'(A)') 
     +     '     time (s)        y (m) velocity (m/s) accel (m/s*s)'
         WRITE(*,*)
      END IF
      WRITE(*,'(4F13.6)') t, y, v, a
      END
