source: trunk/LMDZ.COMMON/libf/dyn3dpar/mod_const_mpi.F90 @ 1243

Last change on this file since 1243 was 979, checked in by emillour, 12 years ago

Common dynamics:
Updates in the dynamics (seq and ) to keep up with updates
in LMDZ5 (up to LMDZ5 trunk, rev 1760):

  • General stuff (essentially to keep up with Earth model):
  • Updated makelmdz_fcm and makelmdz (more control on dimension.h, added option -mem, although it is not usefull for now)
  • Updated build_gcm with more control over fcm
  • Updated create_make_gcm (enable looking for code in subdirectories)
  • bibio:
  • updates (just renaming the files actually...) new_unit.F90 => new_unit_m.F90, pchsp_95.F90 => pchsp_95_m.F90 and pchfe_95.F90 => pchfe_95_m.F90
  • filtrez:
  • mod_fft.F90: use more baseline CPP directives for preprocessor compatibility
  • mod_filtre_fft_loc.F90: added this new file
  • filtreg_mod.f90: added calls to init_..._loc
  • filtreg.F: fixed calls to DGEMM into SGEMM (preprocessing does the switch)
  • dyn3d:
  • removed obsolete files: etat0_netcdf.F90 limit_netcdf.F90

pres2lev.F90

  • added new file : pres2lev_mod.F90 (module containing "old" pres2lev)
  • gcm.F: changed args to call to inidissip (added arg "vert_prof_dissip")
  • inidissip.F90: added arg "vert_prof_dissip" and the "earth model" discterizations (flagged with "planet_type=="earth")
  • comdissnew.h: added 'vert_prof_dissip' to the common block
  • guide_mod.F90: added the "use pres2lev_mod"
  • conf_gcm.F: cosmetics, and evaluation of vert_prof_dissip, (and also of dissip_* factors, for Earth model)
  • comconst.h : added dissip_factz,dissip_zref variables (for Earth mode dissip)
  • dyn3dpar:
  • removed obsolete files: etat0_netcdf.F90 limit_netcdf.F90

pres2lev.F90 mod_const_para.F90

  • added new files: pres2lev_mod.F90 (module containing "old" pres2lev)

mod_const_mpi

  • abort_gcm : better control of abort in parallel mode
  • gcm.F: changed args to call to inidissip (added arg "vert_prof_dissip")
  • inidissip.F90: added arg "vert_prof_dissip" and the "earth model" discterizations (flagged with "planet_type=="earth")
  • comdissnew.h: added 'vert_prof_dissip' to the common block
  • filtreg_p.F : bug correction (array bounds)
  • guide_p_mod.F90 : added the "use pres2lev_mod"
  • conf_gcm.F : cosmetics (and evaluation of vert_prof_dissip , and

also of dissip_* factors, for Earth model)
plus check if "adjust" is indeed not used in OpenMP

  • comconst.h : add dissip_factz,dissip_zref variables (for Earth mode dissip)

EM

File size: 1.7 KB
Line 
1!
2! $Id: mod_const_mpi.F90 1700 2012-12-20 14:43:19Z lguez $
3!
4MODULE mod_const_mpi
5
6  INTEGER,SAVE :: COMM_LMDZ
7  INTEGER,SAVE :: MPI_REAL_LMDZ
8 
9
10CONTAINS
11
12  SUBROUTINE Init_const_mpi
13#ifdef CPP_IOIPSL
14    USE IOIPSL
15#else
16! if not using IOIPSL, we still need to use (a local version of) getin
17    USE ioipsl_getincom
18#endif
19
20    IMPLICIT NONE
21#ifdef CPP_MPI
22    INCLUDE 'mpif.h'
23#endif
24    INTEGER             :: ierr
25    INTEGER             :: comp_id
26    INTEGER             :: thread_required
27    INTEGER             :: thread_provided
28    CHARACTER(len = 6)  :: type_ocean
29
30!$OMP MASTER
31    type_ocean = 'force '
32    CALL getin('type_ocean', type_ocean)
33!$OMP END MASTER
34!$OMP BARRIER
35
36    IF (type_ocean=='couple') THEN
37#ifdef CPP_COUPLE
38!$OMP MASTER
39       CALL prism_init_comp_proto (comp_id, 'lmdz.x', ierr)
40       CALL prism_get_localcomm_proto(COMM_LMDZ,ierr)
41!$OMP END MASTER
42#endif
43#ifdef CPP_MPI
44      MPI_REAL_LMDZ=MPI_REAL8
45#endif
46    ELSE
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
62!$OMP MASTER
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
72!$OMP END MASTER
73#endif
74
75   END SUBROUTINE Init_mpi
76   
77END MODULE mod_const_mpi
Note: See TracBrowser for help on using the repository browser.