source: LMDZ6/branches/LMDZ_ECRad/libf/dyn3dmem/mod_const_mpi.F90 @ 4890

Last change on this file since 4890 was 4727, checked in by idelkadi, 14 months ago

Merged trunk changes -r4488:4726 LMDZ_ECRad branch

  • 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
File size: 2.3 KB
Line 
1!
2! $Id: mod_const_para.F90 1279 2009-12-10 09:02:56Z fairhead $
3!
4MODULE mod_const_mpi
5  IMPLICIT NONE
6  INTEGER,SAVE :: COMM_LMDZ
7  INTEGER,SAVE :: MPI_REAL_LMDZ
8 
9
10CONTAINS
11
12  SUBROUTINE Init_const_mpi
13    USE lmdz_mpi
14
15#ifdef CPP_IOIPSL
16    USE IOIPSL, ONLY: getin
17#else
18! if not using IOIPSL, we still need to use (a local version of) getin
19    USE ioipsl_getincom, only: getin
20#endif
21! Use of Oasis-MCT coupler
22#ifdef CPP_OMCT
23    USE mod_prism
24#endif
25    USE wxios, only: wxios_init, using_xios
26    IMPLICIT NONE
27
28    INTEGER             :: ierr
29    INTEGER             :: comp_id
30    INTEGER             :: thread_required
31    INTEGER             :: thread_provided
32    CHARACTER(len = 6)  :: type_ocean
33
34!$OMP MASTER
35    type_ocean = 'force '
36    CALL getin('type_ocean', type_ocean)
37!$OMP END MASTER
38!$OMP BARRIER
39
40    IF (using_mpi) THEN
41      IF (type_ocean=='couple') THEN
42#ifdef CPP_COUPLE
43!$OMP MASTER
44        IF (using_xios) THEN
45          CALL wxios_init("LMDZ", outcom=COMM_LMDZ, type_ocean=type_ocean)
46        ELSE
47          CALL prism_init_comp_proto (comp_id, 'LMDZ', ierr)
48          CALL prism_get_localcomm_proto(COMM_LMDZ,ierr)
49        ENDIF
50!$OMP END MASTER
51#endif
52        MPI_REAL_LMDZ=MPI_REAL8
53      ELSE
54        CALL init_mpi
55      ENDIF
56    ENDIF
57  END SUBROUTINE Init_const_mpi
58 
59  SUBROUTINE Init_mpi
60    USE lmdz_mpi
61    USE wxios, only: wxios_init, using_xios
62
63  IMPLICIT NONE
64    INTEGER             :: ierr
65    INTEGER             :: thread_required
66    INTEGER             :: thread_provided
67
68!$OMP MASTER
69      thread_required=MPI_THREAD_SERIALIZED
70
71      CALL MPI_INIT_THREAD(thread_required,thread_provided,ierr)
72      IF (thread_provided < thread_required) THEN
73        PRINT *,'Warning : The multithreaded level of MPI librairy do not provide the requiered level',  &
74                ' in mod_const_mpi::Init_const_mpi'
75      ENDIF
76      COMM_LMDZ=MPI_COMM_WORLD
77      MPI_REAL_LMDZ=MPI_REAL8
78!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
79! Initialisation de XIOS
80!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
81      IF (using_xios) THEN
82        WRITE(*,*)'IN Init_mpi call wxios_init'
83        CALL wxios_init("LMDZ", outcom=COMM_LMDZ)
84      ENDIF
85!$OMP END MASTER
86
87END SUBROUTINE Init_mpi
88   
89END MODULE mod_const_mpi
Note: See TracBrowser for help on using the repository browser.