      program loctest

      integer N
      parameter (N = 5)

      integer A(N), B(N,N), S
      integer I, J, POS, POS1

      A = 1
      A(3) = 0

      B = 3
      B (4,2) = 1

      S = 1000
      POS = 1
!hpf$ independent, local_access
      do I=1, N 
         reduce (MINVAL, S, A(I), POS, I)
      end do
      print *, 'A: minval = ', S, ' minpos = ', POS

      S = 1000
      POS = 1
      POS1 = 1
!hpf$ independent, local_access
      do J=1, N
!hpf$ independent, local_access
        do I=1, N 
         reduce (MINVAL, S, B(I,J), POS, I, POS1, J)
        end do
      end do
      print *, 'B: minval = ', S, ' minpos = ', POS, POS1

      end
