Hi, I have a problem and I did not find a solution : I want to use parallelism in the free code , but a problem occurred in the allocation of arrays:
PROGRAM LMTART
USE PARA_CONTROL
use omp_lib
INTEGER I,J
real, allocatable, dimension(:) :: a
PARA_FIRST=.True.
!$OMP PARALLEL DEFAULT(firstprivate)
!$OMP DO
DO I = 1, 10
if(PARA_FIRST) then
allocate(a(100))
DO J = 1, 10
a(j)=j
ENDDO
endif
write(*,*) (a(J),J=1,10)
PARA_FIRST=.False.
ENDDO
!$OMP END DO
!$OMP END PARALLEL
END
It should be noted that : do not reserved the table "a" before entering in the DO directive