source: codes/icosagcm/devel/src/parallel/transfert.F90 @ 603

Last change on this file since 603 was 533, checked in by dubos, 7 years ago

devel : reorganization of source tree

File size: 5.2 KB
Line 
1MODULE transfert_mod
2
3#ifdef CPP_USING_MPI
4  USE transfert_mpi_mod, ONLY : init_transfert, transfert_request=>transfert_request_mpi, req_i1,req_e1_vect, &
5                                req_e1_scal, req_i0, req_e0_vect, req_e0_scal, request_add_point,             &
6                                create_request, gather_field, scatter_field,         &
7                                t_message, init_message=>init_message_mpi,           &
8                                transfert_message=>transfert_message_mpi,            &
9                                send_message=>send_message_mpi,                      &
10                                test_message=>test_message_mpi,                      &
11                                wait_message=>wait_message_mpi,barrier,bcast_mpi
12#else
13  USE transfert_mpi_mod, ONLY : init_transfert, transfert_request=>transfert_request_seq, req_i1,req_e1_vect, &
14                                req_e1_scal,req_i0, req_e0_vect, req_e0_scal,        &
15                                request_add_point, create_request, gather_field,     &
16                                scatter_field, t_message,                            &
17                                init_message=>init_message_seq,                      &
18                                transfert_message=>transfert_message_seq,            &
19                                send_message=>send_message_seq,                      &
20                                test_message=>test_message_seq,                      &
21                                wait_message=>wait_message_seq,barrier, bcast_mpi
22#endif
23
24  USE transfert_omp_mod
25 
26  INTERFACE bcast
27    MODULE PROCEDURE bcast_c,                                     &
28                     bcast_i,bcast_i1,bcast_i2,bcast_i3,bcast_i4, &
29                     bcast_r,bcast_r1,bcast_r2,bcast_r3,bcast_r4, &
30                     bcast_l,bcast_l1,bcast_l2,bcast_l3,bcast_l4
31
32  END INTERFACE
33
34
35CONTAINS
36
37
38!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
39!! Definition des Broadcast --> 4D   !!
40!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
41
42!! -- Les chaine de charactère -- !!
43
44  SUBROUTINE bcast_c(var)
45  IMPLICIT NONE
46    CHARACTER(LEN=*),INTENT(INOUT) :: Var
47   
48!$OMP MASTER
49    CALL bcast_mpi(Var)
50!$OMP END MASTER
51    CALL bcast_omp(Var)
52   
53  END SUBROUTINE bcast_c
54
55!! -- Les entiers -- !!
56 
57  SUBROUTINE bcast_i(var)
58  IMPLICIT NONE
59    INTEGER,INTENT(INOUT) :: Var
60!$OMP MASTER
61    CALL bcast_mpi(Var)
62!$OMP END MASTER
63    CALL bcast_omp(Var)
64   
65  END SUBROUTINE bcast_i
66
67  SUBROUTINE bcast_i1(var)
68  IMPLICIT NONE
69    INTEGER,INTENT(INOUT) :: Var(:)
70   
71!$OMP MASTER
72    CALL bcast_mpi(Var)
73!$OMP END MASTER
74    CALL bcast_omp(Var)
75   
76  END SUBROUTINE bcast_i1
77
78
79  SUBROUTINE bcast_i2(var)
80  IMPLICIT NONE
81    INTEGER,INTENT(INOUT) :: Var(:,:)
82   
83!$OMP MASTER
84    CALL bcast_mpi(Var)
85!$OMP END MASTER
86    CALL bcast_omp(Var)
87   
88  END SUBROUTINE bcast_i2
89
90
91  SUBROUTINE bcast_i3(var)
92  IMPLICIT NONE
93    INTEGER,INTENT(INOUT) :: Var(:,:,:)
94   
95!$OMP MASTER
96    CALL bcast_mpi(Var)
97!$OMP END MASTER
98    CALL bcast_omp(Var)
99   
100  END SUBROUTINE bcast_i3
101
102
103  SUBROUTINE bcast_i4(var)
104  IMPLICIT NONE
105    INTEGER,INTENT(INOUT) :: Var(:,:,:,:)
106   
107!$OMP MASTER
108    CALL bcast_mpi(Var)
109!$OMP END MASTER
110    CALL bcast_omp(Var)
111   
112  END SUBROUTINE bcast_i4
113
114 
115!! -- Les reels -- !!
116 
117  SUBROUTINE bcast_r(var)
118  IMPLICIT NONE
119    REAL,INTENT(INOUT) :: Var
120
121!$OMP MASTER
122    CALL bcast_mpi(Var)
123!$OMP END MASTER
124    CALL bcast_omp(Var)
125   
126  END SUBROUTINE bcast_r
127
128  SUBROUTINE bcast_r1(var)
129  IMPLICIT NONE
130    REAL,INTENT(INOUT) :: Var(:)
131   
132!$OMP MASTER
133    CALL bcast_mpi(Var)
134!$OMP END MASTER
135    CALL bcast_omp(Var)
136   
137  END SUBROUTINE bcast_r1
138
139
140  SUBROUTINE bcast_r2(var)
141  IMPLICIT NONE
142    REAL,INTENT(INOUT) :: Var(:,:)
143   
144!$OMP MASTER
145    CALL bcast_mpi(Var)
146!$OMP END MASTER
147    CALL bcast_omp(Var)
148   
149  END SUBROUTINE bcast_r2
150
151
152  SUBROUTINE bcast_r3(var)
153  IMPLICIT NONE
154    REAL,INTENT(INOUT) :: Var(:,:,:)
155   
156!$OMP MASTER
157    CALL bcast_mpi(Var)
158!$OMP END MASTER
159    CALL bcast_omp(Var)
160   
161  END SUBROUTINE bcast_r3
162
163
164  SUBROUTINE bcast_r4(var)
165  IMPLICIT NONE
166    REAL,INTENT(INOUT) :: Var(:,:,:,:)
167   
168!$OMP MASTER
169    CALL bcast_mpi(Var)
170!$OMP END MASTER
171    CALL bcast_omp(Var)
172   
173  END SUBROUTINE bcast_r4 
174
175
176!! -- Les booleens -- !!
177 
178  SUBROUTINE bcast_l(var)
179  IMPLICIT NONE
180    LOGICAL,INTENT(INOUT) :: Var
181!$OMP MASTER
182    CALL bcast_mpi(Var)
183!$OMP END MASTER
184    CALL bcast_omp(Var)
185   
186  END SUBROUTINE bcast_l
187
188  SUBROUTINE bcast_l1(var)
189  IMPLICIT NONE
190    LOGICAL,INTENT(INOUT) :: Var(:)
191   
192!$OMP MASTER
193    CALL bcast_mpi(Var)
194!$OMP END MASTER
195    CALL bcast_omp(Var)
196   
197  END SUBROUTINE bcast_l1
198
199
200  SUBROUTINE bcast_l2(var)
201  IMPLICIT NONE
202    LOGICAL,INTENT(INOUT) :: Var(:,:)
203   
204!$OMP MASTER
205    CALL bcast_mpi(Var)
206!$OMP END MASTER
207    CALL bcast_omp(Var)
208   
209  END SUBROUTINE bcast_l2
210
211
212  SUBROUTINE bcast_l3(var)
213  IMPLICIT NONE
214    LOGICAL,INTENT(INOUT) :: Var(:,:,:)
215   
216!$OMP MASTER
217    CALL bcast_mpi(Var)
218!$OMP END MASTER
219    CALL bcast_omp(Var)
220   
221  END SUBROUTINE bcast_l3
222
223
224  SUBROUTINE bcast_l4(var)
225  IMPLICIT NONE
226    LOGICAL,INTENT(INOUT) :: Var(:,:,:,:)
227   
228!$OMP MASTER
229    CALL bcast_mpi(Var)
230!$OMP END MASTER
231    CALL bcast_omp(Var)
232   
233  END SUBROUTINE bcast_l4
234
235 
236END MODULE transfert_mod
Note: See TracBrowser for help on using the repository browser.