%N taver %F $MIR/src/subs/calsubs.for
%D Scalar averaging an array
%: calibration, scalar-average
%P pjt
%B
        SUBROUTINE taver (n, x, y, dx)

        INTEGER n
        REAL    x(*), y(*), dx

   Scalar average of an array - the X array is assumed to be
       sorted already - using a cluster algorithm
   See vectav() for vector averaging

  Inputs:
       n    -- number of elements in x and y arrays
       x    -- array of input ordinates
       y    -- array of input values
       dx   -- max step in x to group values
  Output:
       n    -- number of elements in x and y
       x    -- array of output ordinates
       y    -- array of output values
