%N binup %F $MIR/src/subs/zeebin.for
%D Bin up data in array
%P nebk
%: profile analysis
%B
      subroutine binup (data, blc, trc, bin, norm, ipt, binned, wrt)
      implicit none
      integer blc, trc, ipt, bin
      real data(*), binned(*), norm
      logical wrt

     Bin up data in array

     Input:
        data     r   Full array of data (starting at location 1)
        blc,trc  i   Array window to binup
        bin      i   Number of pixels to bin together
        norm     r   Additional multiplicative normalization factor
                     Binned data are normalized by BIN*NORM
     Input/output:
        ipt      i   On input, first location in output array to use
                     On output, last location in output array used
        binned   r   Output binned spectrum.  Normalization
                     of each output point is by the product of the
                     number of binned points and NORM
                     Deals with non-integral number of bins in array

                     BINNED must be initialized to 0.0 on first entry
