source: LMDZ5/trunk/libf/phylmd/mod_synchro_omp.F90 @ 3493

Last change on this file since 3493 was 1907, checked in by lguez, 11 years ago

Added a copyright property to every file of the distribution, except
for the fcm files (which have their own copyright). Use svn propget on
a file to see the copyright. For instance:

$ svn propget copyright libf/phylmd/physiq.F90
Name of program: LMDZ
Creation date: 1984
Version: LMDZ5
License: CeCILL version 2
Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
See the license file in the root directory

Also added the files defining the CeCILL version 2 license, in French
and English, at the top of the LMDZ tree.

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 825 bytes
RevLine 
[987]1MODULE mod_synchro_omp
2
[1905]3    INTEGER,SAVE :: exit_omp 
4
[987]5CONTAINS
6
7  SUBROUTINE Init_synchro_omp
8  USE mod_phys_lmdz_para
9  IMPLICIT NONE
10
[1905]11  CALL omp_barrier
12!$OMP MASTER
13  exit_omp=0
14!$OMP END MASTER   
15  CALL omp_barrier
16
[987]17  END SUBROUTINE Init_Synchro_omp
18 
[1905]19  SUBROUTINE Synchro_omp 
[987]20  USE mod_phys_lmdz_para
21  IMPLICIT NONE
[1905]22  LOGICAL :: out
[987]23 
[1905]24    out=.FALSE.
[987]25!$OMP BARRIER
26!$OMP BARRIER
[1905]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
[987]39    ENDDO
[1905]40
[987]41!$OMP BARRIER
[1905]42!$OMP MASTER
43    exit_omp=0
44!$OMP END MASTER
45!$OMP BARRIER
[987]46
[1905]47    IF (exit_omp/=0) THEN
48      STOP 'synchro_omp'
49    ENDIF
[987]50
[1905]51  END SUBROUTINE Synchro_omp
52
53
[987]54END MODULE mod_synchro_omp
Note: See TracBrowser for help on using the repository browser.