mirror of
https://github.com/OpenMP/Examples.git
synced 2025-04-07 23:22:11 +01:00
32 lines
722 B
Fortran
32 lines
722 B
Fortran
! @@name: private.2f
|
|
! @@type: F-fixed
|
|
! @@compilable: yes
|
|
! @@linkable: no
|
|
! @@expect: success
|
|
MODULE PRIV_EXAMPLE2
|
|
REAL A
|
|
|
|
CONTAINS
|
|
|
|
SUBROUTINE G(K)
|
|
REAL K
|
|
A = K ! Accessed in the region but outside of the
|
|
! construct; therefore unspecified whether
|
|
! original or private list item is modified.
|
|
END SUBROUTINE G
|
|
|
|
SUBROUTINE F(N)
|
|
INTEGER N
|
|
REAL A
|
|
|
|
INTEGER I
|
|
!$OMP PARALLEL DO PRIVATE(A)
|
|
DO I = 1,N
|
|
A = I
|
|
CALL G(A*2)
|
|
ENDDO
|
|
!$OMP END PARALLEL DO
|
|
END SUBROUTINE F
|
|
|
|
END MODULE PRIV_EXAMPLE2
|