GCC Code Coverage Report


Directory: ./
File: phy_common/mod_phys_lmdz_mpi_transfert.f90
Date: 2022-01-11 19:19:34
Exec Total Coverage
Lines: 88 544 16.2%
Branches: 80 938 8.5%

Line Branch Exec Source
1 !
2 !$Id: mod_phys_lmdz_mpi_transfert.F90 3465 2019-03-14 09:34:31Z fairhead $
3 !
4 MODULE mod_phys_lmdz_mpi_transfert
5
6
7 INTERFACE bcast_mpi
8 MODULE PROCEDURE bcast_mpi_c, &
9 bcast_mpi_i,bcast_mpi_i1,bcast_mpi_i2,bcast_mpi_i3,bcast_mpi_i4, &
10 bcast_mpi_r,bcast_mpi_r1,bcast_mpi_r2,bcast_mpi_r3,bcast_mpi_r4, &
11 bcast_mpi_l,bcast_mpi_l1,bcast_mpi_l2,bcast_mpi_l3,bcast_mpi_l4
12 END INTERFACE
13
14 INTERFACE scatter_mpi
15 MODULE PROCEDURE scatter_mpi_i,scatter_mpi_i1,scatter_mpi_i2,scatter_mpi_i3, &
16 scatter_mpi_r,scatter_mpi_r1,scatter_mpi_r2,scatter_mpi_r3, &
17 scatter_mpi_l,scatter_mpi_l1,scatter_mpi_l2,scatter_mpi_l3
18 END INTERFACE
19
20
21 INTERFACE gather_mpi
22 MODULE PROCEDURE gather_mpi_i,gather_mpi_i1,gather_mpi_i2,gather_mpi_i3, &
23 gather_mpi_r,gather_mpi_r1,gather_mpi_r2,gather_mpi_r3, &
24 gather_mpi_l,gather_mpi_l1,gather_mpi_l2,gather_mpi_l3
25 END INTERFACE
26
27 INTERFACE scatter2D_mpi
28 MODULE PROCEDURE scatter2D_mpi_i,scatter2D_mpi_i1,scatter2D_mpi_i2,scatter2D_mpi_i3, &
29 scatter2D_mpi_r,scatter2D_mpi_r1,scatter2D_mpi_r2,scatter2D_mpi_r3, &
30 scatter2D_mpi_l,scatter2D_mpi_l1,scatter2D_mpi_l2,scatter2D_mpi_l3
31 END INTERFACE
32
33 INTERFACE gather2D_mpi
34 MODULE PROCEDURE gather2D_mpi_i,gather2D_mpi_i1,gather2D_mpi_i2,gather2D_mpi_i3, &
35 gather2D_mpi_r,gather2D_mpi_r1,gather2D_mpi_r2,gather2D_mpi_r3, &
36 gather2D_mpi_l,gather2D_mpi_l1,gather2D_mpi_l2,gather2D_mpi_l3
37 END INTERFACE
38
39 INTERFACE reduce_sum_mpi
40 MODULE PROCEDURE reduce_sum_mpi_i,reduce_sum_mpi_i1,reduce_sum_mpi_i2,reduce_sum_mpi_i3,reduce_sum_mpi_i4, &
41 reduce_sum_mpi_r,reduce_sum_mpi_r1,reduce_sum_mpi_r2,reduce_sum_mpi_r3,reduce_sum_mpi_r4
42 END INTERFACE
43
44 INTERFACE reduce_min_mpi
45 MODULE PROCEDURE reduce_min_mpi_i,reduce_min_mpi_i1,reduce_min_mpi_i2,reduce_min_mpi_i3,reduce_min_mpi_i4, &
46 reduce_min_mpi_r,reduce_min_mpi_r1,reduce_min_mpi_r2,reduce_min_mpi_r3,reduce_min_mpi_r4
47 END INTERFACE
48
49 INTERFACE grid1dTo2d_mpi
50 MODULE PROCEDURE grid1dTo2d_mpi_i,grid1dTo2d_mpi_i1,grid1dTo2d_mpi_i2,grid1dTo2d_mpi_i3, &
51 grid1dTo2d_mpi_r,grid1dTo2d_mpi_r1,grid1dTo2d_mpi_r2,grid1dTo2d_mpi_r3, &
52 grid1dTo2d_mpi_l,grid1dTo2d_mpi_l1,grid1dTo2d_mpi_l2,grid1dTo2d_mpi_l3
53 END INTERFACE
54
55 INTERFACE grid2dTo1d_mpi
56 MODULE PROCEDURE grid2dTo1d_mpi_i,grid2dTo1d_mpi_i1,grid2dTo1d_mpi_i2,grid2dTo1d_mpi_i3, &
57 grid2dTo1d_mpi_r,grid2dTo1d_mpi_r1,grid2dTo1d_mpi_r2,grid2dTo1d_mpi_r3, &
58 grid2dTo1d_mpi_l,grid2dTo1d_mpi_l1,grid2dTo1d_mpi_l2,grid2dTo1d_mpi_l3
59 END INTERFACE
60
61 CONTAINS
62
63 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
64 !! Definition des Broadcast --> 4D !!
65 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
66
67 !! -- Les chaine de charact´┐Żre -- !!
68
69 2 SUBROUTINE bcast_mpi_c(var1)
70 IMPLICIT NONE
71 CHARACTER(LEN=*),INTENT(INOUT) :: Var1
72
73 CALL bcast_mpi_cgen(Var1,len(Var1))
74
75 2 END SUBROUTINE bcast_mpi_c
76
77 !! -- Les entiers -- !!
78
79 757 SUBROUTINE bcast_mpi_i(var)
80 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
81 IMPLICIT NONE
82 INTEGER,INTENT(INOUT) :: Var
83
84 INTEGER :: var_tmp(1)
85
86
1/2
✓ Branch 0 taken 757 times.
✗ Branch 1 not taken.
757 IF (is_mpi_root) var_tmp(1)=var
87 CALL bcast_mpi_igen(Var_tmp,1)
88 757 var=var_tmp(1)
89
90 757 END SUBROUTINE bcast_mpi_i
91
92 SUBROUTINE bcast_mpi_i1(var)
93 IMPLICIT NONE
94 INTEGER,INTENT(INOUT) :: Var(:)
95
96 CALL bcast_mpi_igen(Var,size(Var))
97
98 END SUBROUTINE bcast_mpi_i1
99
100 SUBROUTINE bcast_mpi_i2(var)
101 IMPLICIT NONE
102 INTEGER,INTENT(INOUT) :: Var(:,:)
103
104 CALL bcast_mpi_igen(Var,size(Var))
105
106 END SUBROUTINE bcast_mpi_i2
107
108 SUBROUTINE bcast_mpi_i3(var)
109 IMPLICIT NONE
110 INTEGER,INTENT(INOUT) :: Var(:,:,:)
111
112 CALL bcast_mpi_igen(Var,size(Var))
113
114 END SUBROUTINE bcast_mpi_i3
115
116 SUBROUTINE bcast_mpi_i4(var)
117 IMPLICIT NONE
118 INTEGER,INTENT(INOUT) :: Var(:,:,:,:)
119
120 CALL bcast_mpi_igen(Var,size(Var))
121
122 END SUBROUTINE bcast_mpi_i4
123
124
125 !! -- Les reels -- !!
126
127 540 SUBROUTINE bcast_mpi_r(var)
128 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
129 IMPLICIT NONE
130 REAL,INTENT(INOUT) :: Var
131 REAL :: var_tmp(1)
132
133
1/2
✓ Branch 0 taken 540 times.
✗ Branch 1 not taken.
540 IF (is_mpi_root) var_tmp(1)=var
134 CALL bcast_mpi_rgen(Var_tmp,1)
135 540 var=var_tmp(1)
136
137 540 END SUBROUTINE bcast_mpi_r
138
139
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 5 times.
5 SUBROUTINE bcast_mpi_r1(var)
140 IMPLICIT NONE
141 REAL,INTENT(INOUT) :: Var(:)
142
143
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
5 CALL bcast_mpi_rgen(Var,size(Var))
144
145 5 END SUBROUTINE bcast_mpi_r1
146
147 SUBROUTINE bcast_mpi_r2(var)
148 IMPLICIT NONE
149 REAL,INTENT(INOUT) :: Var(:,:)
150
151 CALL bcast_mpi_rgen(Var,size(Var))
152
153 END SUBROUTINE bcast_mpi_r2
154
155 SUBROUTINE bcast_mpi_r3(var)
156 IMPLICIT NONE
157 REAL,INTENT(INOUT) :: Var(:,:,:)
158
159 CALL bcast_mpi_rgen(Var,size(Var))
160
161 END SUBROUTINE bcast_mpi_r3
162
163 SUBROUTINE bcast_mpi_r4(var)
164 IMPLICIT NONE
165 REAL,INTENT(INOUT) :: Var(:,:,:,:)
166
167 CALL bcast_mpi_rgen(Var,size(Var))
168
169 END SUBROUTINE bcast_mpi_r4
170
171 !! -- Les booleans -- !!
172
173 855 SUBROUTINE bcast_mpi_l(var)
174 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
175 IMPLICIT NONE
176 LOGICAL,INTENT(INOUT) :: Var
177 LOGICAL :: var_tmp(1)
178
179
1/2
✓ Branch 0 taken 855 times.
✗ Branch 1 not taken.
855 IF (is_mpi_root) var_tmp(1)=var
180 CALL bcast_mpi_lgen(Var_tmp,1)
181 855 var=var_tmp(1)
182
183 855 END SUBROUTINE bcast_mpi_l
184
185 SUBROUTINE bcast_mpi_l1(var)
186 IMPLICIT NONE
187 LOGICAL,INTENT(INOUT) :: Var(:)
188
189 CALL bcast_mpi_lgen(Var,size(Var))
190
191 END SUBROUTINE bcast_mpi_l1
192
193 SUBROUTINE bcast_mpi_l2(var)
194 IMPLICIT NONE
195 LOGICAL,INTENT(INOUT) :: Var(:,:)
196
197 CALL bcast_mpi_lgen(Var,size(Var))
198
199 END SUBROUTINE bcast_mpi_l2
200
201 SUBROUTINE bcast_mpi_l3(var)
202 IMPLICIT NONE
203 LOGICAL,INTENT(INOUT) :: Var(:,:,:)
204
205 CALL bcast_mpi_lgen(Var,size(Var))
206
207 END SUBROUTINE bcast_mpi_l3
208
209 SUBROUTINE bcast_mpi_l4(var)
210 IMPLICIT NONE
211 LOGICAL,INTENT(INOUT) :: Var(:,:,:,:)
212
213 CALL bcast_mpi_lgen(Var,size(Var))
214
215 END SUBROUTINE bcast_mpi_l4
216
217 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
218 !! Definition des Scatter --> 4D !!
219 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
220
221 SUBROUTINE scatter_mpi_i(VarIn, VarOut)
222 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
223 IMPLICIT NONE
224
225 INTEGER,INTENT(IN),DIMENSION(:) :: VarIn
226 INTEGER,INTENT(OUT),DIMENSION(:) :: VarOut
227
228 CALL scatter_mpi_igen(VarIn,Varout,1)
229
230 END SUBROUTINE scatter_mpi_i
231
232 SUBROUTINE scatter_mpi_i1(VarIn, VarOut)
233 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
234 IMPLICIT NONE
235
236 INTEGER,INTENT(IN),DIMENSION(:,:) :: VarIn
237 INTEGER,INTENT(OUT),DIMENSION(:,:) :: VarOut
238
239 CALL scatter_mpi_igen(VarIn,Varout,Size(VarOut,2))
240
241 END SUBROUTINE scatter_mpi_i1
242
243 SUBROUTINE scatter_mpi_i2(VarIn, VarOut)
244 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
245 IMPLICIT NONE
246
247 INTEGER,INTENT(IN),DIMENSION(:,:,:) :: VarIn
248 INTEGER,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
249
250 CALL scatter_mpi_igen(VarIn,Varout,Size(VarOut,2)*Size(VarOut,3))
251
252 END SUBROUTINE scatter_mpi_i2
253
254 SUBROUTINE scatter_mpi_i3(VarIn, VarOut)
255 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
256 IMPLICIT NONE
257
258 INTEGER,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
259 INTEGER,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
260
261 CALL scatter_mpi_igen(VarIn,Varout,Size(VarOut,2)*Size(VarOut,3)*Size(VarOut,4))
262
263 END SUBROUTINE scatter_mpi_i3
264
265
266
2/4
✗ Branch 0 not taken.
✓ Branch 1 taken 52 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 52 times.
52 SUBROUTINE scatter_mpi_r(VarIn, VarOut)
267 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
268 IMPLICIT NONE
269
270 REAL,INTENT(IN),DIMENSION(:) :: VarIn
271 REAL,INTENT(OUT),DIMENSION(:) :: VarOut
272
273
2/4
✗ Branch 3 not taken.
✓ Branch 4 taken 52 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 52 times.
52 CALL scatter_mpi_rgen(VarIn,Varout,1)
274
275 52 END SUBROUTINE scatter_mpi_r
276
277
2/4
✗ Branch 0 not taken.
✓ Branch 1 taken 322 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 322 times.
322 SUBROUTINE scatter_mpi_r1(VarIn, VarOut)
278 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
279 IMPLICIT NONE
280
281 REAL,INTENT(IN),DIMENSION(:,:) :: VarIn
282 REAL,INTENT(OUT),DIMENSION(:,:) :: VarOut
283
284
2/4
✗ Branch 3 not taken.
✓ Branch 4 taken 322 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 322 times.
322 CALL scatter_mpi_rgen(VarIn,Varout,Size(VarOut,2))
285
286 322 END SUBROUTINE scatter_mpi_r1
287
288 SUBROUTINE scatter_mpi_r2(VarIn, VarOut)
289 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
290 IMPLICIT NONE
291
292 REAL,INTENT(IN),DIMENSION(:,:,:) :: VarIn
293 REAL,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
294
295 CALL scatter_mpi_rgen(VarIn,Varout,Size(VarOut,2)*Size(VarOut,3))
296
297 END SUBROUTINE scatter_mpi_r2
298
299 SUBROUTINE scatter_mpi_r3(VarIn, VarOut)
300 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
301 IMPLICIT NONE
302
303 REAL,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
304 REAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
305
306 CALL scatter_mpi_rgen(VarIn,Varout,Size(VarOut,2)*Size(VarOut,3)*Size(VarOut,4))
307
308 END SUBROUTINE scatter_mpi_r3
309
310
311 SUBROUTINE scatter_mpi_l(VarIn, VarOut)
312 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
313 IMPLICIT NONE
314
315 LOGICAL,INTENT(IN),DIMENSION(:) :: VarIn
316 LOGICAL,INTENT(OUT),DIMENSION(:) :: VarOut
317
318 CALL scatter_mpi_lgen(VarIn,Varout,1)
319
320 END SUBROUTINE scatter_mpi_l
321
322 SUBROUTINE scatter_mpi_l1(VarIn, VarOut)
323 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
324 IMPLICIT NONE
325
326 LOGICAL,INTENT(IN),DIMENSION(:,:) :: VarIn
327 LOGICAL,INTENT(OUT),DIMENSION(:,:) :: VarOut
328
329 CALL scatter_mpi_lgen(VarIn,Varout,Size(VarOut,2))
330
331 END SUBROUTINE scatter_mpi_l1
332
333 SUBROUTINE scatter_mpi_l2(VarIn, VarOut)
334 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
335 IMPLICIT NONE
336
337 LOGICAL,INTENT(IN),DIMENSION(:,:,:) :: VarIn
338 LOGICAL,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
339
340 CALL scatter_mpi_lgen(VarIn,Varout,Size(VarOut,2)*Size(VarOut,3))
341
342 END SUBROUTINE scatter_mpi_l2
343
344 SUBROUTINE scatter_mpi_l3(VarIn, VarOut)
345 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
346 IMPLICIT NONE
347
348 LOGICAL,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
349 LOGICAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
350
351 CALL scatter_mpi_lgen(VarIn,Varout,Size(VarOut,2)*Size(VarOut,3)*Size(VarOut,4))
352
353 END SUBROUTINE scatter_mpi_l3
354
355 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
356 !! Definition des Gather --> 4D !!
357 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
358
359 !!!!! --> Les entiers
360
361
2/4
✗ Branch 0 not taken.
✓ Branch 1 taken 563 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 563 times.
563 SUBROUTINE gather_mpi_i(VarIn, VarOut)
362 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
363 IMPLICIT NONE
364
365 INTEGER,INTENT(IN),DIMENSION(:) :: VarIn
366 INTEGER,INTENT(OUT),DIMENSION(:) :: VarOut
367
368
2/4
✗ Branch 3 not taken.
✓ Branch 4 taken 563 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 563 times.
563 CALL gather_mpi_igen(VarIn,VarOut,1)
369
370 563 END SUBROUTINE gather_mpi_i
371
372
373 !!!!!
374
375 SUBROUTINE gather_mpi_i1(VarIn, VarOut)
376 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
377 IMPLICIT NONE
378
379 INTEGER,INTENT(IN),DIMENSION(:,:) :: VarIn
380 INTEGER,INTENT(OUT),DIMENSION(:,:) :: VarOut
381
382 CALL gather_mpi_igen(VarIn,VarOut,Size(VarIn,2))
383
384 END SUBROUTINE gather_mpi_i1
385
386 !!!!!
387
388 SUBROUTINE gather_mpi_i2(VarIn, VarOut)
389 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
390 IMPLICIT NONE
391
392 INTEGER,INTENT(IN),DIMENSION(:,:,:) :: VarIn
393 INTEGER,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
394
395 CALL gather_mpi_igen(VarIn,VarOut,Size(VarIn,2)*Size(VarIn,3))
396
397 END SUBROUTINE gather_mpi_i2
398
399 !!!!!
400
401 SUBROUTINE gather_mpi_i3(VarIn, VarOut)
402 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
403 IMPLICIT NONE
404
405 INTEGER,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
406 INTEGER,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
407
408 CALL gather_mpi_igen(VarIn,VarOut,Size(VarIn,2)*Size(VarIn,3)*Size(VarIn,4))
409
410 END SUBROUTINE gather_mpi_i3
411
412 !!!!! --> Les reels
413
414
2/4
✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 4 times.
4 SUBROUTINE gather_mpi_r(VarIn, VarOut)
415 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
416 IMPLICIT NONE
417
418 REAL,INTENT(IN),DIMENSION(:) :: VarIn
419 REAL,INTENT(OUT),DIMENSION(:) :: VarOut
420
421
2/4
✗ Branch 3 not taken.
✓ Branch 4 taken 4 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 4 times.
4 CALL gather_mpi_rgen(VarIn,VarOut,1)
422
423 4 END SUBROUTINE gather_mpi_r
424
425 !!!!!
426
427
2/4
✗ Branch 0 not taken.
✓ Branch 1 taken 214 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 214 times.
214 SUBROUTINE gather_mpi_r1(VarIn, VarOut)
428 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
429 IMPLICIT NONE
430
431 REAL,INTENT(IN),DIMENSION(:,:) :: VarIn
432 REAL,INTENT(OUT),DIMENSION(:,:) :: VarOut
433
434
2/4
✗ Branch 3 not taken.
✓ Branch 4 taken 214 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 214 times.
214 CALL gather_mpi_rgen(VarIn,VarOut,Size(VarIn,2))
435
436 214 END SUBROUTINE gather_mpi_r1
437
438 !!!!!
439
440 SUBROUTINE gather_mpi_r2(VarIn, VarOut)
441 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
442 IMPLICIT NONE
443
444 REAL,INTENT(IN),DIMENSION(:,:,:) :: VarIn
445 REAL,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
446
447 CALL gather_mpi_rgen(VarIn,VarOut,Size(VarIn,2)*Size(VarIn,3))
448
449 END SUBROUTINE gather_mpi_r2
450
451 !!!!!
452
453 SUBROUTINE gather_mpi_r3(VarIn, VarOut)
454 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
455 IMPLICIT NONE
456
457 REAL,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
458 REAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
459
460 CALL gather_mpi_rgen(VarIn,VarOut,Size(VarIn,2)*Size(VarIn,3)*Size(VarIn,4))
461
462 END SUBROUTINE gather_mpi_r3
463
464 !!!!! --> Les booleen
465
466 SUBROUTINE gather_mpi_l(VarIn, VarOut)
467 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
468 IMPLICIT NONE
469
470 LOGICAL,INTENT(IN),DIMENSION(:) :: VarIn
471 LOGICAL,INTENT(OUT),DIMENSION(:) :: VarOut
472
473 CALL gather_mpi_lgen(VarIn,VarOut,1)
474
475 END SUBROUTINE gather_mpi_l
476
477 !!!!!
478
479 SUBROUTINE gather_mpi_l1(VarIn, VarOut)
480 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
481 IMPLICIT NONE
482
483 LOGICAL,INTENT(IN),DIMENSION(:,:) :: VarIn
484 LOGICAL,INTENT(OUT),DIMENSION(:,:) :: VarOut
485
486 CALL gather_mpi_lgen(VarIn,VarOut,Size(VarIn,2))
487
488 END SUBROUTINE gather_mpi_l1
489
490 !!!!!
491
492 SUBROUTINE gather_mpi_l2(VarIn, VarOut)
493 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
494 IMPLICIT NONE
495
496 LOGICAL,INTENT(IN),DIMENSION(:,:,:) :: VarIn
497 LOGICAL,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
498
499 CALL gather_mpi_lgen(VarIn,VarOut,Size(VarIn,2)*Size(VarIn,3))
500
501 END SUBROUTINE gather_mpi_l2
502
503 !!!!!
504
505 SUBROUTINE gather_mpi_l3(VarIn, VarOut)
506 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
507 IMPLICIT NONE
508
509 LOGICAL,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
510 LOGICAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
511
512 CALL gather_mpi_lgen(VarIn,VarOut,Size(VarIn,2)*Size(VarIn,3)*Size(VarIn,4))
513
514 END SUBROUTINE gather_mpi_l3
515
516 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
517 !! Definition des Scatter2D --> 4D !!
518 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
519
520 SUBROUTINE scatter2D_mpi_i(VarIn, VarOut)
521 USE mod_grid_phy_lmdz
522 IMPLICIT NONE
523
524 INTEGER,INTENT(IN),DIMENSION(:,:) :: VarIn
525 INTEGER,INTENT(OUT),DIMENSION(:) :: VarOut
526
527 INTEGER,DIMENSION(klon_glo) :: Var_tmp
528
529 CALL grid2dTo1d_glo(VarIn,Var_tmp)
530 CALL scatter_mpi(Var_tmp,VarOut)
531
532 END SUBROUTINE scatter2D_mpi_i
533
534 SUBROUTINE scatter2D_mpi_i1(VarIn, VarOut)
535 USE mod_grid_phy_lmdz
536 IMPLICIT NONE
537
538 INTEGER,INTENT(IN),DIMENSION(:,:,:) :: VarIn
539 INTEGER,INTENT(OUT),DIMENSION(:,:) :: VarOut
540 INTEGER,DIMENSION(klon_glo,size(VarOut,2)) :: Var_tmp
541
542 CALL grid2dTo1d_glo(VarIn,Var_tmp)
543 CALL scatter_mpi(Var_tmp,VarOut)
544
545 END SUBROUTINE scatter2D_mpi_i1
546
547 SUBROUTINE scatter2D_mpi_i2(VarIn, VarOut)
548 USE mod_grid_phy_lmdz
549 IMPLICIT NONE
550
551 INTEGER,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
552 INTEGER,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
553
554 INTEGER,DIMENSION(klon_glo,size(VarOut,2),size(VarOut,3)) :: Var_tmp
555
556 CALL grid2dTo1d_glo(VarIn,Var_tmp)
557 CALL scatter_mpi(Var_tmp,VarOut)
558
559 END SUBROUTINE scatter2D_mpi_i2
560
561 SUBROUTINE scatter2D_mpi_i3(VarIn, VarOut)
562 USE mod_grid_phy_lmdz
563 IMPLICIT NONE
564
565 INTEGER,INTENT(IN),DIMENSION(:,:,:,:,:) :: VarIn
566 INTEGER,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
567 INTEGER,DIMENSION(klon_glo,size(VarOut,2),size(VarOut,3),size(VarOut,4)) :: Var_tmp
568
569 CALL grid2dTo1d_glo(VarIn,Var_tmp)
570 CALL scatter_mpi(Var_tmp,VarOut)
571
572 END SUBROUTINE scatter2D_mpi_i3
573
574
575
576 SUBROUTINE scatter2D_mpi_r(VarIn, VarOut)
577 USE mod_grid_phy_lmdz
578 IMPLICIT NONE
579
580 REAL,INTENT(IN),DIMENSION(:,:) :: VarIn
581 REAL,INTENT(OUT),DIMENSION(:) :: VarOut
582
583 REAL,DIMENSION(klon_glo) :: Var_tmp
584
585 CALL grid2dTo1d_glo(VarIn,Var_tmp)
586 CALL scatter_mpi(Var_tmp,VarOut)
587
588 END SUBROUTINE scatter2D_mpi_R
589
590
591 SUBROUTINE scatter2D_mpi_r1(VarIn, VarOut)
592 USE mod_grid_phy_lmdz
593 IMPLICIT NONE
594 REAL,INTENT(IN),DIMENSION(:,:,:) :: VarIn
595 REAL,INTENT(OUT),DIMENSION(:,:) :: VarOut
596
597 REAL,DIMENSION(klon_glo,size(VarOut,2)) :: Var_tmp
598
599 CALL grid2dTo1d_glo(VarIn,Var_tmp)
600 CALL scatter_mpi(Var_tmp,VarOut)
601
602 END SUBROUTINE scatter2D_mpi_r1
603
604
605 SUBROUTINE scatter2D_mpi_r2(VarIn, VarOut)
606 USE mod_grid_phy_lmdz
607 IMPLICIT NONE
608
609 REAL,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
610 REAL,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
611
612 REAL,DIMENSION(klon_glo,size(VarOut,2),size(VarOut,3)) :: Var_tmp
613
614 CALL grid2dTo1d_glo(VarIn,Var_tmp)
615 CALL scatter_mpi(Var_tmp,VarOut)
616
617 END SUBROUTINE scatter2D_mpi_r2
618
619 SUBROUTINE scatter2D_mpi_r3(VarIn, VarOut)
620 USE mod_grid_phy_lmdz
621 IMPLICIT NONE
622
623 REAL,INTENT(IN),DIMENSION(:,:,:,:,:) :: VarIn
624 REAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
625
626 REAL,DIMENSION(klon_glo,size(VarOut,2),size(VarOut,3),size(VarOut,4)) :: Var_tmp
627
628 CALL grid2dTo1d_glo(VarIn,Var_tmp)
629 CALL scatter_mpi(Var_tmp,VarOut)
630
631 END SUBROUTINE scatter2D_mpi_r3
632
633
634 SUBROUTINE scatter2D_mpi_l(VarIn, VarOut)
635 USE mod_grid_phy_lmdz
636 IMPLICIT NONE
637
638 LOGICAL,INTENT(IN),DIMENSION(:,:) :: VarIn
639 LOGICAL,INTENT(OUT),DIMENSION(:) :: VarOut
640
641 LOGICAL,DIMENSION(klon_glo) :: Var_tmp
642
643 CALL grid2dTo1d_glo(VarIn,Var_tmp)
644 CALL scatter_mpi(Var_tmp,VarOut)
645
646 END SUBROUTINE scatter2D_mpi_l
647
648
649 SUBROUTINE scatter2D_mpi_l1(VarIn, VarOut)
650 USE mod_grid_phy_lmdz
651 IMPLICIT NONE
652
653 LOGICAL,INTENT(IN),DIMENSION(:,:,:) :: VarIn
654 LOGICAL,INTENT(OUT),DIMENSION(:,:) :: VarOut
655
656 LOGICAL,DIMENSION(klon_glo,size(VarOut,2)) :: Var_tmp
657
658 CALL grid2dTo1d_glo(VarIn,Var_tmp)
659 CALL scatter_mpi(Var_tmp,VarOut)
660
661 END SUBROUTINE scatter2D_mpi_l1
662
663
664 SUBROUTINE scatter2D_mpi_l2(VarIn, VarOut)
665 USE mod_grid_phy_lmdz
666 IMPLICIT NONE
667
668 LOGICAL,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
669 LOGICAL,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
670
671 LOGICAL, DIMENSION(klon_glo,size(VarOut,2),size(VarOut,3)) :: Var_tmp
672
673 CALL grid2dTo1d_glo(VarIn,Var_tmp)
674 CALL scatter_mpi(Var_tmp,VarOut)
675
676 END SUBROUTINE scatter2D_mpi_l2
677
678 SUBROUTINE scatter2D_mpi_l3(VarIn, VarOut)
679 USE mod_grid_phy_lmdz
680 IMPLICIT NONE
681
682 LOGICAL,INTENT(IN),DIMENSION(:,:,:,:,:) :: VarIn
683 LOGICAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
684
685 LOGICAL,DIMENSION(klon_glo,size(VarOut,2),size(VarOut,3),size(VarOut,4)) :: Var_tmp
686
687 CALL grid2dTo1d_glo(VarIn,Var_tmp)
688 CALL scatter_mpi(Var_tmp,VarOut)
689
690 END SUBROUTINE scatter2D_mpi_l3
691
692
693 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
694 !! Definition des Gather2D --> 4D !!
695 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
696
697 SUBROUTINE gather2D_mpi_i(VarIn, VarOut)
698 USE mod_grid_phy_lmdz
699 IMPLICIT NONE
700
701 INTEGER,INTENT(IN),DIMENSION(:) :: VarIn
702 INTEGER,INTENT(OUT),DIMENSION(:,:) :: VarOut
703
704 INTEGER,DIMENSION(klon_glo) :: Var_tmp
705
706 CALL gather_mpi(VarIn,Var_tmp)
707 CALL grid1dTo2d_glo(Var_tmp,VarOut)
708
709 END SUBROUTINE gather2D_mpi_i
710
711 SUBROUTINE gather2D_mpi_i1(VarIn, VarOut)
712 USE mod_grid_phy_lmdz
713 IMPLICIT NONE
714
715 INTEGER,INTENT(IN),DIMENSION(:,:) :: VarIn
716 INTEGER,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
717
718 INTEGER,DIMENSION(klon_glo,size(VarOut,3)) :: Var_tmp
719
720 CALL gather_mpi(VarIn,Var_tmp)
721 CALL grid1dTo2d_glo(Var_tmp,VarOut)
722
723 END SUBROUTINE gather2D_mpi_i1
724
725 SUBROUTINE gather2D_mpi_i2(VarIn, VarOut)
726 USE mod_grid_phy_lmdz
727 IMPLICIT NONE
728
729 INTEGER,INTENT(IN),DIMENSION(:,:,:) :: VarIn
730 INTEGER,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
731
732 INTEGER,DIMENSION(klon_glo,size(VarOut,3),SIZE(VarOut,4)) :: Var_tmp
733
734 CALL gather_mpi(VarIn,Var_tmp)
735 CALL grid1dTo2d_glo(Var_tmp,VarOut)
736
737 END SUBROUTINE gather2D_mpi_i2
738
739 SUBROUTINE gather2D_mpi_i3(VarIn, VarOut)
740 USE mod_grid_phy_lmdz
741 IMPLICIT NONE
742
743 INTEGER,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
744 INTEGER,INTENT(OUT),DIMENSION(:,:,:,:,:) :: VarOut
745
746 INTEGER,DIMENSION(klon_glo,size(VarOut,3),SIZE(VarOut,4),SIZE(VarOut,5)) :: Var_tmp
747
748 CALL gather_mpi(VarIn,Var_tmp)
749 CALL grid1dTo2d_glo(Var_tmp,VarOut)
750
751 END SUBROUTINE gather2D_mpi_i3
752
753
754
755 SUBROUTINE gather2D_mpi_r(VarIn, VarOut)
756 USE mod_grid_phy_lmdz
757 IMPLICIT NONE
758
759 REAL,INTENT(IN),DIMENSION(:) :: VarIn
760 REAL,INTENT(OUT),DIMENSION(:,:) :: VarOut
761
762 REAL,DIMENSION(klon_glo) :: Var_tmp
763
764 CALL gather_mpi(VarIn,Var_tmp)
765 CALL grid1dTo2d_glo(Var_tmp,VarOut)
766
767 END SUBROUTINE gather2D_mpi_r
768
769 SUBROUTINE gather2D_mpi_r1(VarIn, VarOut)
770 USE mod_grid_phy_lmdz
771 IMPLICIT NONE
772
773 REAL,INTENT(IN),DIMENSION(:,:) :: VarIn
774 REAL,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
775
776 REAL,DIMENSION(klon_glo,size(VarOut,3)) :: Var_tmp
777
778 CALL gather_mpi(VarIn,Var_tmp)
779 CALL grid1dTo2d_glo(Var_tmp,VarOut)
780
781 END SUBROUTINE gather2D_mpi_r1
782
783 SUBROUTINE gather2D_mpi_r2(VarIn, VarOut)
784 USE mod_grid_phy_lmdz
785 IMPLICIT NONE
786
787 REAL,INTENT(IN),DIMENSION(:,:,:) :: VarIn
788 REAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
789
790 REAL,DIMENSION(klon_glo,size(VarOut,3),SIZE(VarOut,4)) :: Var_tmp
791
792 CALL gather_mpi(VarIn,Var_tmp)
793 CALL grid1dTo2d_glo(Var_tmp,VarOut)
794
795 END SUBROUTINE gather2D_mpi_r2
796
797 SUBROUTINE gather2D_mpi_r3(VarIn, VarOut)
798 USE mod_grid_phy_lmdz
799 IMPLICIT NONE
800
801 REAL,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
802 REAL,INTENT(OUT),DIMENSION(:,:,:,:,:) :: VarOut
803
804 REAL,DIMENSION(klon_glo,size(VarOut,3),SIZE(VarOut,4),SIZE(VarOut,5)) :: Var_tmp
805
806 CALL gather_mpi(VarIn,Var_tmp)
807 CALL grid1dTo2d_glo(Var_tmp,VarOut)
808
809 END SUBROUTINE gather2D_mpi_r3
810
811
812
813 SUBROUTINE gather2D_mpi_l(VarIn, VarOut)
814 USE mod_grid_phy_lmdz
815 IMPLICIT NONE
816
817 LOGICAL,INTENT(IN),DIMENSION(:) :: VarIn
818 LOGICAL,INTENT(OUT),DIMENSION(:,:) :: VarOut
819
820 LOGICAL,DIMENSION(klon_glo) :: Var_tmp
821
822 CALL gather_mpi(VarIn,Var_tmp)
823 CALL grid1dTo2d_glo(Var_tmp,VarOut)
824
825 END SUBROUTINE gather2D_mpi_l
826
827 SUBROUTINE gather2D_mpi_l1(VarIn, VarOut)
828 USE mod_grid_phy_lmdz
829 IMPLICIT NONE
830
831 LOGICAL,INTENT(IN),DIMENSION(:,:) :: VarIn
832 LOGICAL,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
833
834 LOGICAL,DIMENSION(klon_glo,size(VarOut,3)) :: Var_tmp
835
836 CALL gather_mpi(VarIn,Var_tmp)
837 CALL grid1dTo2d_glo(Var_tmp,VarOut)
838
839 END SUBROUTINE gather2D_mpi_l1
840
841 SUBROUTINE gather2D_mpi_l2(VarIn, VarOut)
842 USE mod_grid_phy_lmdz
843 IMPLICIT NONE
844
845 LOGICAL,INTENT(IN),DIMENSION(:,:,:) :: VarIn
846 LOGICAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
847
848 LOGICAL,DIMENSION(klon_glo,size(VarOut,3),SIZE(VarOut,4)) :: Var_tmp
849
850 CALL gather_mpi(VarIn,Var_tmp)
851 CALL grid1dTo2d_glo(Var_tmp,VarOut)
852
853 END SUBROUTINE gather2D_mpi_l2
854
855 SUBROUTINE gather2D_mpi_l3(VarIn, VarOut)
856 USE mod_grid_phy_lmdz
857 IMPLICIT NONE
858
859 LOGICAL,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
860 LOGICAL,INTENT(OUT),DIMENSION(:,:,:,:,:) :: VarOut
861
862 LOGICAL,DIMENSION(klon_glo,size(VarOut,3),SIZE(VarOut,4),SIZE(VarOut,5)) :: Var_tmp
863
864 CALL gather_mpi(VarIn,Var_tmp)
865 CALL grid1dTo2d_glo(Var_tmp,VarOut)
866
867 END SUBROUTINE gather2D_mpi_l3
868
869
870 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
871 !! Definition des reduce_sum --> 4D !!
872 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
873
874 2 SUBROUTINE reduce_sum_mpi_i(VarIn, VarOut)
875 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
876 IMPLICIT NONE
877
878 INTEGER,INTENT(IN) :: VarIn
879 INTEGER,INTENT(OUT) :: VarOut
880 INTEGER :: VarIn_tmp(1)
881 INTEGER :: VarOut_tmp(1)
882
883 2 VarIn_tmp(1)=VarIn
884 CALL reduce_sum_mpi_igen(VarIn_tmp,Varout_tmp,1)
885 2 VarOut=VarOut_tmp(1)
886
887 2 END SUBROUTINE reduce_sum_mpi_i
888
889 SUBROUTINE reduce_sum_mpi_i1(VarIn, VarOut)
890 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
891 IMPLICIT NONE
892
893 INTEGER,INTENT(IN),DIMENSION(:) :: VarIn
894 INTEGER,INTENT(OUT),DIMENSION(:) :: VarOut
895
896 CALL reduce_sum_mpi_igen(VarIn,Varout,SIZE(VarIn))
897
898 END SUBROUTINE reduce_sum_mpi_i1
899
900 SUBROUTINE reduce_sum_mpi_i2(VarIn, VarOut)
901 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
902 IMPLICIT NONE
903
904 INTEGER,INTENT(IN),DIMENSION(:,:) :: VarIn
905 INTEGER,INTENT(OUT),DIMENSION(:,:) :: VarOut
906
907 CALL reduce_sum_mpi_igen(VarIn,Varout,SIZE(VarIn))
908
909 END SUBROUTINE reduce_sum_mpi_i2
910
911 SUBROUTINE reduce_sum_mpi_i3(VarIn, VarOut)
912 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
913 IMPLICIT NONE
914
915 INTEGER,INTENT(IN),DIMENSION(:,:,:) :: VarIn
916 INTEGER,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
917
918 CALL reduce_sum_mpi_igen(VarIn,Varout,SIZE(VarIn))
919
920 END SUBROUTINE reduce_sum_mpi_i3
921
922 SUBROUTINE reduce_sum_mpi_i4(VarIn, VarOut)
923 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
924 IMPLICIT NONE
925
926 INTEGER,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
927 INTEGER,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
928
929 CALL reduce_sum_mpi_igen(VarIn,Varout,SIZE(VarIn))
930
931 END SUBROUTINE reduce_sum_mpi_i4
932
933
934 SUBROUTINE reduce_sum_mpi_r(VarIn, VarOut)
935 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
936 IMPLICIT NONE
937
938 REAL,INTENT(IN) :: VarIn
939 REAL,INTENT(OUT) :: VarOut
940 REAL :: VarIn_tmp(1)
941 REAL :: VarOut_tmp(1)
942
943 VarIn_tmp(1)=VarIn
944 CALL reduce_sum_mpi_rgen(VarIn_tmp,Varout_tmp,1)
945 VarOut=VarOut_tmp(1)
946
947 END SUBROUTINE reduce_sum_mpi_r
948
949 SUBROUTINE reduce_sum_mpi_r1(VarIn, VarOut)
950 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
951 IMPLICIT NONE
952
953 REAL,INTENT(IN),DIMENSION(:) :: VarIn
954 REAL,INTENT(OUT),DIMENSION(:) :: VarOut
955
956 CALL reduce_sum_mpi_rgen(VarIn,Varout,SIZE(VarIn))
957
958 END SUBROUTINE reduce_sum_mpi_r1
959
960 SUBROUTINE reduce_sum_mpi_r2(VarIn, VarOut)
961 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
962 IMPLICIT NONE
963
964 REAL,INTENT(IN),DIMENSION(:,:) :: VarIn
965 REAL,INTENT(OUT),DIMENSION(:,:) :: VarOut
966
967 CALL reduce_sum_mpi_rgen(VarIn,Varout,SIZE(VarIn))
968
969 END SUBROUTINE reduce_sum_mpi_r2
970
971 SUBROUTINE reduce_sum_mpi_r3(VarIn, VarOut)
972 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
973 IMPLICIT NONE
974
975 REAL,INTENT(IN),DIMENSION(:,:,:) :: VarIn
976 REAL,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
977
978 CALL reduce_sum_mpi_rgen(VarIn,Varout,SIZE(VarIn))
979
980 END SUBROUTINE reduce_sum_mpi_r3
981
982 SUBROUTINE reduce_sum_mpi_r4(VarIn, VarOut)
983 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
984 IMPLICIT NONE
985
986 REAL,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
987 REAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
988
989 CALL reduce_sum_mpi_rgen(VarIn,Varout,SIZE(VarIn))
990
991 END SUBROUTINE reduce_sum_mpi_r4
992
993
994 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
995 !! Definition des reduce_min --> 4D !!
996 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
997
998 SUBROUTINE reduce_min_mpi_i(VarIn, VarOut)
999 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
1000 IMPLICIT NONE
1001
1002 INTEGER,INTENT(IN) :: VarIn
1003 INTEGER,INTENT(OUT) :: VarOut
1004 INTEGER :: VarIn_tmp(1)
1005 INTEGER :: VarOut_tmp(1)
1006
1007 VarIn_tmp(1)=VarIn
1008 CALL reduce_min_mpi_igen(VarIn_tmp,Varout_tmp,1)
1009 VarOut=VarOut_tmp(1)
1010
1011 END SUBROUTINE reduce_min_mpi_i
1012
1013 SUBROUTINE reduce_min_mpi_i1(VarIn, VarOut)
1014 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
1015 IMPLICIT NONE
1016
1017 INTEGER,INTENT(IN),DIMENSION(:) :: VarIn
1018 INTEGER,INTENT(OUT),DIMENSION(:) :: VarOut
1019
1020 CALL reduce_min_mpi_igen(VarIn,Varout,SIZE(VarIn))
1021
1022 END SUBROUTINE reduce_min_mpi_i1
1023
1024 SUBROUTINE reduce_min_mpi_i2(VarIn, VarOut)
1025 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
1026 IMPLICIT NONE
1027
1028 INTEGER,INTENT(IN),DIMENSION(:,:) :: VarIn
1029 INTEGER,INTENT(OUT),DIMENSION(:,:) :: VarOut
1030
1031 CALL reduce_min_mpi_igen(VarIn,Varout,SIZE(VarIn))
1032
1033 END SUBROUTINE reduce_min_mpi_i2
1034
1035 SUBROUTINE reduce_min_mpi_i3(VarIn, VarOut)
1036 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
1037 IMPLICIT NONE
1038
1039 INTEGER,INTENT(IN),DIMENSION(:,:,:) :: VarIn
1040 INTEGER,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
1041
1042 CALL reduce_min_mpi_igen(VarIn,Varout,SIZE(VarIn))
1043
1044 END SUBROUTINE reduce_min_mpi_i3
1045
1046 SUBROUTINE reduce_min_mpi_i4(VarIn, VarOut)
1047 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
1048 IMPLICIT NONE
1049
1050 INTEGER,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
1051 INTEGER,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
1052
1053 CALL reduce_min_mpi_igen(VarIn,Varout,SIZE(VarIn))
1054
1055 END SUBROUTINE reduce_min_mpi_i4
1056
1057
1058 1 SUBROUTINE reduce_min_mpi_r(VarIn, VarOut)
1059 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
1060 IMPLICIT NONE
1061
1062 REAL,INTENT(IN) :: VarIn
1063 REAL,INTENT(OUT) :: VarOut
1064 REAL :: VarIn_tmp(1)
1065 REAL :: VarOut_tmp(1)
1066
1067 1 VarIn_tmp(1)=VarIn
1068 CALL reduce_min_mpi_rgen(VarIn_tmp,Varout_tmp,1)
1069 1 VarOut=VarOut_tmp(1)
1070
1071 1 END SUBROUTINE reduce_min_mpi_r
1072
1073 SUBROUTINE reduce_min_mpi_r1(VarIn, VarOut)
1074 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
1075 IMPLICIT NONE
1076
1077 REAL,INTENT(IN),DIMENSION(:) :: VarIn
1078 REAL,INTENT(OUT),DIMENSION(:) :: VarOut
1079
1080 CALL reduce_min_mpi_rgen(VarIn,Varout,SIZE(VarIn))
1081
1082 END SUBROUTINE reduce_min_mpi_r1
1083
1084 SUBROUTINE reduce_min_mpi_r2(VarIn, VarOut)
1085 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
1086 IMPLICIT NONE
1087
1088 REAL,INTENT(IN),DIMENSION(:,:) :: VarIn
1089 REAL,INTENT(OUT),DIMENSION(:,:) :: VarOut
1090
1091 CALL reduce_min_mpi_rgen(VarIn,Varout,SIZE(VarIn))
1092
1093 END SUBROUTINE reduce_min_mpi_r2
1094
1095 SUBROUTINE reduce_min_mpi_r3(VarIn, VarOut)
1096 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
1097 IMPLICIT NONE
1098
1099 REAL,INTENT(IN),DIMENSION(:,:,:) :: VarIn
1100 REAL,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
1101
1102 CALL reduce_min_mpi_rgen(VarIn,Varout,SIZE(VarIn))
1103
1104 END SUBROUTINE reduce_min_mpi_r3
1105
1106 SUBROUTINE reduce_min_mpi_r4(VarIn, VarOut)
1107 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
1108 IMPLICIT NONE
1109
1110 REAL,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
1111 REAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
1112
1113 CALL reduce_min_mpi_rgen(VarIn,Varout,SIZE(VarIn))
1114
1115 END SUBROUTINE reduce_min_mpi_r4
1116
1117
1118
1119
1120 !!!!!!!!!!!!!!!!!!!!!!!!!!!!
1121 !! SUBROUTINE grid1dTo2d !!
1122 !!!!!!!!!!!!!!!!!!!!!!!!!!!!
1123
1124
1125 SUBROUTINE grid1dTo2d_mpi_i(VarIn,VarOut)
1126 IMPLICIT NONE
1127 INTEGER,INTENT(IN),DIMENSION(:) :: VarIn
1128 INTEGER,INTENT(OUT),DIMENSION(:,:) :: VarOut
1129
1130 CALL grid1dTo2d_mpi_igen(VarIn,VarOut,1)
1131
1132 END SUBROUTINE grid1dTo2d_mpi_i
1133
1134
1135 SUBROUTINE grid1dTo2d_mpi_i1(VarIn,VarOut)
1136 IMPLICIT NONE
1137 INTEGER,INTENT(IN),DIMENSION(:,:) :: VarIn
1138 INTEGER,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
1139
1140 CALL grid1dTo2d_mpi_igen(VarIn,VarOut,size(VarIn,2))
1141
1142 END SUBROUTINE grid1dTo2d_mpi_i1
1143
1144 SUBROUTINE grid1dTo2d_mpi_i2(VarIn,VarOut)
1145 IMPLICIT NONE
1146 INTEGER,INTENT(IN),DIMENSION(:,:,:) :: VarIn
1147 INTEGER,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
1148
1149 CALL grid1dTo2d_mpi_igen(VarIn,VarOut,size(VarIn,2)*size(VarIn,3))
1150
1151 END SUBROUTINE grid1dTo2d_mpi_i2
1152
1153 SUBROUTINE grid1dTo2d_mpi_i3(VarIn,VarOut)
1154 IMPLICIT NONE
1155 INTEGER,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
1156 INTEGER,INTENT(OUT),DIMENSION(:,:,:,:,:) :: VarOut
1157
1158 CALL grid1dTo2d_mpi_igen(VarIn,VarOut,size(VarIn,2)*size(VarIn,3)*size(VarIn,4))
1159
1160 END SUBROUTINE grid1dTo2d_mpi_i3
1161
1162
1163
2/4
✗ Branch 0 not taken.
✓ Branch 1 taken 363840 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 363840 times.
363840 SUBROUTINE grid1dTo2d_mpi_r(VarIn,VarOut)
1164 IMPLICIT NONE
1165 REAL,INTENT(IN),DIMENSION(:) :: VarIn
1166 REAL,INTENT(OUT),DIMENSION(:,:) :: VarOut
1167
1168
2/4
✗ Branch 3 not taken.
✓ Branch 4 taken 363840 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 363840 times.
363840 CALL grid1dTo2d_mpi_rgen(VarIn,VarOut,1)
1169
1170 363840 END SUBROUTINE grid1dTo2d_mpi_r
1171
1172
1173
2/4
✗ Branch 0 not taken.
✓ Branch 1 taken 121920 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 121920 times.
121920 SUBROUTINE grid1dTo2d_mpi_r1(VarIn,VarOut)
1174 IMPLICIT NONE
1175 REAL,INTENT(IN),DIMENSION(:,:) :: VarIn
1176 REAL,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
1177
1178
2/4
✗ Branch 3 not taken.
✓ Branch 4 taken 121920 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 121920 times.
121920 CALL grid1dTo2d_mpi_rgen(VarIn,VarOut,size(VarIn,2))
1179
1180 121920 END SUBROUTINE grid1dTo2d_mpi_r1
1181
1182 SUBROUTINE grid1dTo2d_mpi_r2(VarIn,VarOut)
1183 IMPLICIT NONE
1184 REAL,INTENT(IN),DIMENSION(:,:,:) :: VarIn
1185 REAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
1186
1187 CALL grid1dTo2d_mpi_rgen(VarIn,VarOut,size(VarIn,2)*size(VarIn,3))
1188
1189 END SUBROUTINE grid1dTo2d_mpi_r2
1190
1191 SUBROUTINE grid1dTo2d_mpi_r3(VarIn,VarOut)
1192 IMPLICIT NONE
1193 REAL,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
1194 REAL,INTENT(OUT),DIMENSION(:,:,:,:,:) :: VarOut
1195
1196 CALL grid1dTo2d_mpi_rgen(VarIn,VarOut,size(VarIn,2)*size(VarIn,3)*size(VarIn,4))
1197
1198 END SUBROUTINE grid1dTo2d_mpi_r3
1199
1200
1201
1202 SUBROUTINE grid1dTo2d_mpi_l(VarIn,VarOut)
1203 IMPLICIT NONE
1204 LOGICAL,INTENT(IN),DIMENSION(:) :: VarIn
1205 LOGICAL,INTENT(OUT),DIMENSION(:,:) :: VarOut
1206
1207 CALL grid1dTo2d_mpi_lgen(VarIn,VarOut,1)
1208
1209 END SUBROUTINE grid1dTo2d_mpi_l
1210
1211
1212 SUBROUTINE grid1dTo2d_mpi_l1(VarIn,VarOut)
1213 IMPLICIT NONE
1214 LOGICAL,INTENT(IN),DIMENSION(:,:) :: VarIn
1215 LOGICAL,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
1216
1217 CALL grid1dTo2d_mpi_lgen(VarIn,VarOut,size(VarIn,2))
1218
1219 END SUBROUTINE grid1dTo2d_mpi_l1
1220
1221 SUBROUTINE grid1dTo2d_mpi_l2(VarIn,VarOut)
1222 IMPLICIT NONE
1223 LOGICAL,INTENT(IN),DIMENSION(:,:,:) :: VarIn
1224 LOGICAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
1225
1226 CALL grid1dTo2d_mpi_lgen(VarIn,VarOut,size(VarIn,2)*size(VarIn,3))
1227
1228 END SUBROUTINE grid1dTo2d_mpi_l2
1229
1230 SUBROUTINE grid1dTo2d_mpi_l3(VarIn,VarOut)
1231 IMPLICIT NONE
1232 LOGICAL,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
1233 LOGICAL,INTENT(OUT),DIMENSION(:,:,:,:,:) :: VarOut
1234
1235 CALL grid1dTo2d_mpi_lgen(VarIn,VarOut,size(VarIn,2)*size(VarIn,3)*size(VarIn,4))
1236
1237 END SUBROUTINE grid1dTo2d_mpi_l3
1238
1239
1240 SUBROUTINE grid2dTo1d_mpi_i(VarIn,VarOut)
1241 IMPLICIT NONE
1242 INTEGER,INTENT(IN),DIMENSION(:,:) :: VarIn
1243 INTEGER,INTENT(OUT),DIMENSION(:) :: VarOut
1244
1245 CALL grid2dTo1d_mpi_igen(VarIn,VarOut,1)
1246
1247 END SUBROUTINE grid2dTo1d_mpi_i
1248
1249
1250 SUBROUTINE grid2dTo1d_mpi_i1(VarIn,VarOut)
1251 IMPLICIT NONE
1252 INTEGER,INTENT(IN),DIMENSION(:,:,:) :: VarIn
1253 INTEGER,INTENT(OUT),DIMENSION(:,:) :: VarOut
1254
1255 CALL grid2dTo1d_mpi_igen(VarIn,VarOut,size(VarIn,3))
1256
1257 END SUBROUTINE grid2dTo1d_mpi_i1
1258
1259 SUBROUTINE grid2dTo1d_mpi_i2(VarIn,VarOut)
1260 IMPLICIT NONE
1261 INTEGER,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
1262 INTEGER,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
1263
1264 CALL grid2dTo1d_mpi_igen(VarIn,VarOut,size(VarIn,3)*size(VarIn,4))
1265
1266 END SUBROUTINE grid2dTo1d_mpi_i2
1267
1268 SUBROUTINE grid2dTo1d_mpi_i3(VarIn,VarOut)
1269 IMPLICIT NONE
1270 INTEGER,INTENT(IN),DIMENSION(:,:,:,:,:) :: VarIn
1271 INTEGER,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
1272
1273 CALL grid2dTo1d_mpi_igen(VarIn,VarOut,size(VarIn,3)*size(VarIn,4)*size(VarIn,5))
1274
1275 END SUBROUTINE grid2dTo1d_mpi_i3
1276
1277
1278
1279
1280 SUBROUTINE grid2dTo1d_mpi_r(VarIn,VarOut)
1281 IMPLICIT NONE
1282 REAL,INTENT(IN),DIMENSION(:,:) :: VarIn
1283 REAL,INTENT(OUT),DIMENSION(:) :: VarOut
1284
1285 CALL grid2dTo1d_mpi_rgen(VarIn,VarOut,1)
1286
1287 END SUBROUTINE grid2dTo1d_mpi_r
1288
1289
1290 SUBROUTINE grid2dTo1d_mpi_r1(VarIn,VarOut)
1291 IMPLICIT NONE
1292 REAL,INTENT(IN),DIMENSION(:,:,:) :: VarIn
1293 REAL,INTENT(OUT),DIMENSION(:,:) :: VarOut
1294
1295 CALL grid2dTo1d_mpi_rgen(VarIn,VarOut,size(VarIn,3))
1296
1297 END SUBROUTINE grid2dTo1d_mpi_r1
1298
1299 SUBROUTINE grid2dTo1d_mpi_r2(VarIn,VarOut)
1300 IMPLICIT NONE
1301 REAL,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
1302 REAL,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
1303
1304 CALL grid2dTo1d_mpi_rgen(VarIn,VarOut,size(VarIn,3)*size(VarIn,4))
1305
1306 END SUBROUTINE grid2dTo1d_mpi_r2
1307
1308 SUBROUTINE grid2dTo1d_mpi_r3(VarIn,VarOut)
1309 IMPLICIT NONE
1310 REAL,INTENT(IN),DIMENSION(:,:,:,:,:) :: VarIn
1311 REAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
1312
1313 CALL grid2dTo1d_mpi_rgen(VarIn,VarOut,size(VarIn,3)*size(VarIn,4)*size(VarIn,5))
1314
1315 END SUBROUTINE grid2dTo1d_mpi_r3
1316
1317
1318
1319 SUBROUTINE grid2dTo1d_mpi_l(VarIn,VarOut)
1320 IMPLICIT NONE
1321 LOGICAL,INTENT(IN),DIMENSION(:,:) :: VarIn
1322 LOGICAL,INTENT(OUT),DIMENSION(:) :: VarOut
1323
1324 CALL grid2dTo1d_mpi_lgen(VarIn,VarOut,1)
1325
1326 END SUBROUTINE grid2dTo1d_mpi_l
1327
1328
1329 SUBROUTINE grid2dTo1d_mpi_l1(VarIn,VarOut)
1330 IMPLICIT NONE
1331 LOGICAL,INTENT(IN),DIMENSION(:,:,:) :: VarIn
1332 LOGICAL,INTENT(OUT),DIMENSION(:,:) :: VarOut
1333
1334 CALL grid2dTo1d_mpi_lgen(VarIn,VarOut,size(VarIn,3))
1335
1336 END SUBROUTINE grid2dTo1d_mpi_l1
1337
1338
1339
1340 SUBROUTINE grid2dTo1d_mpi_l2(VarIn,VarOut)
1341 IMPLICIT NONE
1342 LOGICAL,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
1343 LOGICAL,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
1344
1345 CALL grid2dTo1d_mpi_lgen(VarIn,VarOut,size(VarIn,3)*size(VarIn,4))
1346
1347 END SUBROUTINE grid2dTo1d_mpi_l2
1348
1349
1350 SUBROUTINE grid2dTo1d_mpi_l3(VarIn,VarOut)
1351 IMPLICIT NONE
1352 LOGICAL,INTENT(IN),DIMENSION(:,:,:,:,:) :: VarIn
1353 LOGICAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
1354
1355 CALL grid2dTo1d_mpi_lgen(VarIn,VarOut,size(VarIn,3)*size(VarIn,4)*size(VarIn,5))
1356
1357 END SUBROUTINE grid2dTo1d_mpi_l3
1358
1359
1360
1361
1362
1363 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1364 !! DEFINITION DES FONCTIONS DE TRANSFERT GENERIQUES !
1365 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1366
1367 SUBROUTINE bcast_mpi_cgen(var,nb)
1368 USE mod_phys_lmdz_mpi_data
1369 IMPLICIT NONE
1370
1371 CHARACTER(LEN=*),INTENT(INOUT) :: Var
1372 INTEGER,INTENT(IN) :: nb
1373
1374 INTEGER :: ierr
1375
1376 IF (.not.is_using_mpi) RETURN
1377
1378
1379 END SUBROUTINE bcast_mpi_cgen
1380
1381
1382
1383 SUBROUTINE bcast_mpi_igen(var,nb)
1384 USE mod_phys_lmdz_mpi_data
1385 IMPLICIT NONE
1386
1387 INTEGER,INTENT(IN) :: nb
1388 INTEGER,DIMENSION(nb),INTENT(INOUT) :: Var
1389
1390 INTEGER :: ierr
1391
1392 IF (.not.is_using_mpi) RETURN
1393
1394
1395 END SUBROUTINE bcast_mpi_igen
1396
1397
1398
1399
1400 SUBROUTINE bcast_mpi_rgen(var,nb)
1401 USE mod_phys_lmdz_mpi_data
1402 IMPLICIT NONE
1403
1404 INTEGER,INTENT(IN) :: nb
1405 REAL,DIMENSION(nb),INTENT(INOUT) :: Var
1406
1407 INTEGER :: ierr
1408
1409 IF (.not.is_using_mpi) RETURN
1410
1411
1412 END SUBROUTINE bcast_mpi_rgen
1413
1414
1415
1416
1417 SUBROUTINE bcast_mpi_lgen(var,nb)
1418 USE mod_phys_lmdz_mpi_data
1419 IMPLICIT NONE
1420
1421 INTEGER,INTENT(IN) :: nb
1422 LOGICAL,DIMENSION(nb),INTENT(INOUT) :: Var
1423
1424 INTEGER :: ierr
1425
1426 IF (.not.is_using_mpi) RETURN
1427
1428
1429 END SUBROUTINE bcast_mpi_lgen
1430
1431
1432
1433 SUBROUTINE scatter_mpi_igen(VarIn, VarOut, dimsize)
1434 USE mod_phys_lmdz_mpi_data
1435 USE mod_grid_phy_lmdz
1436 IMPLICIT NONE
1437
1438 INTEGER,INTENT(IN) :: dimsize
1439 INTEGER,INTENT(IN),DIMENSION(klon_glo,dimsize) :: VarIn
1440 INTEGER,INTENT(OUT),DIMENSION(klon_mpi,dimsize) :: VarOut
1441
1442 INTEGER,DIMENSION(0:mpi_size-1) :: displs
1443 INTEGER,DIMENSION(0:mpi_size-1) :: counts
1444 INTEGER,DIMENSION(dimsize*klon_glo) :: VarTmp
1445 INTEGER :: nb,i,index,rank
1446 INTEGER :: ierr
1447
1448
1449 IF (.not.is_using_mpi) THEN
1450 VarOut(:,:)=VarIn(:,:)
1451 RETURN
1452 ENDIF
1453
1454
1455 IF (is_mpi_root) THEN
1456 Index=1
1457 DO rank=0,mpi_size-1
1458 nb=klon_mpi_para_nb(rank)
1459 displs(rank)=Index-1
1460 counts(rank)=nb*dimsize
1461 DO i=1,dimsize
1462 VarTmp(Index:Index+nb-1)=VarIn(klon_mpi_para_begin(rank):klon_mpi_para_end(rank),i)
1463 Index=Index+nb
1464 ENDDO
1465 ENDDO
1466 ENDIF
1467
1468
1469 END SUBROUTINE scatter_mpi_igen
1470
1471 374 SUBROUTINE scatter_mpi_rgen(VarIn, VarOut, dimsize)
1472 USE mod_phys_lmdz_mpi_data
1473 USE mod_grid_phy_lmdz
1474 IMPLICIT NONE
1475
1476 INTEGER,INTENT(IN) :: dimsize
1477 REAL,INTENT(IN),DIMENSION(klon_glo,dimsize) :: VarIn
1478 REAL,INTENT(OUT),DIMENSION(klon_mpi,dimsize) :: VarOut
1479
1480
1481 INTEGER,DIMENSION(0:mpi_size-1) :: displs
1482 INTEGER,DIMENSION(0:mpi_size-1) :: counts
1483 REAL,DIMENSION(dimsize*klon_glo) :: VarTmp
1484 INTEGER :: nb,i,index,rank
1485 INTEGER :: ierr
1486
1487
1/2
✓ Branch 0 taken 374 times.
✗ Branch 1 not taken.
374 IF (.not.is_using_mpi) THEN
1488
4/4
✓ Branch 0 taken 1219 times.
✓ Branch 1 taken 374 times.
✓ Branch 2 taken 1211686 times.
✓ Branch 3 taken 1219 times.
1213279 VarOut(:,:)=VarIn(:,:)
1489 RETURN
1490 ENDIF
1491
1492 IF (is_mpi_root) THEN
1493 Index=1
1494 DO rank=0,mpi_size-1
1495 nb=klon_mpi_para_nb(rank)
1496 displs(rank)=Index-1
1497 counts(rank)=nb*dimsize
1498 DO i=1,dimsize
1499 VarTmp(Index:Index+nb-1)=VarIn(klon_mpi_para_begin(rank):klon_mpi_para_end(rank),i)
1500 Index=Index+nb
1501 ENDDO
1502 ENDDO
1503 ENDIF
1504
1505
1506 END SUBROUTINE scatter_mpi_rgen
1507
1508
1509 SUBROUTINE scatter_mpi_lgen(VarIn, VarOut, dimsize)
1510 USE mod_phys_lmdz_mpi_data
1511 USE mod_grid_phy_lmdz
1512 IMPLICIT NONE
1513
1514 INTEGER,INTENT(IN) :: dimsize
1515 LOGICAL,INTENT(IN),DIMENSION(klon_glo,dimsize) :: VarIn
1516 LOGICAL,INTENT(OUT),DIMENSION(klon_mpi,dimsize) :: VarOut
1517
1518
1519 INTEGER,DIMENSION(0:mpi_size-1) :: displs
1520 INTEGER,DIMENSION(0:mpi_size-1) :: counts
1521 LOGICAL,DIMENSION(dimsize*klon_glo) :: VarTmp
1522 INTEGER :: nb,i,index,rank
1523 INTEGER :: ierr
1524
1525 IF (.not.is_using_mpi) THEN
1526 VarOut(:,:)=VarIn(:,:)
1527 RETURN
1528 ENDIF
1529
1530 IF (is_mpi_root) THEN
1531 Index=1
1532 DO rank=0,mpi_size-1
1533 nb=klon_mpi_para_nb(rank)
1534 displs(rank)=Index-1
1535 counts(rank)=nb*dimsize
1536 DO i=1,dimsize
1537 VarTmp(Index:Index+nb-1)=VarIn(klon_mpi_para_begin(rank):klon_mpi_para_end(rank),i)
1538 Index=Index+nb
1539 ENDDO
1540 ENDDO
1541 ENDIF
1542
1543
1544 END SUBROUTINE scatter_mpi_lgen
1545
1546
1547
1548
1549 563 SUBROUTINE gather_mpi_igen(VarIn, VarOut, dimsize)
1550 USE mod_phys_lmdz_mpi_data
1551 USE mod_grid_phy_lmdz
1552 IMPLICIT NONE
1553
1554
1555 INTEGER,INTENT(IN) :: dimsize
1556 INTEGER,INTENT(IN),DIMENSION(klon_mpi,dimsize) :: VarIn
1557 INTEGER,INTENT(OUT),DIMENSION(klon_glo,dimsize) :: VarOut
1558
1559 1126 INTEGER,DIMENSION(0:mpi_size-1) :: displs
1560 1126 INTEGER,DIMENSION(0:mpi_size-1) :: counts
1561 563 INTEGER,DIMENSION(dimsize*klon_glo) :: VarTmp
1562 INTEGER :: nb,i,index,rank
1563 INTEGER :: ierr
1564
1565
1/2
✓ Branch 0 taken 563 times.
✗ Branch 1 not taken.
563 IF (.not.is_using_mpi) THEN
1566
4/4
✓ Branch 0 taken 563 times.
✓ Branch 1 taken 563 times.
✓ Branch 2 taken 559622 times.
✓ Branch 3 taken 563 times.
560748 VarOut(:,:)=VarIn(:,:)
1567 RETURN
1568 ENDIF
1569
1570 IF (is_mpi_root) THEN
1571 Index=1
1572 DO rank=0,mpi_size-1
1573 nb=klon_mpi_para_nb(rank)
1574 displs(rank)=Index-1
1575 counts(rank)=nb*dimsize
1576 Index=Index+nb*dimsize
1577 ENDDO
1578
1579 ENDIF
1580
1581
1582
1583 IF (is_mpi_root) THEN
1584 Index=1
1585 DO rank=0,mpi_size-1
1586 nb=klon_mpi_para_nb(rank)
1587 DO i=1,dimsize
1588 VarOut(klon_mpi_para_begin(rank):klon_mpi_para_end(rank),i)=VarTmp(Index:Index+nb-1)
1589 Index=Index+nb
1590 ENDDO
1591 ENDDO
1592 ENDIF
1593
1594 END SUBROUTINE gather_mpi_igen
1595
1596 218 SUBROUTINE gather_mpi_rgen(VarIn, VarOut, dimsize)
1597 USE mod_phys_lmdz_mpi_data
1598 USE mod_grid_phy_lmdz
1599 IMPLICIT NONE
1600
1601
1602 INTEGER,INTENT(IN) :: dimsize
1603 REAL,INTENT(IN),DIMENSION(klon_mpi,dimsize) :: VarIn
1604 REAL,INTENT(OUT),DIMENSION(klon_glo,dimsize) :: VarOut
1605
1606 436 INTEGER,DIMENSION(0:mpi_size-1) :: displs
1607 436 INTEGER,DIMENSION(0:mpi_size-1) :: counts
1608 218 REAL,DIMENSION(dimsize*klon_glo) :: VarTmp
1609 INTEGER :: nb,i,index,rank
1610 INTEGER :: ierr
1611
1612
1/2
✓ Branch 0 taken 218 times.
✗ Branch 1 not taken.
218 IF (is_mpi_root) THEN
1613 Index=1
1614
2/2
✓ Branch 0 taken 218 times.
✓ Branch 1 taken 218 times.
436 DO rank=0,mpi_size-1
1615 218 nb=klon_mpi_para_nb(rank)
1616 218 displs(rank)=Index-1
1617 218 counts(rank)=nb*dimsize
1618 436 Index=Index+nb*dimsize
1619 ENDDO
1620 ENDIF
1621
1622
1/2
✓ Branch 0 taken 218 times.
✗ Branch 1 not taken.
218 IF (.not.is_using_mpi) THEN
1623
4/4
✓ Branch 0 taken 1445 times.
✓ Branch 1 taken 218 times.
✓ Branch 2 taken 1436330 times.
✓ Branch 3 taken 1445 times.
1437993 VarOut(:,:)=VarIn(:,:)
1624 RETURN
1625 ENDIF
1626
1627
1628 IF (is_mpi_root) THEN
1629 Index=1
1630 DO rank=0,mpi_size-1
1631 nb=klon_mpi_para_nb(rank)
1632 DO i=1,dimsize
1633 VarOut(klon_mpi_para_begin(rank):klon_mpi_para_end(rank),i)=VarTmp(Index:Index+nb-1)
1634 Index=Index+nb
1635 ENDDO
1636 ENDDO
1637 ENDIF
1638
1639 END SUBROUTINE gather_mpi_rgen
1640
1641 SUBROUTINE gather_mpi_lgen(VarIn, VarOut, dimsize)
1642 USE mod_phys_lmdz_mpi_data
1643 USE mod_grid_phy_lmdz
1644 IMPLICIT NONE
1645
1646 INTEGER,INTENT(IN) :: dimsize
1647 LOGICAL,INTENT(IN),DIMENSION(klon_mpi,dimsize) :: VarIn
1648 LOGICAL,INTENT(OUT),DIMENSION(klon_glo,dimsize) :: VarOut
1649
1650
1651 INTEGER,DIMENSION(0:mpi_size-1) :: displs
1652 INTEGER,DIMENSION(0:mpi_size-1) :: counts
1653 LOGICAL,DIMENSION(dimsize*klon_glo) :: VarTmp
1654 INTEGER :: nb,i,index,rank
1655 INTEGER :: ierr
1656
1657 IF (.not.is_using_mpi) THEN
1658 VarOut(:,:)=VarIn(:,:)
1659 RETURN
1660 ENDIF
1661
1662 IF (is_mpi_root) THEN
1663 Index=1
1664 DO rank=0,mpi_size-1
1665 nb=klon_mpi_para_nb(rank)
1666 displs(rank)=Index-1
1667 counts(rank)=nb*dimsize
1668 Index=Index+nb*dimsize
1669 ENDDO
1670 ENDIF
1671
1672
1673
1674 IF (is_mpi_root) THEN
1675 Index=1
1676 DO rank=0,mpi_size-1
1677 nb=klon_mpi_para_nb(rank)
1678 DO i=1,dimsize
1679 VarOut(klon_mpi_para_begin(rank):klon_mpi_para_end(rank),i)=VarTmp(Index:Index+nb-1)
1680 Index=Index+nb
1681 ENDDO
1682 ENDDO
1683 ENDIF
1684
1685 END SUBROUTINE gather_mpi_lgen
1686
1687
1688
1689 SUBROUTINE reduce_sum_mpi_igen(VarIn,VarOut,nb)
1690 USE mod_phys_lmdz_mpi_data
1691 USE mod_grid_phy_lmdz
1692 IMPLICIT NONE
1693
1694
1695 INTEGER,INTENT(IN) :: nb
1696 INTEGER,DIMENSION(nb),INTENT(IN) :: VarIn
1697 INTEGER,DIMENSION(nb),INTENT(OUT) :: VarOut
1698 INTEGER :: ierr
1699
1700
1/12
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
2 IF (.not.is_using_mpi) THEN
1701
2/12
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
4 VarOut(:)=VarIn(:)
1702 RETURN
1703 ENDIF
1704
1705
1706
1707 END SUBROUTINE reduce_sum_mpi_igen
1708
1709 SUBROUTINE reduce_sum_mpi_rgen(VarIn,VarOut,nb)
1710 USE mod_phys_lmdz_mpi_data
1711 USE mod_grid_phy_lmdz
1712
1713 IMPLICIT NONE
1714
1715
1716 INTEGER,INTENT(IN) :: nb
1717 REAL,DIMENSION(nb),INTENT(IN) :: VarIn
1718 REAL,DIMENSION(nb),INTENT(OUT) :: VarOut
1719 INTEGER :: ierr
1720
1721 IF (.not.is_using_mpi) THEN
1722 VarOut(:)=VarIn(:)
1723 RETURN
1724 ENDIF
1725
1726
1727 END SUBROUTINE reduce_sum_mpi_rgen
1728
1729
1730
1731 SUBROUTINE reduce_min_mpi_igen(VarIn,VarOut,nb)
1732 USE mod_phys_lmdz_mpi_data
1733 USE mod_grid_phy_lmdz
1734 IMPLICIT NONE
1735
1736
1737 INTEGER,INTENT(IN) :: nb
1738 INTEGER,DIMENSION(nb),INTENT(IN) :: VarIn
1739 INTEGER,DIMENSION(nb),INTENT(OUT) :: VarOut
1740 INTEGER :: ierr
1741
1742 IF (.not.is_using_mpi) THEN
1743 VarOut(:)=VarIn(:)
1744 RETURN
1745 ENDIF
1746
1747
1748
1749 END SUBROUTINE reduce_min_mpi_igen
1750
1751 SUBROUTINE reduce_min_mpi_rgen(VarIn,VarOut,nb)
1752 USE mod_phys_lmdz_mpi_data
1753 USE mod_grid_phy_lmdz
1754
1755 IMPLICIT NONE
1756
1757
1758 INTEGER,INTENT(IN) :: nb
1759 REAL,DIMENSION(nb),INTENT(IN) :: VarIn
1760 REAL,DIMENSION(nb),INTENT(OUT) :: VarOut
1761 INTEGER :: ierr
1762
1763
1/12
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
1 IF (.not.is_using_mpi) THEN
1764
2/12
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
2 VarOut(:)=VarIn(:)
1765 RETURN
1766 ENDIF
1767
1768
1769 END SUBROUTINE reduce_min_mpi_rgen
1770
1771
1772
1773
1774
1775
1776
1777 SUBROUTINE grid1dTo2d_mpi_igen(VarIn,VarOut,dimsize)
1778 USE mod_phys_lmdz_mpi_data
1779 USE mod_grid_phy_lmdz
1780 IMPLICIT NONE
1781
1782 INTEGER,INTENT(IN) :: dimsize
1783 INTEGER,INTENT(IN) ,DIMENSION(klon_mpi,dimsize) :: VarIn
1784 INTEGER,INTENT(OUT),DIMENSION(nbp_lon*jj_nb,dimsize) :: VarOut
1785 INTEGER :: i,ij,Offset
1786
1787
1788 VarOut(1:nbp_lon,:)=0
1789 VarOut(nbp_lon*(jj_nb-1)+1:nbp_lon*jj_nb,:)=0
1790
1791 offset=ii_begin
1792 IF (is_north_pole_dyn) Offset=nbp_lon
1793
1794
1795 DO i=1,dimsize
1796 DO ij=1,klon_mpi
1797 VarOut(ij+offset-1,i)=VarIn(ij,i)
1798 ENDDO
1799 ENDDO
1800
1801
1802 IF (is_north_pole_dyn) THEN
1803 DO i=1,dimsize
1804 DO ij=1,nbp_lon
1805 VarOut(ij,i)=VarIn(1,i)
1806 ENDDO
1807 ENDDO
1808 ENDIF
1809
1810 IF (is_south_pole_dyn) THEN
1811 DO i=1,dimsize
1812 DO ij=nbp_lon*(jj_nb-1)+1,nbp_lon*jj_nb
1813 VarOut(ij,i)=VarIn(klon_mpi,i)
1814 ENDDO
1815 ENDDO
1816 ENDIF
1817
1818 END SUBROUTINE grid1dTo2d_mpi_igen
1819
1820
1821 485760 SUBROUTINE grid1dTo2d_mpi_rgen(VarIn,VarOut,dimsize)
1822 USE mod_phys_lmdz_mpi_data
1823 USE mod_grid_phy_lmdz
1824 IMPLICIT NONE
1825
1826 INTEGER,INTENT(IN) :: dimsize
1827 REAL,INTENT(IN) ,DIMENSION(klon_mpi,dimsize) :: VarIn
1828 REAL,INTENT(OUT),DIMENSION(nbp_lon*jj_nb,dimsize) :: VarOut
1829 INTEGER :: i,ij,Offset
1830
1831
1832
4/4
✓ Branch 0 taken 4524960 times.
✓ Branch 1 taken 485760 times.
✓ Branch 2 taken 144798720 times.
✓ Branch 3 taken 4524960 times.
149809440 VarOut(1:nbp_lon,:)=0
1833
4/4
✓ Branch 0 taken 4524960 times.
✓ Branch 1 taken 485760 times.
✓ Branch 2 taken 144798720 times.
✓ Branch 3 taken 4524960 times.
149809440 VarOut(nbp_lon*(jj_nb-1)+1:nbp_lon*jj_nb,:)=0
1834
1835 485760 offset=ii_begin
1836
1/2
✓ Branch 0 taken 485760 times.
✗ Branch 1 not taken.
485760 IF (is_north_pole_dyn) Offset=nbp_lon
1837
1838
1839
2/2
✓ Branch 0 taken 4524960 times.
✓ Branch 1 taken 485760 times.
5010720 DO i=1,dimsize
1840
2/2
✓ Branch 0 taken 4497810240 times.
✓ Branch 1 taken 4524960 times.
4502820960 DO ij=1,klon_mpi
1841 4502335200 VarOut(ij+offset-1,i)=VarIn(ij,i)
1842 ENDDO
1843 ENDDO
1844
1845
1846
1/2
✓ Branch 0 taken 485760 times.
✗ Branch 1 not taken.
485760 IF (is_north_pole_dyn) THEN
1847
2/2
✓ Branch 0 taken 4524960 times.
✓ Branch 1 taken 485760 times.
5010720 DO i=1,dimsize
1848
2/2
✓ Branch 0 taken 144798720 times.
✓ Branch 1 taken 4524960 times.
149809440 DO ij=1,nbp_lon
1849 149323680 VarOut(ij,i)=VarIn(1,i)
1850 ENDDO
1851 ENDDO
1852 ENDIF
1853
1854
1/2
✓ Branch 0 taken 485760 times.
✗ Branch 1 not taken.
485760 IF (is_south_pole_dyn) THEN
1855
2/2
✓ Branch 0 taken 4524960 times.
✓ Branch 1 taken 485760 times.
5010720 DO i=1,dimsize
1856
2/2
✓ Branch 0 taken 144798720 times.
✓ Branch 1 taken 4524960 times.
149809440 DO ij=nbp_lon*(jj_nb-1)+1,nbp_lon*jj_nb
1857 149323680 VarOut(ij,i)=VarIn(klon_mpi,i)
1858 ENDDO
1859 ENDDO
1860 ENDIF
1861
1862 485760 END SUBROUTINE grid1dTo2d_mpi_rgen
1863
1864
1865
1866 SUBROUTINE grid1dTo2d_mpi_lgen(VarIn,VarOut,dimsize)
1867 USE mod_phys_lmdz_mpi_data
1868 USE mod_grid_phy_lmdz
1869 IMPLICIT NONE
1870
1871 INTEGER,INTENT(IN) :: dimsize
1872 LOGICAL,INTENT(IN) ,DIMENSION(klon_mpi,dimsize) :: VarIn
1873 LOGICAL,INTENT(OUT),DIMENSION(nbp_lon*jj_nb,dimsize) :: VarOut
1874 INTEGER :: i,ij,Offset
1875
1876
1877 VarOut(1:nbp_lon,:)=.FALSE.
1878 VarOut(nbp_lon*(jj_nb-1)+1:nbp_lon*jj_nb,:)=.FALSE.
1879
1880 offset=ii_begin
1881 IF (is_north_pole_dyn) Offset=nbp_lon
1882
1883
1884 DO i=1,dimsize
1885 DO ij=1,klon_mpi
1886 VarOut(ij+offset-1,i)=VarIn(ij,i)
1887 ENDDO
1888 ENDDO
1889
1890
1891 IF (is_north_pole_dyn) THEN
1892 DO i=1,dimsize
1893 DO ij=1,nbp_lon
1894 VarOut(ij,i)=VarIn(1,i)
1895 ENDDO
1896 ENDDO
1897 ENDIF
1898
1899 IF (is_south_pole_dyn) THEN
1900 DO i=1,dimsize
1901 DO ij=nbp_lon*(jj_nb-1)+1,nbp_lon*jj_nb
1902 VarOut(ij,i)=VarIn(klon_mpi,i)
1903 ENDDO
1904 ENDDO
1905 ENDIF
1906
1907 END SUBROUTINE grid1dTo2d_mpi_lgen
1908
1909
1910
1911
1912 SUBROUTINE grid2dTo1d_mpi_igen(VarIn,VarOut,dimsize)
1913 USE mod_phys_lmdz_mpi_data
1914 USE mod_grid_phy_lmdz
1915 IMPLICIT NONE
1916
1917 INTEGER,INTENT(IN) :: dimsize
1918 INTEGER,INTENT(IN) ,DIMENSION(nbp_lon*jj_nb,dimsize) :: VarIn
1919 INTEGER,INTENT(OUT),DIMENSION(klon_mpi,dimsize) :: VarOut
1920 INTEGER :: i,ij,offset
1921
1922 offset=ii_begin
1923 IF (is_north_pole_dyn) offset=nbp_lon
1924
1925 DO i=1,dimsize
1926 DO ij=1,klon_mpi
1927 VarOut(ij,i)=VarIn(ij+offset-1,i)
1928 ENDDO
1929 ENDDO
1930
1931 IF (is_north_pole_dyn) THEN
1932 DO i=1,dimsize
1933 VarOut(1,i)=VarIn(1,i)
1934 ENDDO
1935 ENDIF
1936
1937
1938 END SUBROUTINE grid2dTo1d_mpi_igen
1939
1940
1941
1942 SUBROUTINE grid2dTo1d_mpi_rgen(VarIn,VarOut,dimsize)
1943 USE mod_phys_lmdz_mpi_data
1944 USE mod_grid_phy_lmdz
1945 IMPLICIT NONE
1946
1947 INTEGER,INTENT(IN) :: dimsize
1948 REAL,INTENT(IN) ,DIMENSION(nbp_lon*jj_nb,dimsize) :: VarIn
1949 REAL,INTENT(OUT),DIMENSION(klon_mpi,dimsize) :: VarOut
1950 INTEGER :: i,ij,offset
1951
1952 offset=ii_begin
1953 IF (is_north_pole_dyn) offset=nbp_lon
1954
1955 DO i=1,dimsize
1956 DO ij=1,klon_mpi
1957 VarOut(ij,i)=VarIn(ij+offset-1,i)
1958 ENDDO
1959 ENDDO
1960
1961 IF (is_north_pole_dyn) THEN
1962 DO i=1,dimsize
1963 VarOut(1,i)=VarIn(1,i)
1964 ENDDO
1965 ENDIF
1966
1967
1968 END SUBROUTINE grid2dTo1d_mpi_rgen
1969
1970
1971 SUBROUTINE grid2dTo1d_mpi_lgen(VarIn,VarOut,dimsize)
1972 USE mod_phys_lmdz_mpi_data
1973 USE mod_grid_phy_lmdz
1974 IMPLICIT NONE
1975
1976 INTEGER,INTENT(IN) :: dimsize
1977 LOGICAL,INTENT(IN) ,DIMENSION(nbp_lon*jj_nb,dimsize) :: VarIn
1978 LOGICAL,INTENT(OUT),DIMENSION(klon_mpi,dimsize) :: VarOut
1979 INTEGER :: i,ij,offset
1980
1981 offset=ii_begin
1982 IF (is_north_pole_dyn) offset=nbp_lon
1983
1984 DO i=1,dimsize
1985 DO ij=1,klon_mpi
1986 VarOut(ij,i)=VarIn(ij+offset-1,i)
1987 ENDDO
1988 ENDDO
1989
1990 IF (is_north_pole_dyn) THEN
1991 DO i=1,dimsize
1992 VarOut(1,i)=VarIn(1,i)
1993 ENDDO
1994 ENDIF
1995
1996
1997 END SUBROUTINE grid2dTo1d_mpi_lgen
1998
1999 END MODULE mod_phys_lmdz_mpi_transfert
2000
2001