%N winfidcg %F $MIR/src/subs/cgsubs.for
%D Adjust window size to fit integral number of bins
%P nebk
%: plotting
%B
      subroutine winfidcg (size, axis, bin, blc, trc, win)

      integer axis, bin(2), blc, trc, size, win
  ---------------------------------------------------------------------
     Adjust the size of the window so that the bin width fits
     an integer number of times

     Input:
        size    SIze of total available image
        axis    Axis number
        bin     Pixel increment and binning width across image
     Input/output
        blc,trc Window in pixels, adjusted if necessary to fit
                an integral number of bins
     Output
        win     Size of binned window
