*     ************************************************************************

      subroutine scattr( n, x, incx, bigvec, cplist )

*     ************************************************************************

*     Purpose :
*     ---------

*     This routine accumulates the components of the double 
*     precision vector X (i=1+(j-1)*INCX) (j=1,...,N) into 
*     the components of the vector BIGVEC that are specified 
*     by the component list CPLIST.

*     Parameters :
*     ------------

*     n       ( int )

*       input  : number of components of X to accumulate in BIGVEC.
*       output : unmodified.

*     x      (dble)

*       input  : a vector from which one wishes to extract the components
*                1+(i-1)*INCX (i=1,...,N) to be accumulated in the vector
*                BIGVEC.
*       output : unmodified.

*     incx    ( int )

*       input  : increment to consider between two successive
*                components of X.
*                if INCX is negative, then its absolute value
*                is considered.
*       output : unmodifed.

*     bigvec  ( dble)

*       input  : a vector in which one wishes to accumulate certain
*                components of X. These components are to be accumulated
*                into the components of BIGVEC specified by the list CPLIST.
*       output : the components BIGVEC(CPLIST(i)) are incremented by
*                components X(1+(j-1)*INCX) (j=1,...,N) respectively. The
*                other components are unmodified.

*     cplist  ( int )

*       input  : a vector containing the list of components of BIGVEC
*                in which one wishes to accumulate certain components of X.
*       output : unmodified.

*     Routines used :
*     ---------------

*     None.

*     Programming :
*     -------------

*     Ph.L. Toint 

*     Remarks :
*     ---------

*     This routine does not verify that the integers contained in
*     CPLIST(i) (i=1,...,N) are adequate for indexing the vector BIGVEC.

*     ========================================================================

*     Routine parameters

      integer          cplist(*), n, incx
      double precision x(*), bigvec(*)

*     Internal variables

      integer          ix, nx, i, j

      if( incx.ne.1 ) then
        ix = abs(incx)
        nx = 1
        do 100 i = 1 , n
          j         = cplist(i)
          bigvec(j) = bigvec(j) + x(nx)
          nx        = nx + ix
  100   continue
      else
        do 200 i = 1 , n
          j         = cplist(i)
          bigvec(j) = bigvec(j) + x(i)
  200   continue
      endif

      return
      end
