      SUBROUTINE stream_copy(c,a,n)
      REAL*8 c(n),a(n)
      INTEGER AHEAD
      PARAMETER (AHEAD=128)

      IF (n.le.AHEAD+1) THEN
         DO j=1,n
            c(j) = a(j)
D            PRINT *,'DEBUG: SHORT LOOP: index = ',j
         END DO
      ELSE
         DO j = 1,n-AHEAD,16
!IBM*       CACHE_ZERO (c(j+AHEAD))
            DO i = 0,15
               c(j+i) = a(j+i)
D               PRINT *,'DEBUG: MAIN LOOP: index = ',j+i
            END DO
         END DO
         DO j=n-AHEAD+1,n
            c(j) = a(j)
D            PRINT *,'DEBUG: CLEANUP LOOP: index = ',j
         END DO
      END IF
      END
