2022-04-18 15:02:25 -07:00

26 lines
575 B
Fortran

! @@name: copyprivate.4
! @@type: F-fixed
! @@compilable: yes
! @@linkable: no
! @@expect: success
SUBROUTINE S(N)
INTEGER N
REAL, DIMENSION(:), ALLOCATABLE :: A
REAL, DIMENSION(:), POINTER :: B
ALLOCATE (A(N))
!$OMP SINGLE
ALLOCATE (B(N))
READ (11) A,B
!$OMP END SINGLE COPYPRIVATE(A,B)
! Variable A is private and is
! assigned the same value in each thread
! Variable B is shared
!$OMP BARRIER
!$OMP SINGLE
DEALLOCATE (B)
!$OMP END SINGLE NOWAIT
END SUBROUTINE S