I am working with a program (which I did not write) which has a pointer to a derived type in a module;
module X type mytype integer x, y, z end type mytype type (mytype), pointer :: p_mt end module X
This module is accessed in a subroutine;
subroutine Loop use X p_mt => GoGetOne() p_mt % x = 7.0 ...
So far, so good. However, subroutine Loop is accessed from with a parallel loop in another subroutine;
subroutine CallLoop() integer i !$OMP parallel do do i = 1 to 10000 call Loop(i) enddo
It is my understanding that p_mt is global in scope, and therefore should not be accessed from within a parallel loop. If I declare Loop as pure;
pure subroutine Loop()
the compiler flags the assignment of a value to p_mt as an error.
Am I missing something? Or is this a potential bug?