mirror of
https://github.com/OpenMP/Examples.git
synced 2025-04-04 05:41:33 +01:00
26 lines
509 B
Fortran
26 lines
509 B
Fortran
! @@name: copyprivate.2
|
|
! @@type: F-fixed
|
|
! @@compilable: yes
|
|
! @@linkable: no
|
|
! @@expect: success
|
|
! @@version: omp_5.1
|
|
REAL FUNCTION READ_NEXT()
|
|
REAL, POINTER :: TMP
|
|
|
|
!$OMP SINGLE
|
|
ALLOCATE (TMP)
|
|
!$OMP END SINGLE COPYPRIVATE (TMP) ! copies the pointer only
|
|
|
|
!$OMP MASKED
|
|
READ (11) TMP
|
|
!$OMP END MASKED
|
|
|
|
!$OMP BARRIER
|
|
READ_NEXT = TMP
|
|
!$OMP BARRIER
|
|
|
|
!$OMP SINGLE
|
|
DEALLOCATE (TMP)
|
|
!$OMP END SINGLE NOWAIT
|
|
END FUNCTION READ_NEXT
|