Last change
on this file since 5360 was
3331,
checked in by acozic, 7 years ago
|
Add modification for isotopes
|
-
Property svn:executable set to
*
|
File size:
825 bytes
|
Line | |
---|
1 | MODULE mod_synchro_omp |
---|
2 | |
---|
3 | INTEGER,SAVE :: exit_omp |
---|
4 | |
---|
5 | CONTAINS |
---|
6 | |
---|
7 | SUBROUTINE Init_synchro_omp |
---|
8 | USE mod_phys_lmdz_para |
---|
9 | IMPLICIT NONE |
---|
10 | |
---|
11 | CALL omp_barrier |
---|
12 | !$OMP MASTER |
---|
13 | exit_omp=0 |
---|
14 | !$OMP END MASTER |
---|
15 | CALL omp_barrier |
---|
16 | |
---|
17 | END SUBROUTINE Init_Synchro_omp |
---|
18 | |
---|
19 | SUBROUTINE Synchro_omp |
---|
20 | USE mod_phys_lmdz_para |
---|
21 | IMPLICIT NONE |
---|
22 | LOGICAL :: out |
---|
23 | |
---|
24 | out=.FALSE. |
---|
25 | !$OMP BARRIER |
---|
26 | !$OMP BARRIER |
---|
27 | !$OMP ATOMIC |
---|
28 | exit_omp=exit_omp+1 |
---|
29 | !$OMP BARRIER |
---|
30 | !$OMP BARRIER |
---|
31 | IF (exit_omp==omp_size) THEN |
---|
32 | out=.TRUE. |
---|
33 | ENDIF |
---|
34 | |
---|
35 | DO WHILE (.NOT. out) |
---|
36 | !$OMP BARRIER |
---|
37 | IF (exit_omp==omp_size) out=.TRUE. |
---|
38 | !$OMP BARRIER |
---|
39 | ENDDO |
---|
40 | |
---|
41 | !$OMP BARRIER |
---|
42 | !$OMP MASTER |
---|
43 | exit_omp=0 |
---|
44 | !$OMP END MASTER |
---|
45 | !$OMP BARRIER |
---|
46 | |
---|
47 | IF (exit_omp/=0) THEN |
---|
48 | STOP 'synchro_omp' |
---|
49 | ENDIF |
---|
50 | |
---|
51 | END SUBROUTINE Synchro_omp |
---|
52 | |
---|
53 | |
---|
54 | END MODULE mod_synchro_omp |
---|
Note: See
TracBrowser
for help on using the repository browser.