SURFEX v8.1
General documentation of Surfex
mpl_setdflt_comm_mod.F90
Go to the documentation of this file.
2 
3 !**** MPL_SETDFLT_COMM Set new default communicator
4 
5 ! Purpose.
6 ! --------
7 ! Set new communicator as default, and return old communicator
8 
9 !** Interface.
10 ! ----------
11 ! CALL MPL_SETDFLT_COMM(KCOMM,KCOMM_OLD)
12 
13 ! Input required arguments :
14 ! -------------------------
15 ! KCOMM - New communicator
16 
17 ! Input optional arguments :
18 ! -------------------------
19 
20 ! Output required arguments :
21 ! -------------------------
22 ! KCOMM_OLD - Old communicator
23 
24 ! Output optional arguments :
25 ! -------------------------
26 
27 ! Author.
28 ! -------
29 ! J.Hague
30 
31 ! Modifications.
32 ! --------------
33 ! Original: 2003-16-07
34 
35 ! ------------------------------------------------------------------
36 
37 USE parkind1 ,ONLY : jpim ,jprb
38 
39 USE mpl_mpif
42 
43 IMPLICIT NONE
44 
45 PRIVATE
46 PUBLIC mpl_setdflt_comm
47 
48 CONTAINS
49 
50 
51 SUBROUTINE mpl_setdflt_comm(KCOMM,KCOMM_OLD)
52 
53 
54 #ifdef USE_8_BYTE_WORDS
55  USE mpi4to8, ONLY : &
56  mpi_comm_size => mpi_comm_size8
57 #endif
58 
59 
60 INTEGER(KIND=JPIM),INTENT(IN) :: KCOMM
61 INTEGER(KIND=JPIM),INTENT(OUT) :: KCOMM_OLD
62 
63 INTEGER(KIND=JPIM) :: IER
64 INTEGER(KIND=JPIM) :: ITID
65 itid = oml_my_thread()
66 
67 kcomm_old=mpl_comm_oml(itid)
68 mpl_comm_oml(itid)=kcomm
69 
70 CALL mpi_comm_size(kcomm,mpl_numproc,ier)
71 
72 RETURN
73 END SUBROUTINE mpl_setdflt_comm
74 
75 END MODULE mpl_setdflt_comm_mod
integer, parameter jpim
Definition: parkind1.F90:13
integer(kind=jpim) mpl_numproc
integer(kind=jpim), dimension(:), allocatable mpl_comm_oml
integer, parameter jprb
Definition: parkind1.F90:32
subroutine, public mpl_setdflt_comm(KCOMM, KCOMM_OLD)