FV3 Bundle
mpp_domains_reduce.inc
Go to the documentation of this file.
1 ! -*-f90-*-
2 
3 !***********************************************************************
4 !* GNU Lesser General Public License
5 !*
6 !* This file is part of the GFDL Flexible Modeling System (FMS).
7 !*
8 !* FMS is free software: you can redistribute it and/or modify it under
9 !* the terms of the GNU Lesser General Public License as published by
10 !* the Free Software Foundation, either version 3 of the License, or (at
11 !* your option) any later version.
12 !*
13 !* FMS is distributed in the hope that it will be useful, but WITHOUT
14 !* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 !* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 !* for more details.
17 !*
18 !* You should have received a copy of the GNU Lesser General Public
19 !* License along with FMS. If not, see <http://www.gnu.org/licenses/>.
20 !***********************************************************************
21 
22 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
23 ! !
24 ! MPP_GLOBAL_REDUCE: get global max/min of field !
25 ! !
26 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
27 
28 #undef MPP_GLOBAL_REDUCE_2D_
29 #define MPP_GLOBAL_REDUCE_2D_ mpp_global_max_r8_2d
30 #undef MPP_GLOBAL_REDUCE_3D_
31 #define MPP_GLOBAL_REDUCE_3D_ mpp_global_max_r8_3d
32 #undef MPP_GLOBAL_REDUCE_4D_
33 #define MPP_GLOBAL_REDUCE_4D_ mpp_global_max_r8_4d
34 #undef MPP_GLOBAL_REDUCE_5D_
35 #define MPP_GLOBAL_REDUCE_5D_ mpp_global_max_r8_5d
36 #undef MPP_TYPE_
37 #define MPP_TYPE_ real(DOUBLE_KIND)
38 #undef REDUCE_VAL_
39 #define REDUCE_VAL_ maxval
40 #undef REDUCE_LOC_
41 #define REDUCE_LOC_ maxloc
42 #undef MPP_REDUCE_
43 #define MPP_REDUCE_ mpp_max
44 #include <mpp_global_reduce.h>
45 
46 #undef MPP_GLOBAL_REDUCE_2D_
47 #define MPP_GLOBAL_REDUCE_2D_ mpp_global_min_r8_2d
48 #undef MPP_GLOBAL_REDUCE_3D_
49 #define MPP_GLOBAL_REDUCE_3D_ mpp_global_min_r8_3d
50 #undef MPP_GLOBAL_REDUCE_4D_
51 #define MPP_GLOBAL_REDUCE_4D_ mpp_global_min_r8_4d
52 #undef MPP_GLOBAL_REDUCE_5D_
53 #define MPP_GLOBAL_REDUCE_5D_ mpp_global_min_r8_5d
54 #undef MPP_TYPE_
55 #define MPP_TYPE_ real(DOUBLE_KIND)
56 #undef REDUCE_VAL_
57 #define REDUCE_VAL_ minval
58 #undef REDUCE_LOC_
59 #define REDUCE_LOC_ minloc
60 #undef MPP_REDUCE_
61 #define MPP_REDUCE_ mpp_min
62 #include <mpp_global_reduce.h>
63 
64 #ifdef OVERLOAD_R4
65 #undef MPP_GLOBAL_REDUCE_2D_
66 #define MPP_GLOBAL_REDUCE_2D_ mpp_global_max_r4_2d
67 #undef MPP_GLOBAL_REDUCE_3D_
68 #define MPP_GLOBAL_REDUCE_3D_ mpp_global_max_r4_3d
69 #undef MPP_GLOBAL_REDUCE_4D_
70 #define MPP_GLOBAL_REDUCE_4D_ mpp_global_max_r4_4d
71 #undef MPP_GLOBAL_REDUCE_5D_
72 #define MPP_GLOBAL_REDUCE_5D_ mpp_global_max_r4_5d
73 #undef MPP_TYPE_
74 #define MPP_TYPE_ real(FLOAT_KIND)
75 #undef REDUCE_VAL_
76 #define REDUCE_VAL_ maxval
77 #undef REDUCE_LOC_
78 #define REDUCE_LOC_ maxloc
79 #undef MPP_REDUCE_
80 #define MPP_REDUCE_ mpp_max
81 #include <mpp_global_reduce.h>
82 
83 #undef MPP_GLOBAL_REDUCE_2D_
84 #define MPP_GLOBAL_REDUCE_2D_ mpp_global_min_r4_2d
85 #undef MPP_GLOBAL_REDUCE_3D_
86 #define MPP_GLOBAL_REDUCE_3D_ mpp_global_min_r4_3d
87 #undef MPP_GLOBAL_REDUCE_4D_
88 #define MPP_GLOBAL_REDUCE_4D_ mpp_global_min_r4_4d
89 #undef MPP_GLOBAL_REDUCE_5D_
90 #define MPP_GLOBAL_REDUCE_5D_ mpp_global_min_r4_5d
91 #undef MPP_TYPE_
92 #define MPP_TYPE_ real(FLOAT_KIND)
93 #undef REDUCE_VAL_
94 #define REDUCE_VAL_ minval
95 #undef REDUCE_LOC_
96 #define REDUCE_LOC_ minloc
97 #undef MPP_REDUCE_
98 #define MPP_REDUCE_ mpp_min
99 #include <mpp_global_reduce.h>
100 #endif
101 
102 #ifndef no_8byte_integers
103 #undef MPP_GLOBAL_REDUCE_2D_
104 #define MPP_GLOBAL_REDUCE_2D_ mpp_global_max_i8_2d
105 #undef MPP_GLOBAL_REDUCE_3D_
106 #define MPP_GLOBAL_REDUCE_3D_ mpp_global_max_i8_3d
107 #undef MPP_GLOBAL_REDUCE_4D_
108 #define MPP_GLOBAL_REDUCE_4D_ mpp_global_max_i8_4d
109 #undef MPP_GLOBAL_REDUCE_5D_
110 #define MPP_GLOBAL_REDUCE_5D_ mpp_global_max_i8_5d
111 #undef MPP_TYPE_
112 #define MPP_TYPE_ integer(LONG_KIND)
113 #undef REDUCE_VAL_
114 #define REDUCE_VAL_ maxval
115 #undef REDUCE_LOC_
116 #define REDUCE_LOC_ maxloc
117 #undef MPP_REDUCE_
118 #define MPP_REDUCE_ mpp_max
119 #include <mpp_global_reduce.h>
120 
121 #undef MPP_GLOBAL_REDUCE_2D_
122 #define MPP_GLOBAL_REDUCE_2D_ mpp_global_min_i8_2d
123 #undef MPP_GLOBAL_REDUCE_3D_
124 #define MPP_GLOBAL_REDUCE_3D_ mpp_global_min_i8_3d
125 #undef MPP_GLOBAL_REDUCE_4D_
126 #define MPP_GLOBAL_REDUCE_4D_ mpp_global_min_i8_4d
127 #undef MPP_GLOBAL_REDUCE_5D_
128 #define MPP_GLOBAL_REDUCE_5D_ mpp_global_min_i8_5d
129 #undef MPP_TYPE_
130 #define MPP_TYPE_ integer(LONG_KIND)
131 #undef REDUCE_VAL_
132 #define REDUCE_VAL_ minval
133 #undef REDUCE_LOC_
134 #define REDUCE_LOC_ minloc
135 #undef MPP_REDUCE_
136 #define MPP_REDUCE_ mpp_min
137 #include <mpp_global_reduce.h>
138 #endif
139 
140 #undef MPP_GLOBAL_REDUCE_2D_
141 #define MPP_GLOBAL_REDUCE_2D_ mpp_global_max_i4_2d
142 #undef MPP_GLOBAL_REDUCE_3D_
143 #define MPP_GLOBAL_REDUCE_3D_ mpp_global_max_i4_3d
144 #undef MPP_GLOBAL_REDUCE_4D_
145 #define MPP_GLOBAL_REDUCE_4D_ mpp_global_max_i4_4d
146 #undef MPP_GLOBAL_REDUCE_5D_
147 #define MPP_GLOBAL_REDUCE_5D_ mpp_global_max_i4_5d
148 #undef MPP_TYPE_
149 #define MPP_TYPE_ integer(INT_KIND)
150 #undef REDUCE_VAL_
151 #define REDUCE_VAL_ maxval
152 #undef REDUCE_LOC_
153 #define REDUCE_LOC_ maxloc
154 #undef MPP_REDUCE_
155 #define MPP_REDUCE_ mpp_max
156 #include <mpp_global_reduce.h>
157 
158 #undef MPP_GLOBAL_REDUCE_2D_
159 #define MPP_GLOBAL_REDUCE_2D_ mpp_global_min_i4_2d
160 #undef MPP_GLOBAL_REDUCE_3D_
161 #define MPP_GLOBAL_REDUCE_3D_ mpp_global_min_i4_3d
162 #undef MPP_GLOBAL_REDUCE_4D_
163 #define MPP_GLOBAL_REDUCE_4D_ mpp_global_min_i4_4d
164 #undef MPP_GLOBAL_REDUCE_5D_
165 #define MPP_GLOBAL_REDUCE_5D_ mpp_global_min_i4_5d
166 #undef MPP_TYPE_
167 #define MPP_TYPE_ integer(INT_KIND)
168 #undef REDUCE_VAL_
169 #define REDUCE_VAL_ minval
170 #undef REDUCE_LOC_
171 #define REDUCE_LOC_ minloc
172 #undef MPP_REDUCE_
173 #define MPP_REDUCE_ mpp_min
174 #include <mpp_global_reduce.h>
175 
176 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
177 ! !
178 ! MPP_GLOBAL_SUM: global sum of field !
179 ! !
180 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
181 #define DO_EFP_SUM_
182 #undef MPP_GLOBAL_SUM_
183 #define MPP_GLOBAL_SUM_ mpp_global_sum_r8_2d
184 #undef MPP_EXTRA_INDICES_
185 #define MPP_EXTRA_INDICES_
186 #undef MPP_TYPE_
187 #define MPP_TYPE_ real(DOUBLE_KIND)
188 #include <mpp_global_sum.h>
189 
190 #undef MPP_GLOBAL_SUM_
191 #define MPP_GLOBAL_SUM_ mpp_global_sum_r8_3d
192 #undef MPP_EXTRA_INDICES_
193 #define MPP_EXTRA_INDICES_ ,:
194 #undef MPP_TYPE_
195 #define MPP_TYPE_ real(DOUBLE_KIND)
196 #include <mpp_global_sum.h>
197 
198 #undef MPP_GLOBAL_SUM_
199 #define MPP_GLOBAL_SUM_ mpp_global_sum_r8_4d
200 #undef MPP_EXTRA_INDICES_
201 #define MPP_EXTRA_INDICES_ ,:,:
202 #undef MPP_TYPE_
203 #define MPP_TYPE_ real(DOUBLE_KIND)
204 #include <mpp_global_sum.h>
205 
206 #undef MPP_GLOBAL_SUM_
207 #define MPP_GLOBAL_SUM_ mpp_global_sum_r8_5d
208 #undef MPP_EXTRA_INDICES_
209 #define MPP_EXTRA_INDICES_ ,:,:,:
210 #undef MPP_TYPE_
211 #define MPP_TYPE_ real(DOUBLE_KIND)
212 #include <mpp_global_sum.h>
213 
214 #ifdef OVERLOAD_R4
215 #undef MPP_GLOBAL_SUM_
216 #define MPP_GLOBAL_SUM_ mpp_global_sum_r4_2d
217 #undef MPP_EXTRA_INDICES_
218 #define MPP_EXTRA_INDICES_
219 #undef MPP_TYPE_
220 #define MPP_TYPE_ real(FLOAT_KIND)
221 #include <mpp_global_sum.h>
222 
223 #undef MPP_GLOBAL_SUM_
224 #define MPP_GLOBAL_SUM_ mpp_global_sum_r4_3d
225 #undef MPP_EXTRA_INDICES_
226 #define MPP_EXTRA_INDICES_ ,:
227 #undef MPP_TYPE_
228 #define MPP_TYPE_ real(FLOAT_KIND)
229 #include <mpp_global_sum.h>
230 
231 #undef MPP_GLOBAL_SUM_
232 #define MPP_GLOBAL_SUM_ mpp_global_sum_r4_4d
233 #undef MPP_EXTRA_INDICES_
234 #define MPP_EXTRA_INDICES_ ,:,:
235 #undef MPP_TYPE_
236 #define MPP_TYPE_ real(FLOAT_KIND)
237 #include <mpp_global_sum.h>
238 
239 #undef MPP_GLOBAL_SUM_
240 #define MPP_GLOBAL_SUM_ mpp_global_sum_r4_5d
241 #undef MPP_EXTRA_INDICES_
242 #define MPP_EXTRA_INDICES_ ,:,:,:
243 #undef MPP_TYPE_
244 #define MPP_TYPE_ real(FLOAT_KIND)
245 #include <mpp_global_sum.h>
246 #endif
247 
248 #undef DO_EFP_SUM_
249 #ifndef no_8byte_integers
250 #undef MPP_GLOBAL_SUM_
251 #define MPP_GLOBAL_SUM_ mpp_global_sum_i8_2d
252 #undef MPP_EXTRA_INDICES_
253 #define MPP_EXTRA_INDICES_
254 #undef MPP_TYPE_
255 #define MPP_TYPE_ integer(LONG_KIND)
256 #include <mpp_global_sum.h>
257 
258 #undef MPP_GLOBAL_SUM_
259 #define MPP_GLOBAL_SUM_ mpp_global_sum_i8_3d
260 #undef MPP_EXTRA_INDICES_
261 #define MPP_EXTRA_INDICES_ ,:
262 #undef MPP_TYPE_
263 #define MPP_TYPE_ integer(LONG_KIND)
264 #include <mpp_global_sum.h>
265 
266 #undef MPP_GLOBAL_SUM_
267 #define MPP_GLOBAL_SUM_ mpp_global_sum_i8_4d
268 #undef MPP_EXTRA_INDICES_
269 #define MPP_EXTRA_INDICES_ ,:,:
270 #undef MPP_TYPE_
271 #define MPP_TYPE_ integer(LONG_KIND)
272 #include <mpp_global_sum.h>
273 
274 #undef MPP_GLOBAL_SUM_
275 #define MPP_GLOBAL_SUM_ mpp_global_sum_i8_5d
276 #undef MPP_EXTRA_INDICES_
277 #define MPP_EXTRA_INDICES_ ,:,:,:
278 #undef MPP_TYPE_
279 #define MPP_TYPE_ integer(LONG_KIND)
280 #include <mpp_global_sum.h>
281 #endif
282 
283 #undef MPP_GLOBAL_SUM_
284 #define MPP_GLOBAL_SUM_ mpp_global_sum_i4_2d
285 #undef MPP_EXTRA_INDICES_
286 #define MPP_EXTRA_INDICES_
287 #undef MPP_TYPE_
288 #define MPP_TYPE_ integer(INT_KIND)
289 #include <mpp_global_sum.h>
290 
291 #undef MPP_GLOBAL_SUM_
292 #define MPP_GLOBAL_SUM_ mpp_global_sum_i4_3d
293 #undef MPP_EXTRA_INDICES_
294 #define MPP_EXTRA_INDICES_ ,:
295 #undef MPP_TYPE_
296 #define MPP_TYPE_ integer(INT_KIND)
297 #include <mpp_global_sum.h>
298 
299 #undef MPP_GLOBAL_SUM_
300 #define MPP_GLOBAL_SUM_ mpp_global_sum_i4_4d
301 #undef MPP_EXTRA_INDICES_
302 #define MPP_EXTRA_INDICES_ ,:,:
303 #undef MPP_TYPE_
304 #define MPP_TYPE_ integer(INT_KIND)
305 #include <mpp_global_sum.h>
306 
307 #undef MPP_GLOBAL_SUM_
308 #define MPP_GLOBAL_SUM_ mpp_global_sum_i4_5d
309 #undef MPP_EXTRA_INDICES_
310 #define MPP_EXTRA_INDICES_ ,:,:,:
311 #undef MPP_TYPE_
312 #define MPP_TYPE_ integer(INT_KIND)
313 #include <mpp_global_sum.h>
314 
315 
316 !gag
317 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
318 ! !
319 ! MPP_GLOBAL_SUM_TL: global sum of forward and tangent-linear fields !
320 ! !
321 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
322 
323 #undef MPP_GLOBAL_SUM_TL_
324 #define MPP_GLOBAL_SUM_TL_ mpp_global_sum_tl_r8_2d
325 #undef MPP_EXTRA_INDICES_
326 #define MPP_EXTRA_INDICES_
327 #undef MPP_TYPE_
328 #define MPP_TYPE_ real(DOUBLE_KIND)
329 #include <mpp_global_sum_tl.h>
330 
331 #undef MPP_GLOBAL_SUM_TL_
332 #define MPP_GLOBAL_SUM_TL_ mpp_global_sum_tl_r8_3d
333 #undef MPP_EXTRA_INDICES_
334 #define MPP_EXTRA_INDICES_ ,:
335 #undef MPP_TYPE_
336 #define MPP_TYPE_ real(DOUBLE_KIND)
337 #include <mpp_global_sum_tl.h>
338 
339 #undef MPP_GLOBAL_SUM_TL_
340 #define MPP_GLOBAL_SUM_TL_ mpp_global_sum_tl_r8_4d
341 #undef MPP_EXTRA_INDICES_
342 #define MPP_EXTRA_INDICES_ ,:,:
343 #undef MPP_TYPE_
344 #define MPP_TYPE_ real(DOUBLE_KIND)
345 #include <mpp_global_sum_tl.h>
346 
347 #undef MPP_GLOBAL_SUM_TL_
348 #define MPP_GLOBAL_SUM_TL_ mpp_global_sum_tl_r8_5d
349 #undef MPP_EXTRA_INDICES_
350 #define MPP_EXTRA_INDICES_ ,:,:,:
351 #undef MPP_TYPE_
352 #define MPP_TYPE_ real(DOUBLE_KIND)
353 #include <mpp_global_sum_tl.h>
354 
355 #ifdef OVERLOAD_C8
356 #undef MPP_GLOBAL_SUM_TL_
357 #define MPP_GLOBAL_SUM_TL_ mpp_global_sum_tl_c8_2d
358 #undef MPP_EXTRA_INDICES_
359 #define MPP_EXTRA_INDICES_
360 #undef MPP_TYPE_
361 #define MPP_TYPE_ complex(DOUBLE_KIND)
362 #include <mpp_global_sum_tl.h>
363 
364 #undef MPP_GLOBAL_SUM_TL_
365 #define MPP_GLOBAL_SUM_TL_ mpp_global_sum_tl_c8_3d
366 #undef MPP_EXTRA_INDICES_
367 #define MPP_EXTRA_INDICES_ ,:
368 #undef MPP_TYPE_
369 #define MPP_TYPE_ complex(DOUBLE_KIND)
370 #include <mpp_global_sum_tl.h>
371 
372 #undef MPP_GLOBAL_SUM_TL_
373 #define MPP_GLOBAL_SUM_TL_ mpp_global_sum_tl_c8_4d
374 #undef MPP_EXTRA_INDICES_
375 #define MPP_EXTRA_INDICES_ ,:,:
376 #undef MPP_TYPE_
377 #define MPP_TYPE_ complex(DOUBLE_KIND)
378 #include <mpp_global_sum_tl.h>
379 
380 #undef MPP_GLOBAL_SUM_TL_
381 #define MPP_GLOBAL_SUM_TL_ mpp_global_sum_tl_c8_5d
382 #undef MPP_EXTRA_INDICES_
383 #define MPP_EXTRA_INDICES_ ,:,:,:
384 #undef MPP_TYPE_
385 #define MPP_TYPE_ complex(DOUBLE_KIND)
386 #include <mpp_global_sum_tl.h>
387 #endif
388 
389 #ifdef OVERLOAD_R4
390 #undef MPP_GLOBAL_SUM_TL_
391 #define MPP_GLOBAL_SUM_TL_ mpp_global_sum_tl_r4_2d
392 #undef MPP_EXTRA_INDICES_
393 #define MPP_EXTRA_INDICES_
394 #undef MPP_TYPE_
395 #define MPP_TYPE_ real(FLOAT_KIND)
396 #include <mpp_global_sum_tl.h>
397 
398 #undef MPP_GLOBAL_SUM_TL_
399 #define MPP_GLOBAL_SUM_TL_ mpp_global_sum_tl_r4_3d
400 #undef MPP_EXTRA_INDICES_
401 #define MPP_EXTRA_INDICES_ ,:
402 #undef MPP_TYPE_
403 #define MPP_TYPE_ real(FLOAT_KIND)
404 #include <mpp_global_sum_tl.h>
405 
406 #undef MPP_GLOBAL_SUM_TL_
407 #define MPP_GLOBAL_SUM_TL_ mpp_global_sum_tl_r4_4d
408 #undef MPP_EXTRA_INDICES_
409 #define MPP_EXTRA_INDICES_ ,:,:
410 #undef MPP_TYPE_
411 #define MPP_TYPE_ real(FLOAT_KIND)
412 #include <mpp_global_sum_tl.h>
413 
414 #undef MPP_GLOBAL_SUM_TL_
415 #define MPP_GLOBAL_SUM_TL_ mpp_global_sum_tl_r4_5d
416 #undef MPP_EXTRA_INDICES_
417 #define MPP_EXTRA_INDICES_ ,:,:,:
418 #undef MPP_TYPE_
419 #define MPP_TYPE_ real(FLOAT_KIND)
420 #include <mpp_global_sum_tl.h>
421 #endif
422 
423 #ifdef OVERLOAD_C4
424 #undef MPP_GLOBAL_SUM_TL_
425 #define MPP_GLOBAL_SUM_TL_ mpp_global_sum_tl_c4_2d
426 #undef MPP_EXTRA_INDICES_
427 #define MPP_EXTRA_INDICES_
428 #undef MPP_TYPE_
429 #define MPP_TYPE_ complex(FLOAT_KIND)
430 #include <mpp_global_sum_tl.h>
431 
432 #undef MPP_GLOBAL_SUM_TL_
433 #define MPP_GLOBAL_SUM_TL_ mpp_global_sum_tl_c4_3d
434 #undef MPP_EXTRA_INDICES_
435 #define MPP_EXTRA_INDICES_ ,:
436 #undef MPP_TYPE_
437 #define MPP_TYPE_ complex(FLOAT_KIND)
438 #include <mpp_global_sum_tl.h>
439 
440 #undef MPP_GLOBAL_SUM_TL_
441 #define MPP_GLOBAL_SUM_TL_ mpp_global_sum_tl_c4_4d
442 #undef MPP_EXTRA_INDICES_
443 #define MPP_EXTRA_INDICES_ ,:,:
444 #undef MPP_TYPE_
445 #define MPP_TYPE_ complex(FLOAT_KIND)
446 #include <mpp_global_sum_tl.h>
447 
448 #undef MPP_GLOBAL_SUM_TL_
449 #define MPP_GLOBAL_SUM_TL_ mpp_global_sum_tl_c4_5d
450 #undef MPP_EXTRA_INDICES_
451 #define MPP_EXTRA_INDICES_ ,:,:,:
452 #undef MPP_TYPE_
453 #define MPP_TYPE_ complex(FLOAT_KIND)
454 #include <mpp_global_sum_tl.h>
455 #endif
456 
457 #ifndef no_8byte_integers
458 #undef MPP_GLOBAL_SUM_TL_
459 #define MPP_GLOBAL_SUM_TL_ mpp_global_sum_tl_i8_2d
460 #undef MPP_EXTRA_INDICES_
461 #define MPP_EXTRA_INDICES_
462 #undef MPP_TYPE_
463 #define MPP_TYPE_ integer(LONG_KIND)
464 #include <mpp_global_sum_tl.h>
465 
466 #undef MPP_GLOBAL_SUM_TL_
467 #define MPP_GLOBAL_SUM_TL_ mpp_global_sum_tl_i8_3d
468 #undef MPP_EXTRA_INDICES_
469 #define MPP_EXTRA_INDICES_ ,:
470 #undef MPP_TYPE_
471 #define MPP_TYPE_ integer(LONG_KIND)
472 #include <mpp_global_sum_tl.h>
473 
474 #undef MPP_GLOBAL_SUM_TL_
475 #define MPP_GLOBAL_SUM_TL_ mpp_global_sum_tl_i8_4d
476 #undef MPP_EXTRA_INDICES_
477 #define MPP_EXTRA_INDICES_ ,:,:
478 #undef MPP_TYPE_
479 #define MPP_TYPE_ integer(LONG_KIND)
480 #include <mpp_global_sum_tl.h>
481 
482 #undef MPP_GLOBAL_SUM_TL_
483 #define MPP_GLOBAL_SUM_TL_ mpp_global_sum_tl_i8_5d
484 #undef MPP_EXTRA_INDICES_
485 #define MPP_EXTRA_INDICES_ ,:,:,:
486 #undef MPP_TYPE_
487 #define MPP_TYPE_ integer(LONG_KIND)
488 #include <mpp_global_sum_tl.h>
489 #endif
490 
491 #undef MPP_GLOBAL_SUM_TL_
492 #define MPP_GLOBAL_SUM_TL_ mpp_global_sum_tl_i4_2d
493 #undef MPP_EXTRA_INDICES_
494 #define MPP_EXTRA_INDICES_
495 #undef MPP_TYPE_
496 #define MPP_TYPE_ integer(INT_KIND)
497 #include <mpp_global_sum_tl.h>
498 
499 #undef MPP_GLOBAL_SUM_TL_
500 #define MPP_GLOBAL_SUM_TL_ mpp_global_sum_tl_i4_3d
501 #undef MPP_EXTRA_INDICES_
502 #define MPP_EXTRA_INDICES_ ,:
503 #undef MPP_TYPE_
504 #define MPP_TYPE_ integer(INT_KIND)
505 #include <mpp_global_sum_tl.h>
506 
507 #undef MPP_GLOBAL_SUM_TL_
508 #define MPP_GLOBAL_SUM_TL_ mpp_global_sum_tl_i4_4d
509 #undef MPP_EXTRA_INDICES_
510 #define MPP_EXTRA_INDICES_ ,:,:
511 #undef MPP_TYPE_
512 #define MPP_TYPE_ integer(INT_KIND)
513 #include <mpp_global_sum_tl.h>
514 
515 #undef MPP_GLOBAL_SUM_TL_
516 #define MPP_GLOBAL_SUM_TL_ mpp_global_sum_tl_i4_5d
517 #undef MPP_EXTRA_INDICES_
518 #define MPP_EXTRA_INDICES_ ,:,:,:
519 #undef MPP_TYPE_
520 #define MPP_TYPE_ integer(INT_KIND)
521 #include <mpp_global_sum_tl.h>
522 !gag
523 
524 !bnc
525 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
526 ! !
527 ! MPP_GLOBAL_SUM_AD: global adjoint sum of field !
528 ! !
529 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
530 
531 #undef MPP_GLOBAL_SUM_AD_
532 #define MPP_GLOBAL_SUM_AD_ mpp_global_sum_ad_r8_2d
533 #undef MPP_EXTRA_INDICES_
534 #define MPP_EXTRA_INDICES_
535 #undef MPP_TYPE_
536 #define MPP_TYPE_ real(DOUBLE_KIND)
537 #include <mpp_global_sum_ad.h>
538 
539 #undef MPP_GLOBAL_SUM_AD_
540 #define MPP_GLOBAL_SUM_AD_ mpp_global_sum_ad_r8_3d
541 #undef MPP_EXTRA_INDICES_
542 #define MPP_EXTRA_INDICES_ ,:
543 #undef MPP_TYPE_
544 #define MPP_TYPE_ real(DOUBLE_KIND)
545 #include <mpp_global_sum_ad.h>
546 
547 #undef MPP_GLOBAL_SUM_AD_
548 #define MPP_GLOBAL_SUM_AD_ mpp_global_sum_ad_r8_4d
549 #undef MPP_EXTRA_INDICES_
550 #define MPP_EXTRA_INDICES_ ,:,:
551 #undef MPP_TYPE_
552 #define MPP_TYPE_ real(DOUBLE_KIND)
553 #include <mpp_global_sum_ad.h>
554 
555 #undef MPP_GLOBAL_SUM_AD_
556 #define MPP_GLOBAL_SUM_AD_ mpp_global_sum_ad_r8_5d
557 #undef MPP_EXTRA_INDICES_
558 #define MPP_EXTRA_INDICES_ ,:,:,:
559 #undef MPP_TYPE_
560 #define MPP_TYPE_ real(DOUBLE_KIND)
561 #include <mpp_global_sum_ad.h>
562 
563 #ifdef OVERLOAD_C8
564 #undef MPP_GLOBAL_SUM_AD_
565 #define MPP_GLOBAL_SUM_AD_ mpp_global_sum_ad_c8_2d
566 #undef MPP_EXTRA_INDICES_
567 #define MPP_EXTRA_INDICES_
568 #undef MPP_TYPE_
569 #define MPP_TYPE_ complex(DOUBLE_KIND)
570 #include <mpp_global_sum_ad.h>
571 
572 #undef MPP_GLOBAL_SUM_AD_
573 #define MPP_GLOBAL_SUM_AD_ mpp_global_sum_ad_c8_3d
574 #undef MPP_EXTRA_INDICES_
575 #define MPP_EXTRA_INDICES_ ,:
576 #undef MPP_TYPE_
577 #define MPP_TYPE_ complex(DOUBLE_KIND)
578 #include <mpp_global_sum_ad.h>
579 
580 #undef MPP_GLOBAL_SUM_AD_
581 #define MPP_GLOBAL_SUM_AD_ mpp_global_sum_ad_c8_4d
582 #undef MPP_EXTRA_INDICES_
583 #define MPP_EXTRA_INDICES_ ,:,:
584 #undef MPP_TYPE_
585 #define MPP_TYPE_ complex(DOUBLE_KIND)
586 #include <mpp_global_sum_ad.h>
587 
588 #undef MPP_GLOBAL_SUM_AD_
589 #define MPP_GLOBAL_SUM_AD_ mpp_global_sum_ad_c8_5d
590 #undef MPP_EXTRA_INDICES_
591 #define MPP_EXTRA_INDICES_ ,:,:,:
592 #undef MPP_TYPE_
593 #define MPP_TYPE_ complex(DOUBLE_KIND)
594 #include <mpp_global_sum_ad.h>
595 #endif
596 
597 #ifdef OVERLOAD_R4
598 #undef MPP_GLOBAL_SUM_AD_
599 #define MPP_GLOBAL_SUM_AD_ mpp_global_sum_ad_r4_2d
600 #undef MPP_EXTRA_INDICES_
601 #define MPP_EXTRA_INDICES_
602 #undef MPP_TYPE_
603 #define MPP_TYPE_ real(FLOAT_KIND)
604 #include <mpp_global_sum_ad.h>
605 
606 #undef MPP_GLOBAL_SUM_AD_
607 #define MPP_GLOBAL_SUM_AD_ mpp_global_sum_ad_r4_3d
608 #undef MPP_EXTRA_INDICES_
609 #define MPP_EXTRA_INDICES_ ,:
610 #undef MPP_TYPE_
611 #define MPP_TYPE_ real(FLOAT_KIND)
612 #include <mpp_global_sum_ad.h>
613 
614 #undef MPP_GLOBAL_SUM_AD_
615 #define MPP_GLOBAL_SUM_AD_ mpp_global_sum_ad_r4_4d
616 #undef MPP_EXTRA_INDICES_
617 #define MPP_EXTRA_INDICES_ ,:,:
618 #undef MPP_TYPE_
619 #define MPP_TYPE_ real(FLOAT_KIND)
620 #include <mpp_global_sum_ad.h>
621 
622 #undef MPP_GLOBAL_SUM_AD_
623 #define MPP_GLOBAL_SUM_AD_ mpp_global_sum_ad_r4_5d
624 #undef MPP_EXTRA_INDICES_
625 #define MPP_EXTRA_INDICES_ ,:,:,:
626 #undef MPP_TYPE_
627 #define MPP_TYPE_ real(FLOAT_KIND)
628 #include <mpp_global_sum_ad.h>
629 #endif
630 
631 #ifdef OVERLOAD_C4
632 #undef MPP_GLOBAL_SUM_AD_
633 #define MPP_GLOBAL_SUM_AD_ mpp_global_sum_ad_c4_2d
634 #undef MPP_EXTRA_INDICES_
635 #define MPP_EXTRA_INDICES_
636 #undef MPP_TYPE_
637 #define MPP_TYPE_ complex(FLOAT_KIND)
638 #include <mpp_global_sum_ad.h>
639 
640 #undef MPP_GLOBAL_SUM_AD_
641 #define MPP_GLOBAL_SUM_AD_ mpp_global_sum_ad_c4_3d
642 #undef MPP_EXTRA_INDICES_
643 #define MPP_EXTRA_INDICES_ ,:
644 #undef MPP_TYPE_
645 #define MPP_TYPE_ complex(FLOAT_KIND)
646 #include <mpp_global_sum_ad.h>
647 
648 #undef MPP_GLOBAL_SUM_AD_
649 #define MPP_GLOBAL_SUM_AD_ mpp_global_sum_ad_c4_4d
650 #undef MPP_EXTRA_INDICES_
651 #define MPP_EXTRA_INDICES_ ,:,:
652 #undef MPP_TYPE_
653 #define MPP_TYPE_ complex(FLOAT_KIND)
654 #include <mpp_global_sum_ad.h>
655 
656 #undef MPP_GLOBAL_SUM_AD_
657 #define MPP_GLOBAL_SUM_AD_ mpp_global_sum_ad_c4_5d
658 #undef MPP_EXTRA_INDICES_
659 #define MPP_EXTRA_INDICES_ ,:,:,:
660 #undef MPP_TYPE_
661 #define MPP_TYPE_ complex(FLOAT_KIND)
662 #include <mpp_global_sum_ad.h>
663 #endif
664 
665 #ifndef no_8byte_integers
666 #undef MPP_GLOBAL_SUM_AD_
667 #define MPP_GLOBAL_SUM_AD_ mpp_global_sum_ad_i8_2d
668 #undef MPP_EXTRA_INDICES_
669 #define MPP_EXTRA_INDICES_
670 #undef MPP_TYPE_
671 #define MPP_TYPE_ integer(LONG_KIND)
672 #include <mpp_global_sum_ad.h>
673 
674 #undef MPP_GLOBAL_SUM_AD_
675 #define MPP_GLOBAL_SUM_AD_ mpp_global_sum_ad_i8_3d
676 #undef MPP_EXTRA_INDICES_
677 #define MPP_EXTRA_INDICES_ ,:
678 #undef MPP_TYPE_
679 #define MPP_TYPE_ integer(LONG_KIND)
680 #include <mpp_global_sum_ad.h>
681 
682 #undef MPP_GLOBAL_SUM_AD_
683 #define MPP_GLOBAL_SUM_AD_ mpp_global_sum_ad_i8_4d
684 #undef MPP_EXTRA_INDICES_
685 #define MPP_EXTRA_INDICES_ ,:,:
686 #undef MPP_TYPE_
687 #define MPP_TYPE_ integer(LONG_KIND)
688 #include <mpp_global_sum_ad.h>
689 
690 #undef MPP_GLOBAL_SUM_AD_
691 #define MPP_GLOBAL_SUM_AD_ mpp_global_sum_ad_i8_5d
692 #undef MPP_EXTRA_INDICES_
693 #define MPP_EXTRA_INDICES_ ,:,:,:
694 #undef MPP_TYPE_
695 #define MPP_TYPE_ integer(LONG_KIND)
696 #include <mpp_global_sum_ad.h>
697 #endif
698 
699 #undef MPP_GLOBAL_SUM_AD_
700 #define MPP_GLOBAL_SUM_AD_ mpp_global_sum_ad_i4_2d
701 #undef MPP_EXTRA_INDICES_
702 #define MPP_EXTRA_INDICES_
703 #undef MPP_TYPE_
704 #define MPP_TYPE_ integer(INT_KIND)
705 #include <mpp_global_sum_ad.h>
706 
707 #undef MPP_GLOBAL_SUM_AD_
708 #define MPP_GLOBAL_SUM_AD_ mpp_global_sum_ad_i4_3d
709 #undef MPP_EXTRA_INDICES_
710 #define MPP_EXTRA_INDICES_ ,:
711 #undef MPP_TYPE_
712 #define MPP_TYPE_ integer(INT_KIND)
713 #include <mpp_global_sum_ad.h>
714 
715 #undef MPP_GLOBAL_SUM_AD_
716 #define MPP_GLOBAL_SUM_AD_ mpp_global_sum_ad_i4_4d
717 #undef MPP_EXTRA_INDICES_
718 #define MPP_EXTRA_INDICES_ ,:,:
719 #undef MPP_TYPE_
720 #define MPP_TYPE_ integer(INT_KIND)
721 #include <mpp_global_sum_ad.h>
722 
723 #undef MPP_GLOBAL_SUM_AD_
724 #define MPP_GLOBAL_SUM_AD_ mpp_global_sum_ad_i4_5d
725 #undef MPP_EXTRA_INDICES_
726 #define MPP_EXTRA_INDICES_ ,:,:,:
727 #undef MPP_TYPE_
728 #define MPP_TYPE_ integer(INT_KIND)
729 #include <mpp_global_sum_ad.h>
730 !bnc
731 
732 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
733 ! !
734 ! MPP_GLOBAL_FIELD: get global field from domain field !
735 ! !
736 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
737 
738 #undef MPP_GLOBAL_FIELD_2D_
739 #define MPP_GLOBAL_FIELD_2D_ mpp_global_field2D_r8_2d
740 #undef MPP_GLOBAL_FIELD_3D_
741 #define MPP_GLOBAL_FIELD_3D_ mpp_global_field2D_r8_3d
742 #undef MPP_GLOBAL_FIELD_4D_
743 #define MPP_GLOBAL_FIELD_4D_ mpp_global_field2D_r8_4d
744 #undef MPP_GLOBAL_FIELD_5D_
745 #define MPP_GLOBAL_FIELD_5D_ mpp_global_field2D_r8_5d
746 #undef MPP_TYPE_
747 #define MPP_TYPE_ real(DOUBLE_KIND)
748 #include <mpp_global_field.h>
749 
750 #ifdef OVERLOAD_C8
751 #undef MPP_GLOBAL_FIELD_2D_
752 #define MPP_GLOBAL_FIELD_2D_ mpp_global_field2D_c8_2d
753 #undef MPP_GLOBAL_FIELD_3D_
754 #define MPP_GLOBAL_FIELD_3D_ mpp_global_field2D_c8_3d
755 #undef MPP_GLOBAL_FIELD_4D_
756 #define MPP_GLOBAL_FIELD_4D_ mpp_global_field2D_c8_4d
757 #undef MPP_GLOBAL_FIELD_5D_
758 #define MPP_GLOBAL_FIELD_5D_ mpp_global_field2D_c8_5d
759 #undef MPP_TYPE_
760 #define MPP_TYPE_ complex(DOUBLE_KIND)
761 #include <mpp_global_field.h>
762 #endif
763 
764 #ifndef no_8byte_integers
765 #undef MPP_GLOBAL_FIELD_2D_
766 #define MPP_GLOBAL_FIELD_2D_ mpp_global_field2D_i8_2d
767 #undef MPP_GLOBAL_FIELD_3D_
768 #define MPP_GLOBAL_FIELD_3D_ mpp_global_field2D_i8_3d
769 #undef MPP_GLOBAL_FIELD_4D_
770 #define MPP_GLOBAL_FIELD_4D_ mpp_global_field2D_i8_4d
771 #undef MPP_GLOBAL_FIELD_5D_
772 #define MPP_GLOBAL_FIELD_5D_ mpp_global_field2D_i8_5d
773 #undef MPP_TYPE_
774 #define MPP_TYPE_ integer(LONG_KIND)
775 #include <mpp_global_field.h>
776 
777 #undef MPP_GLOBAL_FIELD_2D_
778 #define MPP_GLOBAL_FIELD_2D_ mpp_global_field2D_l8_2d
779 #undef MPP_GLOBAL_FIELD_3D_
780 #define MPP_GLOBAL_FIELD_3D_ mpp_global_field2D_l8_3d
781 #undef MPP_GLOBAL_FIELD_4D_
782 #define MPP_GLOBAL_FIELD_4D_ mpp_global_field2D_l8_4d
783 #undef MPP_GLOBAL_FIELD_5D_
784 #define MPP_GLOBAL_FIELD_5D_ mpp_global_field2D_l8_5d
785 #undef MPP_TYPE_
786 #define MPP_TYPE_ logical(LONG_KIND)
787 #include <mpp_global_field.h>
788 #endif
789 
790 #ifdef OVERLOAD_R4
791 #undef MPP_GLOBAL_FIELD_2D_
792 #define MPP_GLOBAL_FIELD_2D_ mpp_global_field2D_r4_2d
793 #undef MPP_GLOBAL_FIELD_3D_
794 #define MPP_GLOBAL_FIELD_3D_ mpp_global_field2D_r4_3d
795 #undef MPP_GLOBAL_FIELD_4D_
796 #define MPP_GLOBAL_FIELD_4D_ mpp_global_field2D_r4_4d
797 #undef MPP_GLOBAL_FIELD_5D_
798 #define MPP_GLOBAL_FIELD_5D_ mpp_global_field2D_r4_5d
799 #undef MPP_TYPE_
800 #define MPP_TYPE_ real(FLOAT_KIND)
801 #include <mpp_global_field.h>
802 #endif
803 
804 #ifdef OVERLOAD_C4
805 #undef MPP_GLOBAL_FIELD_2D_
806 #define MPP_GLOBAL_FIELD_2D_ mpp_global_field2D_c4_2d
807 #undef MPP_GLOBAL_FIELD_3D_
808 #define MPP_GLOBAL_FIELD_3D_ mpp_global_field2D_c4_3d
809 #undef MPP_GLOBAL_FIELD_4D_
810 #define MPP_GLOBAL_FIELD_4D_ mpp_global_field2D_c4_4d
811 #undef MPP_GLOBAL_FIELD_5D_
812 #define MPP_GLOBAL_FIELD_5D_ mpp_global_field2D_c4_5d
813 #undef MPP_TYPE_
814 #define MPP_TYPE_ complex(FLOAT_KIND)
815 #include <mpp_global_field.h>
816 #endif
817 
818 #undef MPP_GLOBAL_FIELD_2D_
819 #define MPP_GLOBAL_FIELD_2D_ mpp_global_field2D_i4_2d
820 #undef MPP_GLOBAL_FIELD_3D_
821 #define MPP_GLOBAL_FIELD_3D_ mpp_global_field2D_i4_3d
822 #undef MPP_GLOBAL_FIELD_4D_
823 #define MPP_GLOBAL_FIELD_4D_ mpp_global_field2D_i4_4d
824 #undef MPP_GLOBAL_FIELD_5D_
825 #define MPP_GLOBAL_FIELD_5D_ mpp_global_field2D_i4_5d
826 #undef MPP_TYPE_
827 #define MPP_TYPE_ integer(INT_KIND)
828 #include <mpp_global_field.h>
829 
830 #undef MPP_GLOBAL_FIELD_2D_
831 #define MPP_GLOBAL_FIELD_2D_ mpp_global_field2D_l4_2d
832 #undef MPP_GLOBAL_FIELD_3D_
833 #define MPP_GLOBAL_FIELD_3D_ mpp_global_field2D_l4_3d
834 #undef MPP_GLOBAL_FIELD_4D_
835 #define MPP_GLOBAL_FIELD_4D_ mpp_global_field2D_l4_4d
836 #undef MPP_GLOBAL_FIELD_5D_
837 #define MPP_GLOBAL_FIELD_5D_ mpp_global_field2D_l4_5d
838 #undef MPP_TYPE_
839 #define MPP_TYPE_ logical(INT_KIND)
840 #include <mpp_global_field.h>
841 
842 !****************************************************
843 #undef MPP_GLOBAL_FIELD_2D_AD_
844 #define MPP_GLOBAL_FIELD_2D_AD_ mpp_global_field2D_r8_2d_ad
845 #undef MPP_GLOBAL_FIELD_3D_AD_
846 #define MPP_GLOBAL_FIELD_3D_AD_ mpp_global_field2D_r8_3d_ad
847 #undef MPP_GLOBAL_FIELD_4D_AD_
848 #define MPP_GLOBAL_FIELD_4D_AD_ mpp_global_field2D_r8_4d_ad
849 #undef MPP_GLOBAL_FIELD_5D_AD_
850 #define MPP_GLOBAL_FIELD_5D_AD_ mpp_global_field2D_r8_5d_ad
851 #undef MPP_TYPE_
852 #define MPP_TYPE_ real(DOUBLE_KIND)
853 #include <mpp_global_field_ad.h>
854 
855 #ifdef OVERLOAD_C8
856 #undef MPP_GLOBAL_FIELD_2D_AD_
857 #define MPP_GLOBAL_FIELD_2D_AD_ mpp_global_field2D_c8_2d_ad
858 #undef MPP_GLOBAL_FIELD_3D_AD_
859 #define MPP_GLOBAL_FIELD_3D_AD_ mpp_global_field2D_c8_3d_ad
860 #undef MPP_GLOBAL_FIELD_4D_AD_
861 #define MPP_GLOBAL_FIELD_4D_AD_ mpp_global_field2D_c8_4d_ad
862 #undef MPP_GLOBAL_FIELD_5D_AD_
863 #define MPP_GLOBAL_FIELD_5D_AD_ mpp_global_field2D_c8_5d_ad
864 #undef MPP_TYPE_
865 #define MPP_TYPE_ complex(DOUBLE_KIND)
866 #include <mpp_global_field_ad.h>
867 #endif
868 
869 #ifndef no_8byte_integers
870 #undef MPP_GLOBAL_FIELD_2D_AD_
871 #define MPP_GLOBAL_FIELD_2D_AD_ mpp_global_field2D_i8_2d_ad
872 #undef MPP_GLOBAL_FIELD_3D_AD_
873 #define MPP_GLOBAL_FIELD_3D_AD_ mpp_global_field2D_i8_3d_ad
874 #undef MPP_GLOBAL_FIELD_4D_AD_
875 #define MPP_GLOBAL_FIELD_4D_AD_ mpp_global_field2D_i8_4d_ad
876 #undef MPP_GLOBAL_FIELD_5D_AD_
877 #define MPP_GLOBAL_FIELD_5D_AD_ mpp_global_field2D_i8_5d_ad
878 #undef MPP_TYPE_
879 #define MPP_TYPE_ integer(LONG_KIND)
880 #include <mpp_global_field_ad.h>
881 
882 #undef MPP_GLOBAL_FIELD_2D_AD_
883 #define MPP_GLOBAL_FIELD_2D_AD_ mpp_global_field2D_l8_2d_ad
884 #undef MPP_GLOBAL_FIELD_3D_AD_
885 #define MPP_GLOBAL_FIELD_3D_AD_ mpp_global_field2D_l8_3d_ad
886 #undef MPP_GLOBAL_FIELD_4D_AD_
887 #define MPP_GLOBAL_FIELD_4D_AD_ mpp_global_field2D_l8_4d_ad
888 #undef MPP_GLOBAL_FIELD_5D_AD_
889 #define MPP_GLOBAL_FIELD_5D_AD_ mpp_global_field2D_l8_5d_ad
890 #undef MPP_TYPE_
891 #define MPP_TYPE_ logical(LONG_KIND)
892 #include <mpp_global_field_ad.h>
893 #endif
894 
895 #ifdef OVERLOAD_R4
896 #undef MPP_GLOBAL_FIELD_2D_AD_
897 #define MPP_GLOBAL_FIELD_2D_AD_ mpp_global_field2D_r4_2d_ad
898 #undef MPP_GLOBAL_FIELD_3D_AD_
899 #define MPP_GLOBAL_FIELD_3D_AD_ mpp_global_field2D_r4_3d_ad
900 #undef MPP_GLOBAL_FIELD_4D_AD_
901 #define MPP_GLOBAL_FIELD_4D_AD_ mpp_global_field2D_r4_4d_ad
902 #undef MPP_GLOBAL_FIELD_5D_AD_
903 #define MPP_GLOBAL_FIELD_5D_AD_ mpp_global_field2D_r4_5d_ad
904 #undef MPP_TYPE_
905 #define MPP_TYPE_ real(FLOAT_KIND)
906 #include <mpp_global_field_ad.h>
907 #endif
908 
909 #ifdef OVERLOAD_C4
910 #undef MPP_GLOBAL_FIELD_2D_AD_
911 #define MPP_GLOBAL_FIELD_2D_AD_ mpp_global_field2D_c4_2d_ad
912 #undef MPP_GLOBAL_FIELD_3D_AD_
913 #define MPP_GLOBAL_FIELD_3D_AD_ mpp_global_field2D_c4_3d_ad
914 #undef MPP_GLOBAL_FIELD_4D_AD_
915 #define MPP_GLOBAL_FIELD_4D_AD_ mpp_global_field2D_c4_4d_ad
916 #undef MPP_GLOBAL_FIELD_5D_AD_
917 #define MPP_GLOBAL_FIELD_5D_AD_ mpp_global_field2D_c4_5d_ad
918 #undef MPP_TYPE_
919 #define MPP_TYPE_ complex(FLOAT_KIND)
920 #include <mpp_global_field_ad.h>
921 #endif
922 
923 #undef MPP_GLOBAL_FIELD_2D_AD_
924 #define MPP_GLOBAL_FIELD_2D_AD_ mpp_global_field2D_i4_2d_ad
925 #undef MPP_GLOBAL_FIELD_3D_AD_
926 #define MPP_GLOBAL_FIELD_3D_AD_ mpp_global_field2D_i4_3d_ad
927 #undef MPP_GLOBAL_FIELD_4D_AD_
928 #define MPP_GLOBAL_FIELD_4D_AD_ mpp_global_field2D_i4_4d_ad
929 #undef MPP_GLOBAL_FIELD_5D_AD_
930 #define MPP_GLOBAL_FIELD_5D_AD_ mpp_global_field2D_i4_5d_ad
931 #undef MPP_TYPE_
932 #define MPP_TYPE_ integer(INT_KIND)
933 #include <mpp_global_field_ad.h>
934 
935 #undef MPP_GLOBAL_FIELD_2D_AD_
936 #define MPP_GLOBAL_FIELD_2D_AD_ mpp_global_field2D_l4_2d_ad
937 #undef MPP_GLOBAL_FIELD_3D_AD_
938 #define MPP_GLOBAL_FIELD_3D_AD_ mpp_global_field2D_l4_3d_ad
939 #undef MPP_GLOBAL_FIELD_4D_AD_
940 #define MPP_GLOBAL_FIELD_4D_AD_ mpp_global_field2D_l4_4d_ad
941 #undef MPP_GLOBAL_FIELD_5D_AD_
942 #define MPP_GLOBAL_FIELD_5D_AD_ mpp_global_field2D_l4_5d_ad
943 #undef MPP_TYPE_
944 #define MPP_TYPE_ logical(INT_KIND)
945 #include <mpp_global_field_ad.h>
946 
947 !****************************************************
948 #undef MPP_DO_GLOBAL_FIELD_3D_
949 #define MPP_DO_GLOBAL_FIELD_3D_ mpp_do_global_field2D_r8_3d
950 #define MPP_DO_GLOBAL_FIELD_A2A_3D_ mpp_do_global_field2D_a2a_r8_3d
951 #undef MPP_TYPE_
952 #define MPP_TYPE_ real(DOUBLE_KIND)
953 #include <mpp_do_global_field.h>
954 
955 #ifdef OVERLOAD_C8
956 #undef MPP_DO_GLOBAL_FIELD_3D_
957 #define MPP_DO_GLOBAL_FIELD_3D_ mpp_do_global_field2D_c8_3d
958 #define MPP_DO_GLOBAL_FIELD_A2A_3D_ mpp_do_global_field2D_a2a_c8_3d
959 #undef MPP_TYPE_
960 #define MPP_TYPE_ complex(DOUBLE_KIND)
961 #include <mpp_do_global_field.h>
962 #endif
963 
964 #ifndef no_8byte_integers
965 #undef MPP_DO_GLOBAL_FIELD_3D_
966 #define MPP_DO_GLOBAL_FIELD_3D_ mpp_do_global_field2D_i8_3d
967 #define MPP_DO_GLOBAL_FIELD_A2A_3D_ mpp_do_global_field2D_a2a_i8_3d
968 #undef MPP_TYPE_
969 #define MPP_TYPE_ integer(LONG_KIND)
970 #include <mpp_do_global_field.h>
971 
972 #undef MPP_DO_GLOBAL_FIELD_3D_
973 #define MPP_DO_GLOBAL_FIELD_3D_ mpp_do_global_field2D_l8_3d
974 #define MPP_DO_GLOBAL_FIELD_A2A_3D_ mpp_do_global_field2D_a2a_l8_3d
975 #define LOGICAL_VARIABLE
976 #undef MPP_TYPE_
977 #define MPP_TYPE_ logical(LONG_KIND)
978 #include <mpp_do_global_field.h>
979 #undef LOGICAL_VARIABLE
980 #endif
981 
982 #ifdef OVERLOAD_R4
983 #undef MPP_DO_GLOBAL_FIELD_3D_
984 #define MPP_DO_GLOBAL_FIELD_3D_ mpp_do_global_field2D_r4_3d
985 #define MPP_DO_GLOBAL_FIELD_A2A_3D_ mpp_do_global_field2D_a2a_r4_3d
986 #undef MPP_TYPE_
987 #define MPP_TYPE_ real(FLOAT_KIND)
988 #include <mpp_do_global_field.h>
989 #endif
990 
991 #ifdef OVERLOAD_C4
992 #undef MPP_DO_GLOBAL_FIELD_3D_
993 #define MPP_DO_GLOBAL_FIELD_3D_ mpp_do_global_field2D_c4_3d
994 #define MPP_DO_GLOBAL_FIELD_A2A_3D_ mpp_do_global_field2D_a2a_c4_3d
995 #undef MPP_TYPE_
996 #define MPP_TYPE_ complex(FLOAT_KIND)
997 #include <mpp_do_global_field.h>
998 #endif
999 
1000 #undef MPP_DO_GLOBAL_FIELD_3D_
1001 #define MPP_DO_GLOBAL_FIELD_3D_ mpp_do_global_field2D_i4_3d
1002 #define MPP_DO_GLOBAL_FIELD_A2A_3D_ mpp_do_global_field2D_a2a_i4_3d
1003 #undef MPP_TYPE_
1004 #define MPP_TYPE_ integer(INT_KIND)
1005 #include <mpp_do_global_field.h>
1006 
1007 #undef MPP_DO_GLOBAL_FIELD_3D_
1008 #define MPP_DO_GLOBAL_FIELD_3D_ mpp_do_global_field2D_l4_3d
1009 #define MPP_DO_GLOBAL_FIELD_A2A_3D_ mpp_do_global_field2D_a2a_l4_3d
1010 #define LOGICAL_VARIABLE
1011 #undef MPP_TYPE_
1012 #define MPP_TYPE_ logical(INT_KIND)
1013 #include <mpp_do_global_field.h>
1014 #undef LOGICAL_VARIABLE
1015 !****************************************************
1016 #undef MPP_DO_GLOBAL_FIELD_3D_AD_
1017 #define MPP_DO_GLOBAL_FIELD_3D_AD_ mpp_do_global_field2D_r8_3d_ad
1018 #undef MPP_TYPE_
1019 #define MPP_TYPE_ real(DOUBLE_KIND)
1020 #include <mpp_do_global_field_ad.h>
1021 
1022 #ifdef OVERLOAD_C8
1023 #undef MPP_DO_GLOBAL_FIELD_3D_AD_
1024 #define MPP_DO_GLOBAL_FIELD_3D_AD_ mpp_do_global_field2D_c8_3d_ad
1025 #undef MPP_TYPE_
1026 #define MPP_TYPE_ complex(DOUBLE_KIND)
1027 #include <mpp_do_global_field_ad.h>
1028 #endif
1029 
1030 #ifndef no_8byte_integers
1031 #undef MPP_DO_GLOBAL_FIELD_3D_AD_
1032 #define MPP_DO_GLOBAL_FIELD_3D_AD_ mpp_do_global_field2D_i8_3d_ad
1033 #undef MPP_TYPE_
1034 #define MPP_TYPE_ integer(LONG_KIND)
1035 #include <mpp_do_global_field_ad.h>
1036 
1037 #undef MPP_DO_GLOBAL_FIELD_3D_AD_
1038 #define MPP_DO_GLOBAL_FIELD_3D_AD_ mpp_do_global_field2D_l8_3d_ad
1039 #define LOGICAL_VARIABLE
1040 #undef MPP_TYPE_
1041 #define MPP_TYPE_ logical(LONG_KIND)
1042 #include <mpp_do_global_field_ad.h>
1043 #undef LOGICAL_VARIABLE
1044 #endif
1045 
1046 #ifdef OVERLOAD_R4
1047 #undef MPP_DO_GLOBAL_FIELD_3D_AD_
1048 #define MPP_DO_GLOBAL_FIELD_3D_AD_ mpp_do_global_field2D_r4_3d_ad
1049 #undef MPP_TYPE_
1050 #define MPP_TYPE_ real(FLOAT_KIND)
1051 #include <mpp_do_global_field_ad.h>
1052 #endif
1053 
1054 #ifdef OVERLOAD_C4
1055 #undef MPP_DO_GLOBAL_FIELD_3D_AD_
1056 #define MPP_DO_GLOBAL_FIELD_3D_AD_ mpp_do_global_field2D_c4_3d_ad
1057 #undef MPP_TYPE_
1058 #define MPP_TYPE_ complex(FLOAT_KIND)
1059 #include <mpp_do_global_field_ad.h>
1060 #endif
1061 
1062 #undef MPP_DO_GLOBAL_FIELD_3D_AD_
1063 #define MPP_DO_GLOBAL_FIELD_3D_AD_ mpp_do_global_field2D_i4_3d_ad
1064 #undef MPP_TYPE_
1065 #define MPP_TYPE_ integer(INT_KIND)
1066 #include <mpp_do_global_field_ad.h>
1067 
1068 #undef MPP_DO_GLOBAL_FIELD_3D_AD_
1069 #define MPP_DO_GLOBAL_FIELD_3D_AD_ mpp_do_global_field2D_l4_3d_ad
1070 #define LOGICAL_VARIABLE
1071 #undef MPP_TYPE_
1072 #define MPP_TYPE_ logical(INT_KIND)
1073 #include <mpp_do_global_field_ad.h>
1074 #undef LOGICAL_VARIABLE
1075 
************************************************************************GNU Lesser General Public License **This file is part of the GFDL Flexible Modeling System(FMS). ! *! *FMS is free software without even the implied warranty of MERCHANTABILITY or *FITNESS FOR A PARTICULAR PURPOSE See the GNU General Public License *for more details **You should have received a copy of the GNU Lesser General Public *License along with FMS If see< http:! ***********************************************************************!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! MPP_TRANSMIT !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine MPP_TRANSMIT_(put_data, put_len, to_pe, get_data, get_len, from_pe, block, tag, recv_request, send_request)!a message-passing routine intended to be reminiscent equally of both MPI and SHMEM!put_data and get_data are contiguous MPP_TYPE_ arrays!at each call, your put_data array is put to to_pe 's get_data! your get_data array is got from from_pe 's put_data!i.e we assume that typically(e.g updating halo regions) each PE performs a put _and_ a get!special PE designations:! NULL_PE:to disable a put or a get(e.g at boundaries)! ANY_PE:if remote PE for the put or get is to be unspecific! ALL_PES:broadcast and collect operations(collect not yet implemented)!ideally we would not pass length, but this f77-style call performs better(arrays passed by address, not descriptor)!further, this permits< length > contiguous words from an array of any rank to be passed(avoiding f90 rank conformance check)!caller is responsible for completion checks(mpp_sync_self) before and after integer, intent(in) ::put_len, to_pe, get_len, from_pe MPP_TYPE_, intent(in) ::put_data(*) MPP_TYPE_, intent(out) ::get_data(*) logical, intent(in), optional ::block integer, intent(in), optional ::tag integer, intent(out), optional ::recv_request, send_request logical ::block_comm integer ::i MPP_TYPE_, allocatable, save ::local_data(:) !local copy used by non-parallel code(no SHMEM or MPI) integer ::comm_tag integer ::rsize if(.NOT.module_is_initialized) call mpp_error(FATAL, 'MPP_TRANSMIT:You must first call mpp_init.') if(to_pe.EQ.NULL_PE .AND. from_pe.EQ.NULL_PE) return block_comm=.true. if(PRESENT(block)) block_comm=block if(debug) then call SYSTEM_CLOCK(tick) write(stdout_unit,'(a, i18, a, i6, a, 2i6, 2i8)')&'T=', tick, ' PE=', pe, ' MPP_TRANSMIT begin:to_pe, from_pe, put_len, get_len=', to_pe, from_pe, put_len, get_len end if comm_tag=DEFAULT_TAG if(present(tag)) comm_tag=tag!do put first and then get if(to_pe.GE.0 .AND. to_pe.LT.npes) then!use non-blocking sends if(debug .and.(current_clock.NE.0)) call SYSTEM_CLOCK(start_tick)!z1l:truly non-blocking send.! if(request(to_pe).NE.MPI_REQUEST_NULL) then !only one message from pe-> to_pe in queue *PE waiting for to_pe ! call error else get_len so only do gets but you cannot have a pure get with MPI call a get means do a wait to ensure put on remote PE is complete error call increase mpp_nml request_multiply call MPP_TRANSMIT get_len end if return end subroutine MPP_TRANSMIT_ ! MPP_BROADCAST ! subroutine but that doesn t allow !broadcast to a subset of PEs This version will
type(ext_fieldtype), dimension(:), pointer, save, private field
subroutine, public copy(self, rhs)
type(field_mgr_type), dimension(max_fields), private fields
integer, parameter linear
character(len=128) version
l_size ! loop over number of fields ke do je do ie to is
integer, parameter, public global
logical function received(this, seqno)
************************************************************************GNU Lesser General Public License **This file is part of the GFDL Flexible Modeling System(FMS). ! *! *FMS is free software without even the implied warranty of MERCHANTABILITY or *FITNESS FOR A PARTICULAR PURPOSE See the GNU General Public License *for more details **You should have received a copy of the GNU Lesser General Public *License along with FMS If see< http:! ***********************************************************************!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! MPP_TRANSMIT !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine MPP_TRANSMIT_(put_data, put_len, to_pe, get_data, get_len, from_pe, block, tag, recv_request, send_request)!a message-passing routine intended to be reminiscent equally of both MPI and SHMEM!put_data and get_data are contiguous MPP_TYPE_ arrays!at each call, your put_data array is put to to_pe 's get_data! your get_data array is got from from_pe 's put_data!i.e we assume that typically(e.g updating halo regions) each PE performs a put _and_ a get!special PE designations:! NULL_PE:to disable a put or a get(e.g at boundaries)! ANY_PE:if remote PE for the put or get is to be unspecific! ALL_PES:broadcast and collect operations(collect not yet implemented)!ideally we would not pass length, but this f77-style call performs better(arrays passed by address, not descriptor)!further, this permits< length > contiguous words from an array of any rank to be passed(avoiding f90 rank conformance check)!caller is responsible for completion checks(mpp_sync_self) before and after integer, intent(in) ::put_len, to_pe, get_len, from_pe MPP_TYPE_, intent(in) ::put_data(*) MPP_TYPE_, intent(out) ::get_data(*) logical, intent(in), optional ::block integer, intent(in), optional ::tag integer, intent(out), optional ::recv_request, send_request logical ::block_comm integer ::i MPP_TYPE_, allocatable, save ::local_data(:) !local copy used by non-parallel code(no SHMEM or MPI) integer ::comm_tag integer ::rsize if(.NOT.module_is_initialized) call mpp_error(FATAL, 'MPP_TRANSMIT:You must first call mpp_init.') if(to_pe.EQ.NULL_PE .AND. from_pe.EQ.NULL_PE) return block_comm=.true. if(PRESENT(block)) block_comm=block if(debug) then call SYSTEM_CLOCK(tick) write(stdout_unit,'(a, i18, a, i6, a, 2i6, 2i8)')&'T=', tick, ' PE=', pe, ' MPP_TRANSMIT begin:to_pe, from_pe, put_len, get_len=', to_pe, from_pe, put_len, get_len end if comm_tag=DEFAULT_TAG if(present(tag)) comm_tag=tag!do put first and then get if(to_pe.GE.0 .AND. to_pe.LT.npes) then!use non-blocking sends if(debug .and.(current_clock.NE.0)) call SYSTEM_CLOCK(start_tick)!z1l:truly non-blocking send.! if(request(to_pe).NE.MPI_REQUEST_NULL) then !only one message from pe-> to_pe in queue *PE waiting for to_pe ! call error else get_len so only do gets but you cannot have a pure get with MPI call a get means do a wait to ensure put on remote PE is complete error call increase mpp_nml request_multiply call MPP_TRANSMIT get_len end if return end subroutine MPP_TRANSMIT_ ! MPP_BROADCAST ! subroutine but that doesn t allow !broadcast to a subset of PEs This version and mpp_transmit will remain !backward compatible intent(inout) a
#define max(a, b)
Definition: mosaic_util.h:33
*f90 *************************************************************************GNU Lesser General Public License **This file is part of the GFDL Flexible Modeling System(FMS). ! *! *FMS is free software without even the implied warranty of MERCHANTABILITY or *FITNESS FOR A PARTICULAR PURPOSE See the GNU General Public License *for more details **You should have received a copy of the GNU Lesser General Public *License along with FMS If not
#define min(a, b)
Definition: mosaic_util.h:32