```

REAL FUNCTION SASUM( N, SX, INCX ) 10

c  INPUT--    N  Number of elements in vector to be summed
c            SX  Sing-prec array, length 1+(N-1)*INCX, containing vector
c          INCX  Spacing of vector elements in SX

c  OUTPUT-- SASUM   Sum from 0 to N-1 of  ABS(SX(1+I*INCX))
c ----------------------------------------------------------

c     .. Scalar Arguments ..

INTEGER   INCX, N
c     ..
c     .. Array Arguments ..

REAL      SX( * )
c     ..
c     .. Local Scalars ..

INTEGER   I, M
c     ..
c     .. Intrinsic Functions ..

INTRINSIC ABS, MOD
c     ..

SASUM  = 0.0

IF( N.LE.0 ) RETURN

IF( INCX.NE.1 ) THEN
c                                          ** non-unit increments
DO 10 I = 1, 1 + ( N - 1 )*INCX, INCX
SASUM  = SASUM + ABS( SX( I ) )
10    CONTINUE

ELSE
c                                          ** unit increments
M  = MOD( N, 6 )

IF( M.NE.0 ) THEN
c                             ** clean-up loop so remaining vector
c                             ** length is a multiple of 6.
DO 20 I = 1, M
SASUM  = SASUM + ABS( SX( I ) )
20       CONTINUE

END IF
c                              ** unroll loop for speed
DO 30 I = M + 1, N, 6
SASUM  = SASUM + ABS( SX( I ) ) + ABS( SX( I + 1 ) ) +
&               ABS( SX( I + 2 ) ) + ABS( SX( I + 3 ) ) +
&               ABS( SX( I + 4 ) ) + ABS( SX( I + 5 ) )
30    CONTINUE

END IF

END
```