- Code: Select all
minpos=minloc(local_array) !local array has three elements
end subroutine track
!$OMP PARALLEL DO private(in,out,i)
!$OMP END PARALLEL DO
When running with one thread it works fine. When running in parallel minloc will return an index that is outside the array bounds.
I am compiling with gfortran 4.7.3 with the following compiler flags -g -O0 -fopenmp -Wall -fbacktrace -fbounds-check
Any help would be much appreciated.