source: LMDZ5/branches/testing/libf/dyn3dpar/mod_const_mpi.F90 @ 1885

Last change on this file since 1885 was 1864, checked in by Laurent Fairhead, 11 years ago

Création d'une nouvelle testing:

merge des modifications du trunk entre r1796 et r1860


New testing version

merged modifications between r1796 and r1860 from the trunk

i.e.
svn merge -r1796:1860 http://svn.lmd.jussieu.fr/LMDZ/LMDZ5/trunk

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.0 KB
RevLine 
[1279]1!
2! $Id: mod_const_mpi.F90 1864 2013-09-11 09:45:01Z emillour $
3!
[774]4MODULE mod_const_mpi
5
[985]6  INTEGER,SAVE :: COMM_LMDZ
7  INTEGER,SAVE :: MPI_REAL_LMDZ
[774]8 
9
10CONTAINS
11
12  SUBROUTINE Init_const_mpi
[1279]13#ifdef CPP_IOIPSL
[884]14    USE IOIPSL
[1279]15#else
16! if not using IOIPSL, we still need to use (a local version of) getin
17    USE ioipsl_getincom
18#endif
[884]19
20    IMPLICIT NONE
[1000]21#ifdef CPP_MPI
[774]22    INCLUDE 'mpif.h'
[1000]23#endif
[884]24    INTEGER             :: ierr
25    INTEGER             :: comp_id
[985]26    INTEGER             :: thread_required
27    INTEGER             :: thread_provided
[1008]28    CHARACTER(len = 6)  :: type_ocean
[884]29
30!$OMP MASTER
[1008]31    type_ocean = 'force '
32    CALL getin('type_ocean', type_ocean)
[985]33!$OMP END MASTER
34!$OMP BARRIER
[884]35
[1008]36    IF (type_ocean=='couple') THEN
[806]37#ifdef CPP_COUPLE
[985]38!$OMP MASTER
[884]39       CALL prism_init_comp_proto (comp_id, 'lmdz.x', ierr)
40       CALL prism_get_localcomm_proto(COMM_LMDZ,ierr)
[985]41!$OMP END MASTER
[1014]42#endif
[1000]43#ifdef CPP_MPI
44      MPI_REAL_LMDZ=MPI_REAL8
[806]45#endif
[884]46    ELSE
[1000]47      CALL init_mpi
48    ENDIF
49
50  END SUBROUTINE Init_const_mpi
51 
52  SUBROUTINE Init_mpi
[1864]53#ifdef CPP_XIOS
54    USE wxios
55#endif
[1000]56  IMPLICIT NONE
57#ifdef CPP_MPI
58     INCLUDE 'mpif.h'
59#endif
60    INTEGER             :: ierr
61    INTEGER             :: thread_required
62    INTEGER             :: thread_provided
63
64#ifdef CPP_MPI
[985]65!$OMP MASTER
[1000]66      thread_required=MPI_THREAD_SERIALIZED
67
68      CALL MPI_INIT_THREAD(thread_required,thread_provided,ierr)
69      IF (thread_provided < thread_required) THEN
70        PRINT *,'Warning : The multithreaded level of MPI librairy do not provide the requiered level',  &
71                ' in mod_const_mpi::Init_const_mpi'
72      ENDIF
73      COMM_LMDZ=MPI_COMM_WORLD
74      MPI_REAL_LMDZ=MPI_REAL8
[1864]75
76    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
77    ! Initialisation de XIOS
78    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
79#ifdef CPP_XIOS
80      CALL wxios_init("LMDZ", outcom=COMM_LMDZ)
81#endif
[985]82!$OMP END MASTER
[1864]83#else
84#ifdef CPP_XIOS
85!$OMP MASTER
86      CALL wxios_init("LMDZ")
87!$OMP END MASTER
[1000]88#endif
[1864]89#endif
[1000]90   END SUBROUTINE Init_mpi
91   
[774]92END MODULE mod_const_mpi
Note: See TracBrowser for help on using the repository browser.