Dear community,
I am encountering a weird problem involving OpenMP. This simple code snippet
integer :: elem_no
integer :: no_nod_elem
real(dp), allocatable, dimension(:) :: fiss_den
!$OMP PARALLEL DO &
!$OMP& DEFAULT(none) &
!$OMP& SHARED(mesh) &
!$OMP& PRIVATE(no_nod_elem,fiss_den)
do elem_no=1,mesh%no_active_elem
no_nod_elem = 5
allocate(fiss_den(no_nod_elem)) ! X
fiss_den = 0.0_dp
deallocate(fiss_den)
enddo
!$OMP END PARALLEL DO
fails with the message that fiss_den is already allocated (on line marked X).
Mesh is a complex data_type with the entry no_active_elem an integer. If I replace mesh%no_active_elem by some new integer variable that was set to the correct value, then it does work (at least running on single thread). So something fishy going on. Are there any restrictions I am not aware of?
Any ideas why this would happen? I have seen similar questions posted before, but I believe these issues were fixed in previous versions (I am using 17.0.4 on linux).
Thanks for any pointers you might have.
Danny.