%N boxnr %F $MIR/src/subs/utilities.for
%D Find in which box the input value lies.
%P bpw
%: utilities
%B
      integer          function boxnri ( i, iedges, nedges )
      real             function boxnrr ( r, redges, nedges )
      double precision function boxnrd ( d, dedges, nedges )
      integer          i, iedges(nedges)
      real             r, redges(nedges)
      double precision d, dedges(nedges)
      integer          nedges

 The array i/r/dedges defines a set of boxes. Boxnr then returns the
 index of the box in which i/r/d lies. For example, if iedges has the
 values 0, 2, 5, 10, 50 then boxnr becomes 1 if i=1, 2 if i=2, 2 if i=4,
 4 if i=45 etc. Values on the edges are supposed to lie in the box above
 the value. Values below the first edge are supposed to lie in box 0,
 values above the last edge are in box nedges.
