      Subroutine reduction( title, me, npes, nrpt, ncases, n, tn,
     &                    ops )
! ----------------------------------------------------------------------
      Use             numerics
      Use             max_params      
      Implicit        None
      
      Include         'mpif.h'
      
      Character*50 :: title
      Integer      :: me, npes, nrpt, ncases, n
      Real(l_)     :: tn(maxcases), ops, timer
      Real(l_)     :: a(nmax), b(nmax)      
      Real(l_)     :: t1, t2
      Integer      :: k, kk, log2
      Integer      :: comm, ie, type
      External        log2
      Save            a, b
! ---------------------------------------------------------------------- 
      comm   = MPI_Comm_World
      type   = MPI_Real8
      title = ' N PEs   --> N PEs; Reduction'
      nrpt   = 100
      ncases = npes
      ops    = log2(npes)*2*8*n
      tn(1:maxcases) = 1.0e-15_l_
      Do k = 1, ncases
        b = 0.0_l_
        Call MPI_Barrier( comm, ie )
        t1 = timer()
        Do kk = 1, nrpt
          Call MPI_Reduce( a, b, n, type, MPI_Sum, k-1, comm, ie )
        End Do
        t2     = timer()
        tn(k) = Max( 1.0e-15_l_, (t2 - t1)/nrpt )
      End Do
! ----------------------------------------------------------------------
      End Subroutine reduction
