source: LMDZ4/trunk/libf/dyn3dpar/mod_const_para.F90 @ 1000

Last change on this file since 1000 was 1000, checked in by Laurent Fairhead, 16 years ago
  • Modifs sur le parallelisme: masquage dans la physique
  • Inclusion strato
  • mise en coherence etat0
  • le mode offline fonctionne maintenant en parallele,
  • les fichiers de la dynamiques sont correctement sortis et peuvent etre reconstruit avec rebuild
  • la version parallele de la dynamique peut s'executer sans MPI (sur 1 proc)
  • L'OPENMP fonctionne maintenant sans la parallelisation MPI.

YM
LF

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.5 KB
Line 
1MODULE mod_const_mpi
2
3  INTEGER,SAVE :: COMM_LMDZ
4  INTEGER,SAVE :: MPI_REAL_LMDZ
5 
6
7CONTAINS
8
9  SUBROUTINE Init_const_mpi
10    USE IOIPSL
11
12    IMPLICIT NONE
13#ifdef CPP_MPI
14    INCLUDE 'mpif.h'
15#endif
16    INTEGER             :: ierr
17    INTEGER             :: comp_id
18    INTEGER             :: thread_required
19    INTEGER             :: thread_provided
20    CHARACTER(len = 6)  :: ocean
21
22!$OMP MASTER
23    ocean = 'force '
24    CALL getin('OCEAN', ocean)
25!$OMP END MASTER
26!$OMP BARRIER
27
28    IF (ocean=='couple') THEN
29#ifdef CPP_COUPLE
30!$OMP MASTER
31       CALL prism_init_comp_proto (comp_id, 'lmdz.x', ierr)
32       CALL prism_get_localcomm_proto(COMM_LMDZ,ierr)
33!$OMP END MASTER
34#ifdef CPP_MPI
35      COMM_LMDZ=MPI_COMM_WORLD
36      MPI_REAL_LMDZ=MPI_REAL8
37#endif
38#endif
39    ELSE
40      CALL init_mpi
41    ENDIF
42
43  END SUBROUTINE Init_const_mpi
44 
45  SUBROUTINE Init_mpi
46  IMPLICIT NONE
47#ifdef CPP_MPI
48     INCLUDE 'mpif.h'
49#endif
50    INTEGER             :: ierr
51    INTEGER             :: thread_required
52    INTEGER             :: thread_provided
53
54#ifdef CPP_MPI
55!$OMP MASTER
56      thread_required=MPI_THREAD_SERIALIZED
57
58      CALL MPI_INIT_THREAD(thread_required,thread_provided,ierr)
59      IF (thread_provided < thread_required) THEN
60        PRINT *,'Warning : The multithreaded level of MPI librairy do not provide the requiered level',  &
61                ' in mod_const_mpi::Init_const_mpi'
62      ENDIF
63      COMM_LMDZ=MPI_COMM_WORLD
64      MPI_REAL_LMDZ=MPI_REAL8
65!$OMP END MASTER
66#endif
67
68   END SUBROUTINE Init_mpi
69   
70END MODULE mod_const_mpi
Note: See TracBrowser for help on using the repository browser.