I've recently been making quite a lot of use of the F2003 'associate block' facility to simply some of my code, for example:
do j=firstrow, lastrow associate (fb => fbs(j), lb => lbs(j)) cos_phi(fb:lb,j) = sqrt(1d0 - sin_phi(fb:lb,j)**2) end associate end do
This works really well, saves a lot of typing, and makes the code a great deal more readable without the overhead of copying into local variables or using pointers.
Until, that is, I try to put the above loop into an OpenMP parallel region, and then it fails with some really exotic errors. The errors go away if I remove the 'associate' structure and give all the variables their full names, so it is definitely the associate block which is causing the problem rather than some other aspect of my parallelization.
Is this intended behaviour, or is it a bug?