Hi,

I have problems using the MAXLOC and MAXVEC functions within accelerator regions. I will use the following f90 code snippet to illustrate what happens:

```
program test
integer :: iii(1),N
real :: x(10), vmax(1), zz
N=10
!$acc region copy(x)
do i=1,N
x(i) = -N/2.+i
end do
iii = maxloc(x)
zz = x(iii(1))
vmax = maxval(x)
write(*,*) ' | MAXLOC | X(MAXLOC) | MAXVAL | X(1) | X(N) |'
write(*,'(A,I10,2X,4(F10.2,2X))') ' IN REGION:',iii(1), zz, vmax(1), x(1), x(N)
!$acc end region
write(*,'(A,I10,2X,4(F10.2,2X))') 'OUT REGION:',iii(1), zz, vmax(1), x(1), x(N)
end program test
```

When compiled with the following command

module load compilers/pgi/11.10

module load cuda/4.0

pgf90 -Minfo=all -ta=nvidia:cc20,cuda4.0 test3.f90 -o test.gpu

I obtain the following results:

```
| MAXLOC | X(MAXLOC) | MAXVAL | X(1) | X(N) |
IN REGION: 0 0.00 0.00 0.00 0.00
OUT REGION: 0 0.00 5.00 -4.00 5.00
```

while when I do not use the GPU, e.g. compiling the code this way,

pgf90 -Minfo=all test3.f90 -o test

I obtain the correct results:

```
| MAXLOC | X(MAXLOC) | MAXVAL | X(1) | X(N) |
IN REGION: 10 5.00 5.00 -4.00 5.00
OUT REGION: 10 5.00 5.00 -4.00 5.00
```

Thank you very much for your help!

Domenico