mirror of
https://github.com/OpenMP/Examples.git
synced 2025-04-04 05:41:33 +01:00
28 lines
588 B
Fortran
28 lines
588 B
Fortran
! @@name: fort_loopvar.2
|
|
! @@type: F-free
|
|
! @@compilable: yes
|
|
! @@linkable: no
|
|
! @@expect: success
|
|
SUBROUTINE PLOOP_2(A,B,N,I1,I2)
|
|
REAL A(*), B(*)
|
|
INTEGER I1, I2, N
|
|
|
|
!$OMP PARALLEL SHARED(A,B,I1,I2)
|
|
!$OMP SECTIONS
|
|
!$OMP SECTION
|
|
DO I1 = I1, N
|
|
IF (A(I1).NE.0.0) EXIT
|
|
ENDDO
|
|
!$OMP SECTION
|
|
DO I2 = I2, N
|
|
IF (B(I2).NE.0.0) EXIT
|
|
ENDDO
|
|
!$OMP END SECTIONS
|
|
!$OMP SINGLE
|
|
IF (I1.LE.N) PRINT *, 'ITEMS IN A UP TO ', I1, 'ARE ALL ZERO.'
|
|
IF (I2.LE.N) PRINT *, 'ITEMS IN B UP TO ', I2, 'ARE ALL ZERO.'
|
|
!$OMP END SINGLE
|
|
!$OMP END PARALLEL
|
|
|
|
END SUBROUTINE PLOOP_2
|