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

Last change on this file since 2094 was 1279, checked in by Laurent Fairhead, 15 years ago

Merged LMDZ4-dev branch changes r1241:1278 into the trunk
Running trunk and LMDZ4-dev in LMDZOR configuration on local
machine (sequential) and SX8 (4-proc) yields identical results
(restart and restartphy are identical binarily)
Log history from r1241 to r1278 is available by switching to
source:LMDZ4/branches/LMDZ4-dev-20091210

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.6 KB
RevLine 
[1279]1!
2! $Id: mod_const_para.F90 1279 2009-12-10 09:02:56Z lguez $
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
53  IMPLICIT NONE
54#ifdef CPP_MPI
55     INCLUDE 'mpif.h'
56#endif
57    INTEGER             :: ierr
58    INTEGER             :: thread_required
59    INTEGER             :: thread_provided
60
61#ifdef CPP_MPI
[985]62!$OMP MASTER
[1000]63      thread_required=MPI_THREAD_SERIALIZED
64
65      CALL MPI_INIT_THREAD(thread_required,thread_provided,ierr)
66      IF (thread_provided < thread_required) THEN
67        PRINT *,'Warning : The multithreaded level of MPI librairy do not provide the requiered level',  &
68                ' in mod_const_mpi::Init_const_mpi'
69      ENDIF
70      COMM_LMDZ=MPI_COMM_WORLD
71      MPI_REAL_LMDZ=MPI_REAL8
[985]72!$OMP END MASTER
[1000]73#endif
[806]74
[1000]75   END SUBROUTINE Init_mpi
76   
[774]77END MODULE mod_const_mpi
Note: See TracBrowser for help on using the repository browser.