      SUBROUTINE DROT( N, SX, INCX, SY, INCY, C, S )
****************************************************************************
*                                                                          *
*   DATA PARALLEL BLAS based on MPL                                        *
*                                                                          *
*   Version 1.0   1/9-92 ,                                                 *
*   For MasPar MP-1 computers                                              *
*                                                                          *
*   para//ab, University of Bergen, NORWAY                                 *
*                                                                          *
*   These programs must be called using F90 style array syntax.            *
*   Note that the F77 style calling sequence has been retained             *
*   in this version for compatibility reasons, be aware that               *
*   parameters related to the array dimensions and shape therefore may     *
*   be redundant and without any influence.                                *
*   The calling sequence may be changed in a future version.               *
*   Please report any BUGs, ideas for improvement or other                 *
*   comments to                                                            *
*                    adm@parallab.uib.no                                   *
*                                                                          *
*   Future versions may then reflect your suggestions.                     *
*   The most current version of this software is available                 *
*   from netlib@nac.no , send the message `send index from maspar'         *
*                                                                          *
*   REVISIONS:                                                             *
*                                                                          *
****************************************************************************
      implicit none
*
*     applies a plane rotation.
*     jack dongarra, linpack, 3/11/78.
*
*     .. Scalar Arguments ..
      INTEGER          INCX, INCY, N
      DOUBLE PRECISION C, S
*     ..
*     .. Array Arguments ..
      double precision, array(:) :: sx, sy
*     ..
*     .. Local Arrays ..
      double precision, array(n) :: st
*     ..
*     .. Local Scalars ..
*     ..
      INTEGER           m,ix,iy,jx,jy
*     .. Executable Statements ..
*
      IF( N.LE.0 ) return
*
*        code for both increments equal to 1
*
      IF( INCX.EQ.1 .AND. INCY.EQ.1 ) then
        ST(1:n) = C*SX(1:n) + S*SY(1:n)
        SY(1:n) = C*SY(1:n) - S*SX(1:n)
        SX(1:n) = ST(1:n)
      else
*
*        code for unequal increments or equal increments
*          not equal to 1
*
        m  = n - 1
        ix = 1
        iy = 1
        jx = 1 + m * incx
        jy = 1 + m * incy
*
        if ( incx .lt. 0 ) then
        ix = 1 - m * incx
        jx = 1
        endif
*
        if ( incy .lt. 0 ) then
        iy = 1 - m * incy
        jy = 1
        endif
*
        ST(1:n)        = C*SX(ix:jx:incx) + S*SY(iy:jy:incy)
        SY(iy:jy:incy) = C*SY(iy:jy:incy) - S*SX(ix:jx:incx)
        SX(ix:jx:incx) = ST(1:n)
      endif
*
      RETURN
*
*     End of DROT  .
*
      END