Force vectorized remainder

The compiler did not vectorize the remainder loop, even though doing so could improve performance. To fix: Force vectorization using a directive: !DIR$ VECTOR VECREMAINDER.

Example

...
! Force the compiler to vectorize the remainder
!DIR$ VECTOR VECREMAINDER
do i=x+1, n
...
subroutine add(A, N, X)
    integer N, X
    real    A(N)
    ! Force the compiler to vectorize the remainder
    !DIR$ VECTOR VECREMAINDER
    do i=x+1, n
        a(i) = a(i) + a(i-x)
    enddo
end

Read More