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

        implicit none
        integer nkeys
        character key*(*),keys(nkeys)*(*)

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

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

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