source: LMDZ6/trunk/libf/phy_common/mod_phys_lmdz_transfert_para.F90 @ 3239

Last change on this file since 3239 was 2326, checked in by Ehouarn Millour, 9 years ago

Further code reorganization: adding "phy_common", a directory which should contain routines common (wrt structural nature of the underlying code/grid) to all LMDZ-related physics packages.
EM

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 28.9 KB
Line 
1!
2!$Header$
3!
4MODULE mod_phys_lmdz_transfert_para
5
6  USE mod_phys_lmdz_mpi_transfert
7  USE mod_phys_lmdz_omp_transfert
8
9
10
11  INTERFACE bcast
12    MODULE PROCEDURE bcast_c,                                     &
13                     bcast_i,bcast_i1,bcast_i2,bcast_i3,bcast_i4, &
14                     bcast_r,bcast_r1,bcast_r2,bcast_r3,bcast_r4, &
15                     bcast_l,bcast_l1,bcast_l2,bcast_l3,bcast_l4
16  END INTERFACE
17
18  INTERFACE scatter
19    MODULE PROCEDURE scatter_i,scatter_i1,scatter_i2,scatter_i3, &
20                     scatter_r,scatter_r1,scatter_r2,scatter_r3, &
21                     scatter_l,scatter_l1,scatter_l2,scatter_l3
22  END INTERFACE
23
24 
25  INTERFACE gather
26    MODULE PROCEDURE gather_i,gather_i1,gather_i2,gather_i3, &
27                     gather_r,gather_r1,gather_r2,gather_r3, &
28                     gather_l,gather_l1,gather_l2,gather_l3 
29  END INTERFACE
30 
31  INTERFACE scatter2D
32    MODULE PROCEDURE scatter2D_i,scatter2D_i1,scatter2D_i2,scatter2D_i3, &
33                     scatter2D_r,scatter2D_r1,scatter2D_r2,scatter2D_r3, &
34                     scatter2D_l,scatter2D_l1,scatter2D_l2,scatter2D_l3
35  END INTERFACE
36
37  INTERFACE gather2D
38    MODULE PROCEDURE gather2D_i,gather2D_i1,gather2D_i2,gather2D_i3, &
39                     gather2D_r,gather2D_r1,gather2D_r2,gather2D_r3, &
40                     gather2D_l,gather2D_l1,gather2D_l2,gather2D_l3
41  END INTERFACE
42 
43  INTERFACE reduce_sum
44    MODULE PROCEDURE reduce_sum_i,reduce_sum_i1,reduce_sum_i2,reduce_sum_i3,reduce_sum_i4, &
45                     reduce_sum_r,reduce_sum_r1,reduce_sum_r2,reduce_sum_r3,reduce_sum_r4
46  END INTERFACE
47
48   
49CONTAINS
50
51!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
52!! Definition des Broadcast --> 4D   !!
53!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
54
55!! -- Les chaine de charactère -- !!
56
57  SUBROUTINE bcast_c(var)
58  IMPLICIT NONE
59    CHARACTER(LEN=*),INTENT(INOUT) :: Var
60   
61!$OMP MASTER
62    CALL bcast_mpi(Var)
63!$OMP END MASTER
64    CALL bcast_omp(Var)
65   
66  END SUBROUTINE bcast_c
67
68!! -- Les entiers -- !!
69 
70  SUBROUTINE bcast_i(var)
71  IMPLICIT NONE
72    INTEGER,INTENT(INOUT) :: Var
73!$OMP MASTER
74    CALL bcast_mpi(Var)
75!$OMP END MASTER
76    CALL bcast_omp(Var)
77   
78  END SUBROUTINE bcast_i
79
80  SUBROUTINE bcast_i1(var)
81  IMPLICIT NONE
82    INTEGER,INTENT(INOUT) :: Var(:)
83   
84!$OMP MASTER
85    CALL bcast_mpi(Var)
86!$OMP END MASTER
87    CALL bcast_omp(Var)
88   
89  END SUBROUTINE bcast_i1
90
91
92  SUBROUTINE bcast_i2(var)
93  IMPLICIT NONE
94    INTEGER,INTENT(INOUT) :: Var(:,:)
95   
96!$OMP MASTER
97    CALL bcast_mpi(Var)
98!$OMP END MASTER
99    CALL bcast_omp(Var)
100   
101  END SUBROUTINE bcast_i2
102
103
104  SUBROUTINE bcast_i3(var)
105  IMPLICIT NONE
106    INTEGER,INTENT(INOUT) :: Var(:,:,:)
107   
108!$OMP MASTER
109    CALL bcast_mpi(Var)
110!$OMP END MASTER
111    CALL bcast_omp(Var)
112   
113  END SUBROUTINE bcast_i3
114
115
116  SUBROUTINE bcast_i4(var)
117  IMPLICIT NONE
118    INTEGER,INTENT(INOUT) :: Var(:,:,:,:)
119   
120!$OMP MASTER
121    CALL bcast_mpi(Var)
122!$OMP END MASTER
123    CALL bcast_omp(Var)
124   
125  END SUBROUTINE bcast_i4
126
127 
128!! -- Les reels -- !!
129 
130  SUBROUTINE bcast_r(var)
131  IMPLICIT NONE
132    REAL,INTENT(INOUT) :: Var
133
134!$OMP MASTER
135    CALL bcast_mpi(Var)
136!$OMP END MASTER
137    CALL bcast_omp(Var)
138   
139  END SUBROUTINE bcast_r
140
141  SUBROUTINE bcast_r1(var)
142  IMPLICIT NONE
143    REAL,INTENT(INOUT) :: Var(:)
144   
145!$OMP MASTER
146    CALL bcast_mpi(Var)
147!$OMP END MASTER
148    CALL bcast_omp(Var)
149   
150  END SUBROUTINE bcast_r1
151
152
153  SUBROUTINE bcast_r2(var)
154  IMPLICIT NONE
155    REAL,INTENT(INOUT) :: Var(:,:)
156   
157!$OMP MASTER
158    CALL bcast_mpi(Var)
159!$OMP END MASTER
160    CALL bcast_omp(Var)
161   
162  END SUBROUTINE bcast_r2
163
164
165  SUBROUTINE bcast_r3(var)
166  IMPLICIT NONE
167    REAL,INTENT(INOUT) :: Var(:,:,:)
168   
169!$OMP MASTER
170    CALL bcast_mpi(Var)
171!$OMP END MASTER
172    CALL bcast_omp(Var)
173   
174  END SUBROUTINE bcast_r3
175
176
177  SUBROUTINE bcast_r4(var)
178  IMPLICIT NONE
179    REAL,INTENT(INOUT) :: Var(:,:,:,:)
180   
181!$OMP MASTER
182    CALL bcast_mpi(Var)
183!$OMP END MASTER
184    CALL bcast_omp(Var)
185   
186  END SUBROUTINE bcast_r4
187
188
189!! -- Les booleens -- !!
190 
191  SUBROUTINE bcast_l(var)
192  IMPLICIT NONE
193    LOGICAL,INTENT(INOUT) :: Var
194!$OMP MASTER
195    CALL bcast_mpi(Var)
196!$OMP END MASTER
197    CALL bcast_omp(Var)
198   
199  END SUBROUTINE bcast_l
200
201  SUBROUTINE bcast_l1(var)
202  IMPLICIT NONE
203    LOGICAL,INTENT(INOUT) :: Var(:)
204   
205!$OMP MASTER
206    CALL bcast_mpi(Var)
207!$OMP END MASTER
208    CALL bcast_omp(Var)
209   
210  END SUBROUTINE bcast_l1
211
212
213  SUBROUTINE bcast_l2(var)
214  IMPLICIT NONE
215    LOGICAL,INTENT(INOUT) :: Var(:,:)
216   
217!$OMP MASTER
218    CALL bcast_mpi(Var)
219!$OMP END MASTER
220    CALL bcast_omp(Var)
221   
222  END SUBROUTINE bcast_l2
223
224
225  SUBROUTINE bcast_l3(var)
226  IMPLICIT NONE
227    LOGICAL,INTENT(INOUT) :: Var(:,:,:)
228   
229!$OMP MASTER
230    CALL bcast_mpi(Var)
231!$OMP END MASTER
232    CALL bcast_omp(Var)
233   
234  END SUBROUTINE bcast_l3
235
236
237  SUBROUTINE bcast_l4(var)
238  IMPLICIT NONE
239    LOGICAL,INTENT(INOUT) :: Var(:,:,:,:)
240   
241!$OMP MASTER
242    CALL bcast_mpi(Var)
243!$OMP END MASTER
244    CALL bcast_omp(Var)
245   
246  END SUBROUTINE bcast_l4
247
248
249!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
250!! Definition des Scatter   --> 4D   !!
251!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
252
253  SUBROUTINE scatter_i(VarIn, VarOut)
254    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
255    IMPLICIT NONE
256 
257    INTEGER,INTENT(IN),DIMENSION(:) :: VarIn
258    INTEGER,INTENT(OUT),DIMENSION(:) :: VarOut
259
260    INTEGER,DIMENSION(klon_mpi) :: Var_tmp
261   
262!$OMP MASTER
263      CALL scatter_mpi(VarIn,Var_tmp)
264!$OMP END MASTER
265
266      CALL scatter_omp(Var_tmp,Varout)
267   
268  END SUBROUTINE scatter_i
269
270
271  SUBROUTINE scatter_i1(VarIn, VarOut)
272    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
273    IMPLICIT NONE
274 
275    INTEGER,INTENT(IN),DIMENSION(:,:) :: VarIn
276    INTEGER,INTENT(OUT),DIMENSION(:,:) :: VarOut
277
278    INTEGER,DIMENSION(klon_mpi,SIZE(Varout,2)) :: Var_tmp
279
280!$OMP MASTER
281      CALL scatter_mpi(VarIn,Var_tmp)
282!$OMP END MASTER
283      CALL scatter_omp(Var_tmp,Varout)
284   
285  END SUBROUTINE scatter_i1
286
287
288  SUBROUTINE scatter_i2(VarIn, VarOut)
289    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
290    IMPLICIT NONE
291 
292    INTEGER,INTENT(IN),DIMENSION(:,:,:) :: VarIn
293    INTEGER,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
294   
295    INTEGER,DIMENSION(klon_mpi,SIZE(Varout,2),SIZE(Varout,3)) :: Var_tmp
296
297!$OMP MASTER
298      CALL scatter_mpi(VarIn,Var_tmp)
299!$OMP END MASTER
300      CALL scatter_omp(Var_tmp,Varout)
301   
302  END SUBROUTINE scatter_i2
303
304
305  SUBROUTINE scatter_i3(VarIn, VarOut)
306    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
307    IMPLICIT NONE
308 
309    INTEGER,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
310    INTEGER,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
311
312    INTEGER,DIMENSION(klon_mpi,SIZE(Varout,2),SIZE(Varout,3),SIZE(Varout,4)) :: Var_tmp
313
314!$OMP MASTER
315      CALL scatter_mpi(VarIn,Var_tmp)
316!$OMP END MASTER
317      CALL scatter_omp(Var_tmp,VarOut)
318   
319  END SUBROUTINE scatter_i3
320
321
322  SUBROUTINE scatter_r(VarIn, VarOut)
323    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
324    IMPLICIT NONE
325 
326    REAL,INTENT(IN),DIMENSION(:) :: VarIn
327    REAL,INTENT(OUT),DIMENSION(:) :: VarOut
328
329    REAL,DIMENSION(klon_mpi) :: Var_tmp
330   
331!$OMP MASTER
332      CALL scatter_mpi(VarIn,Var_tmp)
333!$OMP END MASTER
334
335      CALL scatter_omp(Var_tmp,Varout)
336   
337  END SUBROUTINE scatter_r
338
339
340  SUBROUTINE scatter_r1(VarIn, VarOut)
341    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
342    IMPLICIT NONE
343 
344    REAL,INTENT(IN),DIMENSION(:,:) :: VarIn
345    REAL,INTENT(OUT),DIMENSION(:,:) :: VarOut
346
347    REAL,DIMENSION(klon_mpi,SIZE(Varout,2)) :: Var_tmp
348
349!$OMP MASTER
350      CALL scatter_mpi(VarIn,Var_tmp)
351!$OMP END MASTER
352      CALL scatter_omp(Var_tmp,Varout)
353   
354  END SUBROUTINE scatter_r1
355
356
357  SUBROUTINE scatter_r2(VarIn, VarOut)
358    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
359    IMPLICIT NONE
360 
361    REAL,INTENT(IN),DIMENSION(:,:,:) :: VarIn
362    REAL,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
363   
364    REAL,DIMENSION(klon_mpi,SIZE(Varout,2),SIZE(Varout,3)) :: Var_tmp
365
366!$OMP MASTER
367      CALL scatter_mpi(VarIn,Var_tmp)
368!$OMP END MASTER
369      CALL scatter_omp(Var_tmp,Varout)
370   
371  END SUBROUTINE scatter_r2
372
373
374  SUBROUTINE scatter_r3(VarIn, VarOut)
375    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
376    IMPLICIT NONE
377 
378    REAL,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
379    REAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
380
381    REAL,DIMENSION(klon_mpi,SIZE(Varout,2),SIZE(Varout,3),SIZE(Varout,4)) :: Var_tmp
382
383!$OMP MASTER
384      CALL scatter_mpi(VarIn,Var_tmp)
385!$OMP END MASTER
386      CALL scatter_omp(Var_tmp,VarOut)
387   
388  END SUBROUTINE scatter_r3
389 
390 
391
392  SUBROUTINE scatter_l(VarIn, VarOut)
393    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
394    IMPLICIT NONE
395 
396    LOGICAL,INTENT(IN),DIMENSION(:) :: VarIn
397    LOGICAL,INTENT(OUT),DIMENSION(:) :: VarOut
398
399    LOGICAL,DIMENSION(klon_mpi) :: Var_tmp
400   
401!$OMP MASTER
402      CALL scatter_mpi(VarIn,Var_tmp)
403!$OMP END MASTER
404
405      CALL scatter_omp(Var_tmp,Varout)
406   
407  END SUBROUTINE scatter_l
408
409
410  SUBROUTINE scatter_l1(VarIn, VarOut)
411    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
412    IMPLICIT NONE
413 
414    LOGICAL,INTENT(IN),DIMENSION(:,:) :: VarIn
415    LOGICAL,INTENT(OUT),DIMENSION(:,:) :: VarOut
416
417    LOGICAL,DIMENSION(klon_mpi,SIZE(Varout,2)) :: Var_tmp
418
419!$OMP MASTER
420      CALL scatter_mpi(VarIn,Var_tmp)
421!$OMP END MASTER
422      CALL scatter_omp(Var_tmp,Varout)
423   
424  END SUBROUTINE scatter_l1
425
426
427  SUBROUTINE scatter_l2(VarIn, VarOut)
428    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
429    IMPLICIT NONE
430 
431    LOGICAL,INTENT(IN),DIMENSION(:,:,:) :: VarIn
432    LOGICAL,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
433   
434    LOGICAL,DIMENSION(klon_mpi,SIZE(Varout,2),SIZE(Varout,3)) :: Var_tmp
435
436!$OMP MASTER
437      CALL scatter_mpi(VarIn,Var_tmp)
438!$OMP END MASTER
439      CALL scatter_omp(Var_tmp,Varout)
440   
441  END SUBROUTINE scatter_l2
442
443
444  SUBROUTINE scatter_l3(VarIn, VarOut)
445    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
446    IMPLICIT NONE
447 
448    LOGICAL,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
449    LOGICAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
450
451    LOGICAL,DIMENSION(klon_mpi,SIZE(Varout,2),SIZE(Varout,3),SIZE(Varout,4)) :: Var_tmp
452
453!$OMP MASTER
454      CALL scatter_mpi(VarIn,Var_tmp)
455!$OMP END MASTER
456      CALL scatter_omp(Var_tmp,VarOut)
457   
458  END SUBROUTINE scatter_l3
459
460
461
462!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
463!! Definition des Gather   --> 4D   !!
464!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
465 
466!!!!! --> Les entiers
467
468  SUBROUTINE gather_i(VarIn, VarOut)
469    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
470    IMPLICIT NONE
471 
472    INTEGER,INTENT(IN),DIMENSION(:) :: VarIn
473    INTEGER,INTENT(OUT),DIMENSION(:) :: VarOut
474   
475    INTEGER, DIMENSION(klon_mpi) :: Var_tmp
476   
477    CALL gather_omp(VarIn,Var_tmp)
478!$OMP MASTER
479    CALL gather_mpi(Var_tmp,Varout)
480!$OMP END MASTER
481 
482  END SUBROUTINE gather_i
483
484
485  SUBROUTINE gather_i1(VarIn, VarOut)
486    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
487    IMPLICIT NONE
488 
489    INTEGER,INTENT(IN),DIMENSION(:,:) :: VarIn
490    INTEGER,INTENT(OUT),DIMENSION(:,:) :: VarOut
491   
492    INTEGER, DIMENSION(klon_mpi,SIZE(VarIn,2)) :: Var_tmp
493   
494    CALL gather_omp(VarIn,Var_tmp)
495!$OMP MASTER
496    CALL gather_mpi(Var_tmp,Varout)
497!$OMP END MASTER
498 
499  END SUBROUTINE gather_i1
500
501
502  SUBROUTINE gather_i2(VarIn, VarOut)
503    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
504    IMPLICIT NONE
505 
506    INTEGER,INTENT(IN),DIMENSION(:,:,:) :: VarIn
507    INTEGER,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
508   
509    INTEGER, DIMENSION(klon_mpi,SIZE(VarIn,2),SIZE(VarIn,3)) :: Var_tmp
510   
511    CALL gather_omp(VarIn,Var_tmp)
512!$OMP MASTER
513    CALL gather_mpi(Var_tmp,VarOut)
514!$OMP END MASTER
515 
516  END SUBROUTINE gather_i2
517
518
519  SUBROUTINE gather_i3(VarIn, VarOut)
520    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
521    IMPLICIT NONE
522 
523    INTEGER,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
524    INTEGER,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
525   
526    INTEGER, DIMENSION(klon_mpi,SIZE(VarIn,2),SIZE(VarIn,3),SIZE(VarIn,4)) :: Var_tmp
527   
528    CALL gather_omp(VarIn,Var_tmp)
529!$OMP MASTER
530    CALL gather_mpi(Var_tmp,VarOut)
531!$OMP END MASTER
532 
533  END SUBROUTINE gather_i3
534
535
536!!!!! --> Les reels
537
538  SUBROUTINE gather_r(VarIn, VarOut)
539    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
540    IMPLICIT NONE
541 
542    REAL,INTENT(IN),DIMENSION(:) :: VarIn
543    REAL,INTENT(OUT),DIMENSION(:) :: VarOut
544   
545    REAL, DIMENSION(klon_mpi) :: Var_tmp
546   
547    CALL gather_omp(VarIn,Var_tmp)
548!$OMP MASTER
549    CALL gather_mpi(Var_tmp,VarOut)
550!$OMP END MASTER
551 
552  END SUBROUTINE gather_r
553
554
555  SUBROUTINE gather_r1(VarIn, VarOut)
556    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
557    IMPLICIT NONE
558 
559    REAL,INTENT(IN),DIMENSION(:,:) :: VarIn
560    REAL,INTENT(OUT),DIMENSION(:,:) :: VarOut
561   
562    REAL, DIMENSION(klon_mpi,SIZE(VarIn,2)) :: Var_tmp
563   
564    CALL gather_omp(VarIn,Var_tmp)
565!$OMP MASTER
566    CALL gather_mpi(Var_tmp,VarOut)
567!$OMP END MASTER
568 
569  END SUBROUTINE gather_r1
570
571
572  SUBROUTINE gather_r2(VarIn, VarOut)
573    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
574    IMPLICIT NONE
575 
576    REAL,INTENT(IN),DIMENSION(:,:,:) :: VarIn
577    REAL,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
578   
579    REAL, DIMENSION(klon_mpi,SIZE(VarIn,2),SIZE(VarIn,3)) :: Var_tmp
580   
581    CALL gather_omp(VarIn,Var_tmp)
582!$OMP MASTER
583    CALL gather_mpi(Var_tmp,VarOut)
584!$OMP END MASTER
585 
586  END SUBROUTINE gather_r2
587
588
589  SUBROUTINE gather_r3(VarIn, VarOut)
590    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
591    IMPLICIT NONE
592 
593    REAL,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
594    REAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
595   
596    REAL, DIMENSION(klon_mpi,SIZE(VarIn,2),SIZE(VarIn,3),SIZE(VarIn,4)) :: Var_tmp
597   
598    CALL gather_omp(VarIn,Var_tmp)
599!$OMP MASTER
600    CALL gather_mpi(Var_tmp,VarOut)
601!$OMP END MASTER
602 
603  END SUBROUTINE gather_r3
604
605
606!!!!! --> Les booleens
607
608  SUBROUTINE gather_l(VarIn, VarOut)
609    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
610    IMPLICIT NONE
611 
612    LOGICAL,INTENT(IN),DIMENSION(:) :: VarIn
613    LOGICAL,INTENT(OUT),DIMENSION(:) :: VarOut
614   
615    LOGICAL, DIMENSION(klon_mpi) :: Var_tmp
616   
617    CALL gather_omp(VarIn,Var_tmp)
618!$OMP MASTER
619    CALL gather_mpi(Var_tmp,VarOut)
620!$OMP END MASTER
621 
622  END SUBROUTINE gather_l
623
624
625  SUBROUTINE gather_l1(VarIn, VarOut)
626    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
627    IMPLICIT NONE
628 
629    LOGICAL,INTENT(IN),DIMENSION(:,:) :: VarIn
630    LOGICAL,INTENT(OUT),DIMENSION(:,:) :: VarOut
631   
632    LOGICAL, DIMENSION(klon_mpi,SIZE(VarIn,2)) :: Var_tmp
633   
634    CALL gather_omp(VarIn,Var_tmp)
635!$OMP MASTER
636    CALL gather_mpi(Var_tmp,VarOut)
637!$OMP END MASTER
638 
639  END SUBROUTINE gather_l1
640
641
642  SUBROUTINE gather_l2(VarIn, VarOut)
643    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
644    IMPLICIT NONE
645 
646    LOGICAL,INTENT(IN),DIMENSION(:,:,:) :: VarIn
647    LOGICAL,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
648   
649    LOGICAL, DIMENSION(klon_mpi,SIZE(VarIn,2),SIZE(VarIn,3)) :: Var_tmp
650   
651    CALL gather_omp(VarIn,Var_tmp)
652!$OMP MASTER
653    CALL gather_mpi(Var_tmp,VarOut)
654!$OMP END MASTER
655 
656  END SUBROUTINE gather_l2
657
658
659  SUBROUTINE gather_l3(VarIn, VarOut)
660    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
661    IMPLICIT NONE
662 
663    LOGICAL,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
664    LOGICAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
665   
666    LOGICAL, DIMENSION(klon_mpi,SIZE(VarIn,2),SIZE(VarIn,3),SIZE(VarIn,4)) :: Var_tmp
667   
668    CALL gather_omp(VarIn,Var_tmp)
669!$OMP MASTER
670    CALL gather_mpi(Var_tmp,VarOut)
671!$OMP END MASTER
672 
673  END SUBROUTINE gather_l3
674
675
676!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
677!! Definition des Scatter2D   --> 4D   !!
678!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
679
680
681!!!!! --> Les entiers
682
683  SUBROUTINE scatter2D_i(VarIn, VarOut)
684    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
685    IMPLICIT NONE
686 
687    INTEGER,INTENT(IN),DIMENSION(:,:) :: VarIn
688    INTEGER,INTENT(OUT),DIMENSION(:) :: VarOut
689
690    INTEGER,DIMENSION(klon_mpi) :: Var_tmp   
691
692!$OMP MASTER   
693    CALL scatter2D_mpi(VarIn,Var_tmp)
694!$OMP END MASTER
695    CALL scatter_omp(Var_tmp,VarOut)
696
697  END SUBROUTINE scatter2D_i
698
699
700  SUBROUTINE scatter2D_i1(VarIn, VarOut)
701    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
702    IMPLICIT NONE
703 
704    INTEGER,INTENT(IN),DIMENSION(:,:,:) :: VarIn
705    INTEGER,INTENT(OUT),DIMENSION(:,:) :: VarOut
706
707    INTEGER,DIMENSION(klon_mpi,SIZE(VarOut,2)) :: Var_tmp   
708
709!$OMP MASTER   
710    CALL scatter2D_mpi(VarIn,Var_tmp)
711!$OMP END MASTER
712    CALL scatter_omp(Var_tmp,VarOut)
713
714  END SUBROUTINE scatter2D_i1
715 
716
717  SUBROUTINE scatter2D_i2(VarIn, VarOut)
718    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
719    IMPLICIT NONE
720 
721    INTEGER,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
722    INTEGER,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
723
724    INTEGER,DIMENSION(klon_mpi,SIZE(VarOut,2),SIZE(VarOut,3)) :: Var_tmp   
725
726!$OMP MASTER   
727    CALL scatter2D_mpi(VarIn,Var_tmp)
728!$OMP END MASTER
729    CALL scatter_omp(Var_tmp,VarOut)
730
731  END SUBROUTINE scatter2D_i2 
732
733
734  SUBROUTINE scatter2D_i3(VarIn, VarOut)
735    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
736    IMPLICIT NONE
737 
738    INTEGER,INTENT(IN),DIMENSION(:,:,:,:,:) :: VarIn
739    INTEGER,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
740
741    INTEGER,DIMENSION(klon_mpi,SIZE(VarOut,2),SIZE(VarOut,3),SIZE(VarOut,4)) :: Var_tmp   
742
743!$OMP MASTER   
744    CALL scatter2D_mpi(VarIn,Var_tmp)
745!$OMP END MASTER
746    CALL scatter_omp(Var_tmp,VarOut)
747
748  END SUBROUTINE scatter2D_i3
749 
750
751!!!!! --> Les reels
752
753  SUBROUTINE scatter2D_r(VarIn, VarOut)
754    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
755    IMPLICIT NONE
756 
757    REAL,INTENT(IN),DIMENSION(:,:) :: VarIn
758    REAL,INTENT(OUT),DIMENSION(:) :: VarOut
759
760    REAL,DIMENSION(klon_mpi) :: Var_tmp   
761
762!$OMP MASTER   
763    CALL scatter2D_mpi(VarIn,Var_tmp)
764!$OMP END MASTER
765    CALL scatter_omp(Var_tmp,VarOut)
766
767  END SUBROUTINE scatter2D_r
768
769
770  SUBROUTINE scatter2D_r1(VarIn, VarOut)
771    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
772    IMPLICIT NONE
773 
774    REAL,INTENT(IN),DIMENSION(:,:,:) :: VarIn
775    REAL,INTENT(OUT),DIMENSION(:,:) :: VarOut
776
777    REAL,DIMENSION(klon_mpi,SIZE(VarOut,2)) :: Var_tmp   
778
779!$OMP MASTER   
780    CALL scatter2D_mpi(VarIn,Var_tmp)
781!$OMP END MASTER
782    CALL scatter_omp(Var_tmp,VarOut)
783
784  END SUBROUTINE scatter2D_r1
785 
786
787  SUBROUTINE scatter2D_r2(VarIn, VarOut)
788    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
789    IMPLICIT NONE
790 
791    REAL,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
792    REAL,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
793
794    REAL,DIMENSION(klon_mpi,SIZE(VarOut,2),SIZE(VarOut,3)) :: Var_tmp   
795
796!$OMP MASTER   
797    CALL scatter2D_mpi(VarIn,Var_tmp)
798!$OMP END MASTER
799    CALL scatter_omp(Var_tmp,VarOut)
800
801  END SUBROUTINE scatter2D_r2 
802
803
804  SUBROUTINE scatter2D_r3(VarIn, VarOut)
805    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
806    IMPLICIT NONE
807 
808    REAL,INTENT(IN),DIMENSION(:,:,:,:,:) :: VarIn
809    REAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
810
811    REAL,DIMENSION(klon_mpi,SIZE(VarOut,2),SIZE(VarOut,3),SIZE(VarOut,4)) :: Var_tmp   
812
813!$OMP MASTER   
814    CALL scatter2D_mpi(VarIn,Var_tmp)
815!$OMP END MASTER
816    CALL scatter_omp(Var_tmp,VarOut)
817
818  END SUBROUTINE scatter2D_r3
819   
820   
821!!!!! --> Les booleens
822
823
824  SUBROUTINE scatter2D_l(VarIn, VarOut)
825    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
826    IMPLICIT NONE
827 
828    LOGICAL,INTENT(IN),DIMENSION(:,:) :: VarIn
829    LOGICAL,INTENT(OUT),DIMENSION(:) :: VarOut
830
831    LOGICAL,DIMENSION(klon_mpi) :: Var_tmp   
832
833!$OMP MASTER   
834    CALL scatter2D_mpi(VarIn,Var_tmp)
835!$OMP END MASTER
836    CALL scatter_omp(Var_tmp,VarOut)
837
838  END SUBROUTINE scatter2D_l
839
840
841  SUBROUTINE scatter2D_l1(VarIn, VarOut)
842    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
843    IMPLICIT NONE
844 
845    LOGICAL,INTENT(IN),DIMENSION(:,:,:) :: VarIn
846    LOGICAL,INTENT(OUT),DIMENSION(:,:) :: VarOut
847
848    LOGICAL,DIMENSION(klon_mpi,SIZE(VarOut,2)) :: Var_tmp   
849
850!$OMP MASTER   
851    CALL scatter2D_mpi(VarIn,Var_tmp)
852!$OMP END MASTER
853    CALL scatter_omp(Var_tmp,VarOut)
854
855  END SUBROUTINE scatter2D_l1
856 
857
858  SUBROUTINE scatter2D_l2(VarIn, VarOut)
859    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
860    IMPLICIT NONE
861 
862    LOGICAL,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
863    LOGICAL,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
864
865    LOGICAL,DIMENSION(klon_mpi,SIZE(VarOut,2),SIZE(VarOut,3)) :: Var_tmp   
866
867!$OMP MASTER   
868    CALL scatter2D_mpi(VarIn,Var_tmp)
869!$OMP END MASTER
870    CALL scatter_omp(Var_tmp,VarOut)
871
872  END SUBROUTINE scatter2D_l2 
873
874
875  SUBROUTINE scatter2D_l3(VarIn, VarOut)
876    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
877    IMPLICIT NONE
878 
879    LOGICAL,INTENT(IN),DIMENSION(:,:,:,:,:) :: VarIn
880    LOGICAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
881
882    LOGICAL,DIMENSION(klon_mpi,SIZE(VarOut,2),SIZE(VarOut,3),SIZE(VarOut,4)) :: Var_tmp   
883
884!$OMP MASTER   
885    CALL scatter2D_mpi(VarIn,Var_tmp)
886!$OMP END MASTER
887    CALL scatter_omp(Var_tmp,VarOut)
888
889  END SUBROUTINE scatter2D_l3
890
891
892!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
893!! Definition des Gather2D   --> 4D   !!
894!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
895
896!!!!! --> Les entiers
897
898  SUBROUTINE gather2D_i(VarIn, VarOut)
899    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
900    IMPLICIT NONE
901 
902    INTEGER,INTENT(IN),DIMENSION(:) :: VarIn
903    INTEGER,INTENT(OUT),DIMENSION(:,:) :: VarOut
904   
905    INTEGER,DIMENSION(klon_mpi) :: Var_tmp
906
907    CALL gather_omp(VarIn,Var_tmp)
908!$OMP MASTER
909    CALL gather2D_mpi(Var_tmp,VarOut)
910!$OMP END MASTER   
911
912  END SUBROUTINE gather2D_i
913 
914
915  SUBROUTINE gather2D_i1(VarIn, VarOut)
916    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
917    IMPLICIT NONE
918 
919    INTEGER,INTENT(IN),DIMENSION(:,:) :: VarIn
920    INTEGER,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
921   
922    INTEGER,DIMENSION(klon_mpi,SIZE(VarIn,2)) :: Var_tmp
923
924    CALL gather_omp(VarIn,Var_tmp)
925!$OMP MASTER
926    CALL gather2D_mpi(Var_tmp,VarOut)
927!$OMP END MASTER   
928
929  END SUBROUTINE gather2D_i1
930
931 
932  SUBROUTINE gather2D_i2(VarIn, VarOut)
933    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
934    IMPLICIT NONE
935 
936    INTEGER,INTENT(IN),DIMENSION(:,:,:) :: VarIn
937    INTEGER,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
938   
939    INTEGER,DIMENSION(klon_mpi,SIZE(VarIn,2),SIZE(VarIn,3)) :: Var_tmp
940
941    CALL gather_omp(VarIn,Var_tmp)
942!$OMP MASTER
943    CALL gather2D_mpi(Var_tmp,VarOut)
944!$OMP END MASTER   
945
946  END SUBROUTINE gather2D_i2
947
948
949  SUBROUTINE gather2D_i3(VarIn, VarOut)
950    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
951    IMPLICIT NONE
952 
953    INTEGER,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
954    INTEGER,INTENT(OUT),DIMENSION(:,:,:,:,:) :: VarOut
955   
956    INTEGER,DIMENSION(klon_mpi,SIZE(VarIn,2),SIZE(VarIn,3),SIZE(VarIn,4)) :: Var_tmp
957
958    CALL gather_omp(VarIn,Var_tmp)
959!$OMP MASTER
960    CALL gather2D_mpi(Var_tmp,VarOut)
961!$OMP END MASTER   
962
963  END SUBROUTINE gather2D_i3
964
965
966!!!!! --> Les reels
967
968  SUBROUTINE gather2D_r(VarIn, VarOut)
969    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
970    IMPLICIT NONE
971 
972    REAL,INTENT(IN),DIMENSION(:) :: VarIn
973    REAL,INTENT(OUT),DIMENSION(:,:) :: VarOut
974   
975    REAL,DIMENSION(klon_mpi) :: Var_tmp
976
977    CALL gather_omp(VarIn,Var_tmp)
978!$OMP MASTER
979    CALL gather2D_mpi(Var_tmp,VarOut)
980!$OMP END MASTER   
981
982  END SUBROUTINE gather2D_r
983 
984
985  SUBROUTINE gather2D_r1(VarIn, VarOut)
986    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
987    IMPLICIT NONE
988 
989    REAL,INTENT(IN),DIMENSION(:,:) :: VarIn
990    REAL,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
991   
992    REAL,DIMENSION(klon_mpi,SIZE(VarIn,2)) :: Var_tmp
993
994    CALL gather_omp(VarIn,Var_tmp)
995!$OMP MASTER
996    CALL gather2D_mpi(Var_tmp,VarOut)
997!$OMP END MASTER   
998
999  END SUBROUTINE gather2D_r1
1000
1001 
1002  SUBROUTINE gather2D_r2(VarIn, VarOut)
1003    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
1004    IMPLICIT NONE
1005 
1006    REAL,INTENT(IN),DIMENSION(:,:,:) :: VarIn
1007    REAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
1008   
1009    REAL,DIMENSION(klon_mpi,SIZE(VarIn,2),SIZE(VarIn,3)) :: Var_tmp
1010
1011    CALL gather_omp(VarIn,Var_tmp)
1012!$OMP MASTER
1013    CALL gather2D_mpi(Var_tmp,VarOut)
1014!$OMP END MASTER   
1015
1016  END SUBROUTINE gather2D_r2
1017
1018
1019  SUBROUTINE gather2D_r3(VarIn, VarOut)
1020    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
1021    IMPLICIT NONE
1022 
1023    REAL,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
1024    REAL,INTENT(OUT),DIMENSION(:,:,:,:,:) :: VarOut
1025   
1026    REAL,DIMENSION(klon_mpi,SIZE(VarIn,2),SIZE(VarIn,3),SIZE(VarIn,4)) :: Var_tmp
1027
1028    CALL gather_omp(VarIn,Var_tmp)
1029!$OMP MASTER
1030    CALL gather2D_mpi(Var_tmp,VarOut)
1031!$OMP END MASTER   
1032
1033  END SUBROUTINE gather2D_r3
1034 
1035
1036!!!!! --> Les booleens
1037
1038  SUBROUTINE gather2D_l(VarIn, VarOut)
1039    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
1040    IMPLICIT NONE
1041 
1042    LOGICAL,INTENT(IN),DIMENSION(:) :: VarIn
1043    LOGICAL,INTENT(OUT),DIMENSION(:,:) :: VarOut
1044   
1045    LOGICAL,DIMENSION(klon_mpi) :: Var_tmp
1046
1047    CALL gather_omp(VarIn,Var_tmp)
1048!$OMP MASTER
1049    CALL gather2D_mpi(Var_tmp,VarOut)
1050!$OMP END MASTER   
1051
1052  END SUBROUTINE gather2D_l
1053 
1054
1055  SUBROUTINE gather2D_l1(VarIn, VarOut)
1056    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
1057    IMPLICIT NONE
1058 
1059    LOGICAL,INTENT(IN),DIMENSION(:,:) :: VarIn
1060    LOGICAL,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
1061   
1062    LOGICAL,DIMENSION(klon_mpi,SIZE(VarIn,2)) :: Var_tmp
1063
1064    CALL gather_omp(VarIn,Var_tmp)
1065!$OMP MASTER
1066    CALL gather2D_mpi(Var_tmp,VarOut)
1067!$OMP END MASTER   
1068
1069  END SUBROUTINE gather2D_l1
1070
1071 
1072  SUBROUTINE gather2D_l2(VarIn, VarOut)
1073    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
1074    IMPLICIT NONE
1075 
1076    LOGICAL,INTENT(IN),DIMENSION(:,:,:) :: VarIn
1077    LOGICAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
1078   
1079    LOGICAL,DIMENSION(klon_mpi,SIZE(VarIn,2),SIZE(VarIn,3)) :: Var_tmp
1080
1081    CALL gather_omp(VarIn,Var_tmp)
1082!$OMP MASTER
1083    CALL gather2D_mpi(Var_tmp,VarOut)
1084!$OMP END MASTER   
1085
1086  END SUBROUTINE gather2D_l2
1087
1088
1089  SUBROUTINE gather2D_l3(VarIn, VarOut)
1090    USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi
1091    IMPLICIT NONE
1092 
1093    LOGICAL,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn
1094    LOGICAL,INTENT(OUT),DIMENSION(:,:,:,:,:) :: VarOut
1095   
1096    LOGICAL,DIMENSION(klon_mpi,SIZE(VarIn,2),SIZE(VarIn,3),SIZE(VarIn,4)) :: Var_tmp
1097
1098    CALL gather_omp(VarIn,Var_tmp)
1099!$OMP MASTER
1100    CALL gather2D_mpi(Var_tmp,VarOut)
1101!$OMP END MASTER   
1102
1103  END SUBROUTINE gather2D_l3
1104 
1105
1106!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1107!! Definition des reduce_sum   --> 4D   !!
1108!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1109
1110! Les entiers
1111
1112  SUBROUTINE reduce_sum_i(VarIn, VarOut)
1113    IMPLICIT NONE
1114 
1115    INTEGER,INTENT(IN)  :: VarIn
1116    INTEGER,INTENT(OUT) :: VarOut
1117   
1118    INTEGER             :: Var_tmp
1119           
1120    CALL reduce_sum_omp(VarIn,Var_tmp)
1121!$OMP MASTER     
1122    CALL reduce_sum_mpi(Var_tmp,VarOut)
1123!$OMP END MASTER
1124 
1125  END SUBROUTINE reduce_sum_i 
1126
1127
1128  SUBROUTINE reduce_sum_i1(VarIn, VarOut)
1129    IMPLICIT NONE
1130 
1131    INTEGER,INTENT(IN),DIMENSION(:)  :: VarIn
1132    INTEGER,INTENT(OUT),DIMENSION(:) :: VarOut
1133   
1134    INTEGER,DIMENSION(SIZE(VarIn))   :: Var_tmp
1135           
1136    CALL reduce_sum_omp(VarIn,Var_tmp)
1137!$OMP MASTER     
1138    CALL reduce_sum_mpi(Var_tmp,VarOut)
1139!$OMP END MASTER
1140 
1141  END SUBROUTINE reduce_sum_i1 
1142
1143
1144  SUBROUTINE reduce_sum_i2(VarIn, VarOut)
1145    IMPLICIT NONE
1146 
1147    INTEGER,INTENT(IN),DIMENSION(:,:)  :: VarIn
1148    INTEGER,INTENT(OUT),DIMENSION(:,:) :: VarOut
1149   
1150    INTEGER,DIMENSION(SIZE(VarIn,1),SIZE(VarIn,2)) :: Var_tmp
1151           
1152    CALL reduce_sum_omp(VarIn,Var_tmp)
1153!$OMP MASTER     
1154    CALL reduce_sum_mpi(Var_tmp,VarOut)
1155!$OMP END MASTER
1156 
1157  END SUBROUTINE reduce_sum_i2 
1158 
1159
1160  SUBROUTINE reduce_sum_i3(VarIn, VarOut)
1161    IMPLICIT NONE
1162 
1163    INTEGER,INTENT(IN),DIMENSION(:,:,:)  :: VarIn
1164    INTEGER,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
1165   
1166    INTEGER,DIMENSION(SIZE(VarIn,1),SIZE(VarIn,2),SIZE(VarIn,3))  :: Var_tmp
1167           
1168    CALL reduce_sum_omp(VarIn,Var_tmp)
1169!$OMP MASTER     
1170    CALL reduce_sum_mpi(Var_tmp,VarOut)
1171!$OMP END MASTER
1172 
1173  END SUBROUTINE reduce_sum_i3 
1174
1175
1176  SUBROUTINE reduce_sum_i4(VarIn, VarOut)
1177    IMPLICIT NONE
1178 
1179    INTEGER,INTENT(IN),DIMENSION(:,:,:,:)  :: VarIn
1180    INTEGER,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
1181   
1182    INTEGER,DIMENSION(SIZE(VarIn,1),SIZE(VarIn,2),SIZE(VarIn,3),SIZE(VarIn,4))  :: Var_tmp
1183           
1184    CALL reduce_sum_omp(VarIn,Var_tmp)
1185!$OMP MASTER     
1186    CALL reduce_sum_mpi(Var_tmp,VarOut)
1187!$OMP END MASTER
1188 
1189  END SUBROUTINE reduce_sum_i4 
1190
1191
1192! Les reels
1193
1194  SUBROUTINE reduce_sum_r(VarIn, VarOut)
1195    IMPLICIT NONE
1196 
1197    REAL,INTENT(IN)  :: VarIn
1198    REAL,INTENT(OUT) :: VarOut
1199   
1200    REAL             :: Var_tmp
1201           
1202    CALL reduce_sum_omp(VarIn,Var_tmp)
1203!$OMP MASTER     
1204    CALL reduce_sum_mpi(Var_tmp,VarOut)
1205!$OMP END MASTER
1206 
1207  END SUBROUTINE reduce_sum_r 
1208
1209
1210  SUBROUTINE reduce_sum_r1(VarIn, VarOut)
1211    IMPLICIT NONE
1212 
1213    REAL,INTENT(IN),DIMENSION(:)  :: VarIn
1214    REAL,INTENT(OUT),DIMENSION(:) :: VarOut
1215   
1216    REAL,DIMENSION(SIZE(VarIn))   :: Var_tmp
1217           
1218    CALL reduce_sum_omp(VarIn,Var_tmp)
1219!$OMP MASTER     
1220    CALL reduce_sum_mpi(Var_tmp,VarOut)
1221!$OMP END MASTER
1222 
1223  END SUBROUTINE reduce_sum_r1 
1224
1225
1226  SUBROUTINE reduce_sum_r2(VarIn, VarOut)
1227    IMPLICIT NONE
1228 
1229    REAL,INTENT(IN),DIMENSION(:,:)  :: VarIn
1230    REAL,INTENT(OUT),DIMENSION(:,:) :: VarOut
1231   
1232    REAL,DIMENSION(SIZE(VarIn,1),SIZE(VarIn,2)) :: Var_tmp
1233           
1234    CALL reduce_sum_omp(VarIn,Var_tmp)
1235!$OMP MASTER     
1236    CALL reduce_sum_mpi(Var_tmp,VarOut)
1237!$OMP END MASTER
1238 
1239  END SUBROUTINE reduce_sum_r2 
1240 
1241
1242  SUBROUTINE reduce_sum_r3(VarIn, VarOut)
1243    IMPLICIT NONE
1244 
1245    REAL,INTENT(IN),DIMENSION(:,:,:)  :: VarIn
1246    REAL,INTENT(OUT),DIMENSION(:,:,:) :: VarOut
1247   
1248    REAL,DIMENSION(SIZE(VarIn,1),SIZE(VarIn,2),SIZE(VarIn,3))  :: Var_tmp
1249           
1250    CALL reduce_sum_omp(VarIn,Var_tmp)
1251!$OMP MASTER     
1252    CALL reduce_sum_mpi(Var_tmp,VarOut)
1253!$OMP END MASTER
1254 
1255  END SUBROUTINE reduce_sum_r3 
1256
1257
1258  SUBROUTINE reduce_sum_r4(VarIn, VarOut)
1259    IMPLICIT NONE
1260 
1261    REAL,INTENT(IN),DIMENSION(:,:,:,:)  :: VarIn
1262    REAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut
1263   
1264    REAL,DIMENSION(SIZE(VarIn,1),SIZE(VarIn,2),SIZE(VarIn,3),SIZE(VarIn,4))  :: Var_tmp
1265           
1266    CALL reduce_sum_omp(VarIn,Var_tmp)
1267!$OMP MASTER     
1268    CALL reduce_sum_mpi(Var_tmp,VarOut)
1269!$OMP END MASTER
1270 
1271  END SUBROUTINE reduce_sum_r4 
1272
1273   
1274END MODULE mod_phys_lmdz_transfert_para
1275
Note: See TracBrowser for help on using the repository browser.