source:
LMDZ6/branches/Amaury_dev/libf/phylmd/mod_synchro_omp.F90
Last change on this file was 5128, checked in by , 8 weeks ago | |
---|---|
|
|
File size: 1.0 KB |
Rev | Line | |
---|---|---|
[3531] | 1 | ! $Id: mod_synchro_omp.F90 5128 2024-07-25 15:47:25Z dcugnet $ |
[5099] | 2 | |
[987] | 3 | MODULE mod_synchro_omp |
4 | ||
[5111] | 5 | INTEGER, SAVE :: exit_omp |
[1905] | 6 | |
[987] | 7 | CONTAINS |
8 | ||
9 | SUBROUTINE Init_synchro_omp | |
[5111] | 10 | USE lmdz_phys_para |
11 | IMPLICIT NONE | |
[987] | 12 | |
[5111] | 13 | !$OMP BARRIER |
14 | !$OMP MASTER | |
15 | exit_omp = 0 | |
16 | !$OMP END MASTER | |
17 | !$OMP BARRIER | |
[1905] | 18 | |
[987] | 19 | END SUBROUTINE Init_Synchro_omp |
[5111] | 20 | |
21 | SUBROUTINE Synchro_omp | |
22 | USE lmdz_phys_para | |
[5128] | 23 | USE lmdz_abort_physic, ONLY: abort_physic |
[5111] | 24 | IMPLICIT NONE |
25 | LOGICAL :: out | |
26 | CHARACTER (LEN = 20) :: modname = 'synchro_omp' | |
27 | CHARACTER (LEN = 80) :: abort_message | |
28 | ||
29 | out = .FALSE. | |
30 | !$OMP BARRIER | |
31 | !$OMP ATOMIC | |
32 | exit_omp = exit_omp + 1 | |
33 | !$OMP BARRIER | |
[1905] | 34 | IF (exit_omp==omp_size) THEN |
[5111] | 35 | out = .TRUE. |
[1905] | 36 | ENDIF |
[5111] | 37 | |
[1905] | 38 | DO WHILE (.NOT. out) |
[5111] | 39 | !$OMP BARRIER |
40 | IF (exit_omp==omp_size) out = .TRUE. | |
41 | !$OMP BARRIER | |
[987] | 42 | ENDDO |
[1905] | 43 | |
[5111] | 44 | !$OMP BARRIER |
45 | !$OMP MASTER | |
46 | exit_omp = 0 | |
47 | !$OMP END MASTER | |
48 | !$OMP BARRIER | |
[987] | 49 | |
[1905] | 50 | IF (exit_omp/=0) THEN |
[5111] | 51 | abort_message = 'synchro_omp' |
52 | CALL abort_physic(modname, abort_message, 1) | |
[1905] | 53 | ENDIF |
[987] | 54 | |
[1905] | 55 | END SUBROUTINE Synchro_omp |
56 | ||
57 | ||
[987] | 58 | END MODULE mod_synchro_omp |
Note: See TracBrowser
for help on using the repository browser.