%N lsearchd %F $MIR/src/subs/lsearch.for
%D Linear search in double precision array
%: misc
%P pjt
%B
      SUBROUTINE lsearchd(n,x,t,i)

      INTEGER n, i
      DOUBLE PRECISION x(n), t

  Input:
       n       length of array x
       x       sorted array of values
       t       value to look for it's location w.r.t. array
       i       initial guess, if non-negative
  Output:
       i       interval where t is inside x

  Linear search, returns the interval 
  in which t is in the array x():   (0 <= i <= n)
  0 and n are left and right of the min and max,
  all others internal to the array.
  It is assumed the array is sorted
