%N binsrchi %F $MIR/src/subs/bsrch.for
%D Search a list of integers for a particular integer.
%: search, binary-search
%B
        integer function binsrchi(key,keys,nkeys)

        implicit none
        integer nkeys
        integer key,keys(nkeys)

  Search for a particular integer in a list of integers. Return the
  index of the integer. If the integer is not found, return 0.
  A binary search is used.

  Input:
    key        The integer to search for.
    keys       A list of integers. These are assumed to be in alphabetic
               order to allow a binary search.
    nkeys      The number of integers.

  Output:
    binsrchi   Either the index of the integer (if it is found in the
               list), or zero.
