! Program Example from "Essential Fortran 90 & 95" by Loren P. Meissner
! Copyright 1996. Copying for sale requires permission from the author.
! Otherwise, distribution is permitted if these three lines are included.

  module I01M
    implicit none
    public :: Find
  contains
    subroutine Find( X, A, K )  ! Find the first element of A that is larger than X.
      real, intent (in) :: X
      real, dimension(:), intent (in) :: A
      integer, intent (out) :: K
      integer :: Loop
  ! start subroutine Find
      do Loop = 1, size( A )
        K = Loop
        if (A(K) > X) then
          exit
        end if
      end do
      return
    end subroutine Find
  end module I01M
