mirror of
https://github.com/OpenMP/Examples.git
synced 2025-04-10 16:32:11 +01:00
21 lines
399 B
Fortran
21 lines
399 B
Fortran
! @@name: lastprivate.2
|
|
! @@type: F-free
|
|
! @@operation: compile
|
|
! @@expect: success
|
|
! @@version: omp_5.0
|
|
function condlastprivate(a, n) result(x)
|
|
implicit none
|
|
real a(*), x
|
|
integer n, k
|
|
|
|
x = 0.0
|
|
|
|
!$omp parallel do simd lastprivate(conditional: x)
|
|
do k = 1, n
|
|
if (a(k) < 108.5 .or. a(k) > 208.5) then
|
|
x = sin(a(k))
|
|
endif
|
|
end do
|
|
|
|
end function condlastprivate
|