mirror of
https://github.com/OpenMP/Examples.git
synced 2025-04-04 05:41:33 +01:00
29 lines
599 B
Fortran
29 lines
599 B
Fortran
! @@name: copyin.1f
|
|
! @@type: F-fixed
|
|
! @@compilable: yes
|
|
! @@linkable: no
|
|
! @@expect: success
|
|
MODULE M
|
|
REAL, POINTER, SAVE :: WORK(:)
|
|
INTEGER :: SIZE
|
|
REAL :: TOL
|
|
!$OMP THREADPRIVATE(WORK,SIZE,TOL)
|
|
END MODULE M
|
|
|
|
SUBROUTINE COPYIN_EXAMPLE( T, N )
|
|
USE M
|
|
REAL :: T
|
|
INTEGER :: N
|
|
TOL = T
|
|
SIZE = N
|
|
!$OMP PARALLEL COPYIN(TOL,SIZE)
|
|
CALL BUILD
|
|
!$OMP END PARALLEL
|
|
END SUBROUTINE COPYIN_EXAMPLE
|
|
|
|
SUBROUTINE BUILD
|
|
USE M
|
|
ALLOCATE(WORK(SIZE))
|
|
WORK = TOL
|
|
END SUBROUTINE BUILD
|