mirror of
https://github.com/OpenMP/Examples.git
synced 2025-04-04 05:41:33 +01:00
20 lines
383 B
Fortran
20 lines
383 B
Fortran
! @@name: fort_loopvar.1
|
|
! @@type: F-free
|
|
! @@compilable: yes
|
|
! @@linkable: no
|
|
! @@expect: success
|
|
SUBROUTINE PLOOP_1(A,N)
|
|
INCLUDE "omp_lib.h" ! or USE OMP_LIB
|
|
|
|
REAL A(*)
|
|
INTEGER I, MYOFFSET, N
|
|
|
|
!$OMP PARALLEL PRIVATE(MYOFFSET)
|
|
MYOFFSET = OMP_GET_THREAD_NUM()*N
|
|
DO I = 1, N
|
|
A(MYOFFSET+I) = FLOAT(I)
|
|
ENDDO
|
|
!$OMP END PARALLEL
|
|
|
|
END SUBROUTINE PLOOP_1
|