FMS  2026.01.01-dev
Flexible Modeling System
mpp_comm_mpi.inc
1 ! -*-f90-*-
2 
3 !***********************************************************************
4 !* Apache License 2.0
5 !*
6 !* This file is part of the GFDL Flexible Modeling System (FMS).
7 !*
8 !* Licensed under the Apache License, Version 2.0 (the "License");
9 !* you may not use this file except in compliance with the License.
10 !* You may obtain a copy of the License at
11 !*
12 !* http://www.apache.org/licenses/LICENSE-2.0
13 !*
14 !* FMS is distributed in the hope that it will be useful, but WITHOUT
15 !* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied;
16 !* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
17 !* PARTICULAR PURPOSE. See the License for the specific language
18 !* governing permissions and limitations under the License.
19 !***********************************************************************
20 !> @file
21 !> @brief Routines to initialize and finalize @ref mpp_mod with mpi enabled.
22 
23 !> @addtogroup mpp_mod
24 !> @{
25 
26 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
27 ! !
28 ! ROUTINES TO INITIALIZE/FINALIZE MPP MODULE: mpp_init, mpp_exit !
29 ! !
30 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
31  !> @brief Initialize the @ref mpp_mod module. Must be called before any usage.
32  subroutine mpp_init_f08( flags, localcomm, test_level, alt_input_nml_path )
33  !$ use omp_lib
34  integer, optional, intent(in) :: flags !< Flags for debug output, can be MPP_VERBOSE or MPP_DEBUG
35  type(mpi_comm), optional, intent(in) :: localcomm !< MPI communicator to use. Only relevant if MPI has already
36  !! been initialized by an external call to mpi_init.
37  integer, optional, intent(in) :: test_level !< Used to exit initialization at certain stages
38  !! before completion for testing purposes
39  character(len=*), optional, intent(in) :: alt_input_nml_path !< Input path for namelist
40  integer :: i, iunit
41  logical :: opened, existed
42  integer :: io_status
43  integer :: t_level
44 
45  if( module_is_initialized )return
46 
47  ! Check if MPI has already been initialized by an external call to mpi_init.
48  call mpi_initialized( opened, error )
49 
50  if (opened) then
51  if (present(localcomm)) then
52  mpp_comm_private = localcomm
53  else
54  call mpp_error(fatal, 'mpp_init: A communicator handle is required')
55  endif
56  else
57  call mpi_init(error)
58  mpp_comm_private = mpi_comm_world
59  endif
60 
61  call mpi_comm_rank( mpp_comm_private, pe, error )
62  call mpi_comm_size( mpp_comm_private, npes, error )
63 
64  ! set default device to enable multi GPU parallelism
65  ! calls to both OpenACC and OpenMP runtimes are needed
66  ! because we use both do-concurrent and openmp
67  ! if you remove either, the code will run multiple
68  ! ranks on a _single_ GPU. Be careful out there!
69  !$ call omp_set_default_device(pe)
70  !$acc set device_num(pe)
71 
72  module_is_initialized = .true.
73  if (present(test_level)) then
74  t_level = test_level
75  else
76  t_level = -1
77  endif
78  if (t_level == 0) return
79 
80  !PEsets: make defaults illegal
81  allocate(peset(0:current_peset_max))
82  peset(:)%count = -1
83  peset(:)%comm = mpi_comm_null
84  peset(:)%group = mpi_group_null
85  peset(:)%start = -1
86  peset(:)%log2stride = -1
87  peset(:)%name = " "
88  !0=single-PE, initialized so that count returns 1
89  peset(0)%count = 1
90  allocate( peset(0)%list(1) )
91  peset(0)%list = pe
92  current_peset_num = 0
93  peset(0)%comm = mpp_comm_private
94  call mpi_comm_group( mpp_comm_private, peset(0)%group, error )
95  world_peset_num = get_peset( (/(i,i=0,npes-1)/) )
96  current_peset_num = world_peset_num !initialize current PEset to world
97  if (t_level == 1) return
98 
99  !initialize clocks
100  call system_clock( count=tick0, count_rate=ticks_per_sec, count_max=max_ticks )
101  tick_rate = 1./ticks_per_sec
102  clock0 = mpp_clock_id( 'Total runtime', flags=mpp_clock_sync )
103  if (t_level == 2) return
104 
105  ! Create the bytestream (default) mpp_datatype
106  mpp_byte%counter = 1
107  mpp_byte%ndims = 0
108  allocate(mpp_byte%sizes(0))
109  allocate(mpp_byte%subsizes(0))
110  allocate(mpp_byte%starts(0))
111  mpp_byte%etype = mpi_byte
112  mpp_byte%id = mpi_byte
113 
114  mpp_byte%prev => null()
115  mpp_byte%next => null()
116 
117  ! Initialize datatype list with mpp_byte
118  datatypes%head => mpp_byte
119  datatypes%tail => mpp_byte
120  datatypes%length = 0
121 
122  if( PRESENT(flags) )then
123  debug = flags.EQ.mpp_debug
124  verbose = flags.EQ.mpp_verbose .OR. debug
125  end if
126  if (t_level == 3) return
127 
128  call mpp_init_logfile()
129  call mpp_init_warninglog()
130  if (present(alt_input_nml_path)) then
131  call read_input_nml(alt_input_nml_path=alt_input_nml_path)
132  else
133  call read_input_nml
134  end if
135  if (t_level == 4) return
136 
137  !--- read namelist
138  read (input_nml_file, mpp_nml, iostat=io_status)
139  if (io_status > 0) then
140  call mpp_error(fatal,'=>mpp_init: Error reading mpp_nml')
141  endif
142  if (t_level == 5) return
143 
144  if(sync_all_clocks .AND. mpp_pe()==mpp_root_pe() ) call mpp_error(note, &
145  "mpp_mod: mpp_nml variable sync_all_clocks is set to .true., all clocks are synchronized in mpp_clock_begin.")
146 
147 ! non-root pe messages written to other location than stdout()
148 
149  if(etc_unit_is_stderr) then
150  etc_unit = stderr()
151  else
152  if (trim(etcfile) /= '/dev/null') then
153  write( etcfile,'(a,i6.6)' )trim(etcfile)//'.', pe
154  endif
155  inquire(file=etcfile, exist=existed)
156  if(existed) then
157  open( newunit=etc_unit, file=trim(etcfile), status='REPLACE' )
158  else
159  open( newunit=etc_unit, file=trim(etcfile) )
160  endif
161  endif
162 
163  if (t_level == 6) return
164 
165 ! max_request is set to maximum of npes * REQUEST_MULTIPLY ( default is 20) and MAX_REQUEST_MIN ( default 10000)
166  max_request = max(max_request_min, mpp_npes()*request_multiply)
167 
168  allocate( request_send(max_request) )
169  allocate( request_recv(max_request) )
170  allocate( size_recv(max_request) )
171  allocate( type_recv(max_request) )
172  request_send(:) = mpi_request_null
173  request_recv(:) = mpi_request_null
174  size_recv(:) = 0
175  type_recv(:) = mpi_datatype_null
176 
177  if (t_level == 7) return
178 
179  !messages
180  iunit = stdlog() ! workaround for lf95.
181  if( verbose )call mpp_error( note, 'MPP_INIT: initializing MPP module...' )
182  if( pe.EQ.root_pe )then
183  write( iunit,'(/a)' )'MPP module '//trim(version)
184  write( iunit,'(a,i6)' )'MPP started with NPES=', npes
185  write( iunit,'(a)' )'Using MPI library for message passing...'
186  write( iunit, '(a,es12.4,a,i10,a)' ) &
187  'Realtime clock resolution=', tick_rate, ' sec (', ticks_per_sec, ' ticks/sec)'
188  write( iunit, '(a,es12.4,a,i20,a)' ) &
189  'Clock rolls over after ', max_ticks*tick_rate, ' sec (', max_ticks, ' ticks)'
190  write( iunit,'(/a)' )'MPP Parameter module '//trim(mpp_parameter_version)
191  write( iunit,'(/a)' )'MPP Data module '//trim(mpp_data_version)
192  end if
193 
194  stdout_unit = stdout()
195 
196  call mpp_clock_begin(clock0)
197 
198  return
199 end subroutine mpp_init_f08
200 
201 !#######################################################################
202 !> Finalizes process termination. To be called at the end of a run.
203 !! Certain mpi implementations(openmpi) will fail if this is not called before program termination
204 subroutine mpp_exit()
205  integer :: i, j, n, nmax, out_unit, log_unit
206  real :: t, tmin, tmax, tavg, tstd
207  real :: m, mmin, mmax, mavg, mstd, t_total
208  logical :: opened
209  type(mpp_type), pointer :: dtype, next_dtype
210 
211  if( .NOT.module_is_initialized )return
213  call mpp_clock_end(clock0)
214  t_total = clocks(clock0)%total_ticks*tick_rate
215  out_unit = stdout()
216  log_unit = stdlog()
217  if( clock_num.GT.0 )then
218  if( any(clocks(1:clock_num)%detailed) )then
219  call sum_clock_data; call dump_clock_summary
220  end if
221 
222  call mpp_sync()
223  call flush( out_unit )
224  close(warn_unit)
225 
226  if( pe.EQ.root_pe )then
227  write( out_unit,'(/a,i6,a)' ) 'Tabulating mpp_clock statistics across ', npes, ' PEs...'
228  if( any(clocks(1:clock_num)%detailed) ) &
229  write( out_unit,'(a)' )' ... see mpp_clock.out.#### for details on individual PEs.'
230  write( out_unit,'(/32x,a)' ) &
231  & ' hits tmin tmax tavg tstd tfrac grain pemin pemax'
232  end if
233  write( log_unit,'(/37x,a)' ) 'time'
234 
235  call flush( out_unit )
236  call mpp_sync()
237  do i = 1,clock_num
238  if( .NOT.any(peset(clocks(i)%peset_num)%list(:).EQ.pe) )cycle
239  call mpp_set_current_pelist( peset(clocks(i)%peset_num)%list )
240  out_unit = stdout()
241  log_unit = stdlog()
242  !times between mpp_clock ticks
243  t = clocks(i)%total_ticks*tick_rate
244  tmin = t; call mpp_min(tmin)
245  tmax = t; call mpp_max(tmax)
246  tavg = t; call mpp_sum(tavg); tavg = tavg/mpp_npes()
247  tstd = (t-tavg)**2; call mpp_sum(tstd); tstd = sqrt( tstd/mpp_npes() )
248  if( pe.EQ.root_pe )write( out_unit,'(a32,i10,4f14.6,f7.3,3i6)' ) &
249  clocks(i)%name, clocks(i)%hits, tmin, tmax, tavg, tstd, tavg/t_total, &
250  clocks(i)%grain, minval(peset(clocks(i)%peset_num)%list), &
251  maxval(peset(clocks(i)%peset_num)%list)
252  write(log_unit,'(a32,f14.6)') clocks(i)%name, clocks(i)%total_ticks*tick_rate
253  end do
254 
255  if( any(clocks(1:clock_num)%detailed) .AND. pe.EQ.root_pe )write( out_unit,'(/32x,a)' ) &
256  ' tmin tmax tavg tstd mmin mmax mavg mstd mavg/tavg'
257 
258  do i = 1,clock_num
259  !messages: bytelengths and times
260  if( .NOT.clocks(i)%detailed )cycle
261  if( .NOT.any(peset(clocks(i)%peset_num)%list(:).EQ.pe) )cycle
262  call mpp_set_current_pelist( peset(clocks(i)%peset_num)%list )
263  out_unit = stdout()
264  do j = 1,max_event_types
265  n = clocks(i)%events(j)%calls; nmax = n
266  call mpp_max(nmax)
267  if( nmax.NE.0 )then
268  !don't divide by n because n might be 0
269  m = 0
270  if( n.GT.0 )m = sum(clocks(i)%events(j)%bytes(1:n))
271  mmin = m; call mpp_min(mmin)
272  mmax = m; call mpp_max(mmax)
273  mavg = m; call mpp_sum(mavg); mavg = mavg/mpp_npes()
274  mstd = (m-mavg)**2; call mpp_sum(mstd); mstd = sqrt( mstd/mpp_npes() )
275  t = 0
276  if( n.GT.0 )t = sum(clocks(i)%events(j)%ticks(1:n))*tick_rate
277  tmin = t; call mpp_min(tmin)
278  tmax = t; call mpp_max(tmax)
279  tavg = t; call mpp_sum(tavg); tavg = tavg/mpp_npes()
280  tstd = (t-tavg)**2; call mpp_sum(tstd); tstd = sqrt( tstd/mpp_npes() )
281  if( pe.EQ.root_pe )write( out_unit,'(a32,4f11.3,5es11.3)' ) &
282  trim(clocks(i)%name)//' '//trim(clocks(i)%events(j)%name), &
283  tmin, tmax, tavg, tstd, mmin, mmax, mavg, mstd, mavg/tavg
284  end if
285  end do
286  end do
287 
288  end if
289 
290  call flush( out_unit )
291 
292  inquire(unit=etc_unit, opened=opened)
293  if (opened) then
294  call flush (etc_unit)
295  close(etc_unit)
296  endif
297 
298  ! Clear derived data types
299  dtype => datatypes%head
300  do while (associated(dtype))
301  next_dtype => dtype%next
302  call mpp_type_free(dtype)
303  dtype => next_dtype
304  end do
305 
307  call mpp_sync()
308  call mpp_max(mpp_stack_hwm)
309  if( pe.EQ.root_pe )write( out_unit,* )'MPP_STACK high water mark=', mpp_stack_hwm
310  if(mpp_comm_private == mpi_comm_world ) call mpi_finalize(error)
311 
312  return
313 end subroutine mpp_exit
314 
315 !#######################################################################
316  !> Set the mpp_stack variable to be at least n LONG words long
317  subroutine mpp_set_stack_size(n)
318  integer, intent(in) :: n !< stack size to set
319  character(len=8) :: text
320 
321  if( n.GT.mpp_stack_size .AND. allocated(mpp_stack) )deallocate(mpp_stack)
322  if( .NOT.allocated(mpp_stack) )then
323  allocate( mpp_stack(n) )
324  mpp_stack_size = n
325  end if
326 
327  write( text,'(i8)' )n
328  if( pe.EQ.root_pe )call mpp_error( note, 'MPP_SET_STACK_SIZE: stack size set to '//text//'.' )
329 
330  return
331  end subroutine mpp_set_stack_size
332 
333 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
334 ! !
335 ! BASIC MESSAGE PASSING ROUTINE: mpp_transmit !
336 ! !
337 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
338  !> Broadcasts a character string from the given pe to it's pelist
339  subroutine mpp_broadcast_char(char_data, length, from_pe, pelist )
340  character(len=*), intent(inout) :: char_data(:) !< Character string to send
341  integer, intent(in) :: length !< length of given data to broadcast
342  integer, intent(in) :: from_pe !< pe to broadcast from
343  integer, intent(in), optional :: pelist(:) !< optional pelist to broadcast to
344  integer :: n, i, from_rank
345  character :: str1D(length*size(char_data(:)))
346  pointer(lptr, str1d)
347 
348  if( .NOT.module_is_initialized )call mpp_error( fatal, 'mpp_broadcast_text: You must first call mpp_init.' )
349  n = get_peset(pelist); if( peset(n)%count.EQ.1 )return
350 
351 
352  if( debug )then
353  call system_clock(tick)
354  if(mpp_pe() == mpp_root_pe()) then
355  write( stdout_unit,'(a,i18,a,i5,a,2i5,2i8)' )&
356  'T=',tick, ' PE=',pe, 'mpp_broadcast_text begin: from_pe, length=', from_pe, length
357  endif
358  end if
359 
360  if( .NOT.any(from_pe.EQ.peset(current_peset_num)%list) ) &
361  call mpp_error( fatal, 'mpp_broadcast_text: broadcasting from invalid PE.' )
362 
363  if( debug .and. (current_clock.NE.0) )call system_clock(start_tick)
364  ! find the rank of from_pe in the pelist.
365  do i = 1, mpp_npes()
366  if(peset(n)%list(i) == from_pe) then
367  from_rank = i - 1
368  exit
369  endif
370  enddo
371  lptr = loc(char_data)
372  if( mpp_npes().GT.1 ) call mpi_bcast( char_data, length*size(char_data(:)), &
373  mpi_character, from_rank, peset(n)%comm, error )
374  if( debug .and. (current_clock.NE.0) )call increment_current_clock( event_broadcast, length )
375  return
376  end subroutine mpp_broadcast_char
377 
378 ! defines initialization value for mpp_type data
379 #define MPP_TYPE_INIT_VALUE 0.
380 
381 #undef MPP_TRANSMIT_
382 #define MPP_TRANSMIT_ mpp_transmit_real8
383 #undef MPP_TRANSMIT_SCALAR_
384 #define MPP_TRANSMIT_SCALAR_ mpp_transmit_real8_scalar
385 #undef MPP_TRANSMIT_2D_
386 #define MPP_TRANSMIT_2D_ mpp_transmit_real8_2d
387 #undef MPP_TRANSMIT_3D_
388 #define MPP_TRANSMIT_3D_ mpp_transmit_real8_3d
389 #undef MPP_TRANSMIT_4D_
390 #define MPP_TRANSMIT_4D_ mpp_transmit_real8_4d
391 #undef MPP_TRANSMIT_5D_
392 #define MPP_TRANSMIT_5D_ mpp_transmit_real8_5d
393 #undef MPP_RECV_
394 #define MPP_RECV_ mpp_recv_real8
395 #undef MPP_RECV_SCALAR_
396 #define MPP_RECV_SCALAR_ mpp_recv_real8_scalar
397 #undef MPP_RECV_2D_
398 #define MPP_RECV_2D_ mpp_recv_real8_2d
399 #undef MPP_RECV_3D_
400 #define MPP_RECV_3D_ mpp_recv_real8_3d
401 #undef MPP_RECV_4D_
402 #define MPP_RECV_4D_ mpp_recv_real8_4d
403 #undef MPP_RECV_5D_
404 #define MPP_RECV_5D_ mpp_recv_real8_5d
405 #undef MPP_SEND_
406 #define MPP_SEND_ mpp_send_real8
407 #undef MPP_SEND_SCALAR_
408 #define MPP_SEND_SCALAR_ mpp_send_real8_scalar
409 #undef MPP_SEND_2D_
410 #define MPP_SEND_2D_ mpp_send_real8_2d
411 #undef MPP_SEND_3D_
412 #define MPP_SEND_3D_ mpp_send_real8_3d
413 #undef MPP_SEND_4D_
414 #define MPP_SEND_4D_ mpp_send_real8_4d
415 #undef MPP_SEND_5D_
416 #define MPP_SEND_5D_ mpp_send_real8_5d
417 #undef MPP_BROADCAST_
418 #define MPP_BROADCAST_ mpp_broadcast_real8
419 #undef MPP_BROADCAST_SCALAR_
420 #define MPP_BROADCAST_SCALAR_ mpp_broadcast_real8_scalar
421 #undef MPP_BROADCAST_2D_
422 #define MPP_BROADCAST_2D_ mpp_broadcast_real8_2d
423 #undef MPP_BROADCAST_3D_
424 #define MPP_BROADCAST_3D_ mpp_broadcast_real8_3d
425 #undef MPP_BROADCAST_4D_
426 #define MPP_BROADCAST_4D_ mpp_broadcast_real8_4d
427 #undef MPP_BROADCAST_5D_
428 #define MPP_BROADCAST_5D_ mpp_broadcast_real8_5d
429 #undef MPP_SCATTERV_
430 #define MPP_SCATTERV_ mpp_scatterv_real8
431 #undef MPP_GATHER_
432 #define MPP_GATHER_ mpp_gather_real8
433 #undef MPP_GATHERV_
434 #define MPP_GATHERV_ mpp_gatherv_real8
435 #undef MPP_TYPE_
436 #define MPP_TYPE_ real(r8_kind)
437 #undef MPP_TYPE_BYTELEN_
438 #define MPP_TYPE_BYTELEN_ 8
439 #undef MPI_TYPE_
440 #define MPI_TYPE_ MPI_REAL8
441 
442 
443 
444 #include <mpp_transmit_mpi.fh>
445 
446 #ifdef OVERLOAD_C8
447 #undef MPP_TRANSMIT_
448 #define MPP_TRANSMIT_ mpp_transmit_cmplx8
449 #undef MPP_TRANSMIT_SCALAR_
450 #define MPP_TRANSMIT_SCALAR_ mpp_transmit_cmplx8_scalar
451 #undef MPP_TRANSMIT_2D_
452 #define MPP_TRANSMIT_2D_ mpp_transmit_cmplx8_2d
453 #undef MPP_TRANSMIT_3D_
454 #define MPP_TRANSMIT_3D_ mpp_transmit_cmplx8_3d
455 #undef MPP_TRANSMIT_4D_
456 #define MPP_TRANSMIT_4D_ mpp_transmit_cmplx8_4d
457 #undef MPP_TRANSMIT_5D_
458 #define MPP_TRANSMIT_5D_ mpp_transmit_cmplx8_5d
459 #undef MPP_RECV_
460 #define MPP_RECV_ mpp_recv_cmplx8
461 #undef MPP_RECV_SCALAR_
462 #define MPP_RECV_SCALAR_ mpp_recv_cmplx8_scalar
463 #undef MPP_RECV_2D_
464 #define MPP_RECV_2D_ mpp_recv_cmplx8_2d
465 #undef MPP_RECV_3D_
466 #define MPP_RECV_3D_ mpp_recv_cmplx8_3d
467 #undef MPP_RECV_4D_
468 #define MPP_RECV_4D_ mpp_recv_cmplx8_4d
469 #undef MPP_RECV_5D_
470 #define MPP_RECV_5D_ mpp_recv_cmplx8_5d
471 #undef MPP_SEND_
472 #define MPP_SEND_ mpp_send_cmplx8
473 #undef MPP_SEND_SCALAR_
474 #define MPP_SEND_SCALAR_ mpp_send_cmplx8_scalar
475 #undef MPP_SEND_2D_
476 #define MPP_SEND_2D_ mpp_send_cmplx8_2d
477 #undef MPP_SEND_3D_
478 #define MPP_SEND_3D_ mpp_send_cmplx8_3d
479 #undef MPP_SEND_4D_
480 #define MPP_SEND_4D_ mpp_send_cmplx8_4d
481 #undef MPP_SEND_5D_
482 #define MPP_SEND_5D_ mpp_send_cmplx8_5d
483 #undef MPP_BROADCAST_
484 #define MPP_BROADCAST_ mpp_broadcast_cmplx8
485 #undef MPP_BROADCAST_SCALAR_
486 #define MPP_BROADCAST_SCALAR_ mpp_broadcast_cmplx8_scalar
487 #undef MPP_BROADCAST_2D_
488 #define MPP_BROADCAST_2D_ mpp_broadcast_cmplx8_2d
489 #undef MPP_BROADCAST_3D_
490 #define MPP_BROADCAST_3D_ mpp_broadcast_cmplx8_3d
491 #undef MPP_BROADCAST_4D_
492 #define MPP_BROADCAST_4D_ mpp_broadcast_cmplx8_4d
493 #undef MPP_BROADCAST_5D_
494 #define MPP_BROADCAST_5D_ mpp_broadcast_cmplx8_5d
495 #undef MPP_SCATTERV_
496 #define MPP_SCATTERV_ mpp_scatterv_complx8
497 #undef MPP_GATHER_
498 #define MPP_GATHER_ mpp_gather_complx8
499 #undef MPP_GATHERV_
500 #define MPP_GATHERV_ mpp_gatherv_complx8
501 #undef MPP_TYPE_
502 #define MPP_TYPE_ complex(c8_kind)
503 #undef MPP_TYPE_BYTELEN_
504 #define MPP_TYPE_BYTELEN_ 16
505 #undef MPI_TYPE_
506 #define MPI_TYPE_ MPI_DOUBLE_COMPLEX
507 #include <mpp_transmit_mpi.fh>
508 #endif
509 
510 #undef MPP_TRANSMIT_
511 #define MPP_TRANSMIT_ mpp_transmit_real4
512 #undef MPP_TRANSMIT_SCALAR_
513 #define MPP_TRANSMIT_SCALAR_ mpp_transmit_real4_scalar
514 #undef MPP_TRANSMIT_2D_
515 #define MPP_TRANSMIT_2D_ mpp_transmit_real4_2d
516 #undef MPP_TRANSMIT_3D_
517 #define MPP_TRANSMIT_3D_ mpp_transmit_real4_3d
518 #undef MPP_TRANSMIT_4D_
519 #define MPP_TRANSMIT_4D_ mpp_transmit_real4_4d
520 #undef MPP_TRANSMIT_5D_
521 #define MPP_TRANSMIT_5D_ mpp_transmit_real4_5d
522 #undef MPP_RECV_
523 #define MPP_RECV_ mpp_recv_real4
524 #undef MPP_RECV_SCALAR_
525 #define MPP_RECV_SCALAR_ mpp_recv_real4_scalar
526 #undef MPP_RECV_2D_
527 #define MPP_RECV_2D_ mpp_recv_real4_2d
528 #undef MPP_RECV_3D_
529 #define MPP_RECV_3D_ mpp_recv_real4_3d
530 #undef MPP_RECV_4D_
531 #define MPP_RECV_4D_ mpp_recv_real4_4d
532 #undef MPP_RECV_5D_
533 #define MPP_RECV_5D_ mpp_recv_real4_5d
534 #undef MPP_SEND_
535 #define MPP_SEND_ mpp_send_real4
536 #undef MPP_SEND_SCALAR_
537 #define MPP_SEND_SCALAR_ mpp_send_real4_scalar
538 #undef MPP_SEND_2D_
539 #define MPP_SEND_2D_ mpp_send_real4_2d
540 #undef MPP_SEND_3D_
541 #define MPP_SEND_3D_ mpp_send_real4_3d
542 #undef MPP_SEND_4D_
543 #define MPP_SEND_4D_ mpp_send_real4_4d
544 #undef MPP_SEND_5D_
545 #define MPP_SEND_5D_ mpp_send_real4_5d
546 #undef MPP_BROADCAST_
547 #define MPP_BROADCAST_ mpp_broadcast_real4
548 #undef MPP_BROADCAST_SCALAR_
549 #define MPP_BROADCAST_SCALAR_ mpp_broadcast_real4_scalar
550 #undef MPP_BROADCAST_2D_
551 #define MPP_BROADCAST_2D_ mpp_broadcast_real4_2d
552 #undef MPP_BROADCAST_3D_
553 #define MPP_BROADCAST_3D_ mpp_broadcast_real4_3d
554 #undef MPP_BROADCAST_4D_
555 #define MPP_BROADCAST_4D_ mpp_broadcast_real4_4d
556 #undef MPP_BROADCAST_5D_
557 #define MPP_BROADCAST_5D_ mpp_broadcast_real4_5d
558 #undef MPP_SCATTERV_
559 #define MPP_SCATTERV_ mpp_scatterv_real4
560 #undef MPP_GATHER_
561 #define MPP_GATHER_ mpp_gather_real4
562 #undef MPP_GATHERV_
563 #define MPP_GATHERV_ mpp_gatherv_real4
564 #undef MPP_TYPE_
565 #define MPP_TYPE_ real(r4_kind)
566 #undef MPP_TYPE_BYTELEN_
567 #define MPP_TYPE_BYTELEN_ 4
568 #undef MPI_TYPE_
569 #define MPI_TYPE_ MPI_REAL4
570 #include <mpp_transmit_mpi.fh>
571 
572 #ifdef OVERLOAD_C4
573 #undef MPP_TRANSMIT_
574 #define MPP_TRANSMIT_ mpp_transmit_cmplx4
575 #undef MPP_TRANSMIT_SCALAR_
576 #define MPP_TRANSMIT_SCALAR_ mpp_transmit_cmplx4_scalar
577 #undef MPP_TRANSMIT_2D_
578 #define MPP_TRANSMIT_2D_ mpp_transmit_cmplx4_2d
579 #undef MPP_TRANSMIT_3D_
580 #define MPP_TRANSMIT_3D_ mpp_transmit_cmplx4_3d
581 #undef MPP_TRANSMIT_4D_
582 #define MPP_TRANSMIT_4D_ mpp_transmit_cmplx4_4d
583 #undef MPP_TRANSMIT_5D_
584 #define MPP_TRANSMIT_5D_ mpp_transmit_cmplx4_5d
585 #undef MPP_RECV_
586 #define MPP_RECV_ mpp_recv_cmplx4
587 #undef MPP_RECV_SCALAR_
588 #define MPP_RECV_SCALAR_ mpp_recv_cmplx4_scalar
589 #undef MPP_RECV_2D_
590 #define MPP_RECV_2D_ mpp_recv_cmplx4_2d
591 #undef MPP_RECV_3D_
592 #define MPP_RECV_3D_ mpp_recv_cmplx4_3d
593 #undef MPP_RECV_4D_
594 #define MPP_RECV_4D_ mpp_recv_cmplx4_4d
595 #undef MPP_RECV_5D_
596 #define MPP_RECV_5D_ mpp_recv_cmplx4_5d
597 #undef MPP_SEND_
598 #define MPP_SEND_ mpp_send_cmplx4
599 #undef MPP_SEND_SCALAR_
600 #define MPP_SEND_SCALAR_ mpp_send_cmplx4_scalar
601 #undef MPP_SEND_2D_
602 #define MPP_SEND_2D_ mpp_send_cmplx4_2d
603 #undef MPP_SEND_3D_
604 #define MPP_SEND_3D_ mpp_send_cmplx4_3d
605 #undef MPP_SEND_4D_
606 #define MPP_SEND_4D_ mpp_send_cmplx4_4d
607 #undef MPP_SEND_5D_
608 #define MPP_SEND_5D_ mpp_send_cmplx4_5d
609 #undef MPP_BROADCAST_
610 #define MPP_BROADCAST_ mpp_broadcast_cmplx4
611 #undef MPP_BROADCAST_SCALAR_
612 #define MPP_BROADCAST_SCALAR_ mpp_broadcast_cmplx4_scalar
613 #undef MPP_BROADCAST_2D_
614 #define MPP_BROADCAST_2D_ mpp_broadcast_cmplx4_2d
615 #undef MPP_BROADCAST_3D_
616 #define MPP_BROADCAST_3D_ mpp_broadcast_cmplx4_3d
617 #undef MPP_BROADCAST_4D_
618 #define MPP_BROADCAST_4D_ mpp_broadcast_cmplx4_4d
619 #undef MPP_BROADCAST_5D_
620 #define MPP_BROADCAST_5D_ mpp_broadcast_cmplx4_5d
621 #undef MPP_SCATTERV_
622 #define MPP_SCATTERV_ mpp_scatterv_cmplx4
623 #undef MPP_GATHER_
624 #define MPP_GATHER_ mpp_gather_cmplx4
625 #undef MPP_GATHERV_
626 #define MPP_GATHERV_ mpp_gatherv_cmplx4
627 #undef MPP_TYPE_
628 #define MPP_TYPE_ complex(c4_kind)
629 #undef MPP_TYPE_BYTELEN_
630 #define MPP_TYPE_BYTELEN_ 8
631 #undef MPI_TYPE_
632 #define MPI_TYPE_ MPI_COMPLEX
633 #include <mpp_transmit_mpi.fh>
634 #endif
635 
636 #undef MPP_TYPE_INIT_VALUE
637 #define MPP_TYPE_INIT_VALUE 0
638 #undef MPP_TRANSMIT_
639 #define MPP_TRANSMIT_ mpp_transmit_int8
640 #undef MPP_TRANSMIT_SCALAR_
641 #define MPP_TRANSMIT_SCALAR_ mpp_transmit_int8_scalar
642 #undef MPP_TRANSMIT_2D_
643 #define MPP_TRANSMIT_2D_ mpp_transmit_int8_2d
644 #undef MPP_TRANSMIT_3D_
645 #define MPP_TRANSMIT_3D_ mpp_transmit_int8_3d
646 #undef MPP_TRANSMIT_4D_
647 #define MPP_TRANSMIT_4D_ mpp_transmit_int8_4d
648 #undef MPP_TRANSMIT_5D_
649 #define MPP_TRANSMIT_5D_ mpp_transmit_int8_5d
650 #undef MPP_RECV_
651 #define MPP_RECV_ mpp_recv_int8
652 #undef MPP_RECV_SCALAR_
653 #define MPP_RECV_SCALAR_ mpp_recv_int8_scalar
654 #undef MPP_RECV_2D_
655 #define MPP_RECV_2D_ mpp_recv_int8_2d
656 #undef MPP_RECV_3D_
657 #define MPP_RECV_3D_ mpp_recv_int8_3d
658 #undef MPP_RECV_4D_
659 #define MPP_RECV_4D_ mpp_recv_int8_4d
660 #undef MPP_RECV_5D_
661 #define MPP_RECV_5D_ mpp_recv_int8_5d
662 #undef MPP_SEND_
663 #define MPP_SEND_ mpp_send_int8
664 #undef MPP_SEND_SCALAR_
665 #define MPP_SEND_SCALAR_ mpp_send_int8_scalar
666 #undef MPP_SEND_2D_
667 #define MPP_SEND_2D_ mpp_send_int8_2d
668 #undef MPP_SEND_3D_
669 #define MPP_SEND_3D_ mpp_send_int8_3d
670 #undef MPP_SEND_4D_
671 #define MPP_SEND_4D_ mpp_send_int8_4d
672 #undef MPP_SEND_5D_
673 #define MPP_SEND_5D_ mpp_send_int8_5d
674 #undef MPP_BROADCAST_
675 #define MPP_BROADCAST_ mpp_broadcast_int8
676 #undef MPP_BROADCAST_SCALAR_
677 #define MPP_BROADCAST_SCALAR_ mpp_broadcast_int8_scalar
678 #undef MPP_BROADCAST_2D_
679 #define MPP_BROADCAST_2D_ mpp_broadcast_int8_2d
680 #undef MPP_BROADCAST_3D_
681 #define MPP_BROADCAST_3D_ mpp_broadcast_int8_3d
682 #undef MPP_BROADCAST_4D_
683 #define MPP_BROADCAST_4D_ mpp_broadcast_int8_4d
684 #undef MPP_BROADCAST_5D_
685 #define MPP_BROADCAST_5D_ mpp_broadcast_int8_5d
686 #undef MPP_SCATTERV_
687 #define MPP_SCATTERV_ mpp_scatterv_int8
688 #undef MPP_GATHER_
689 #define MPP_GATHER_ mpp_gather_int8
690 #undef MPP_GATHERV_
691 #define MPP_GATHERV_ mpp_gatherv_int8
692 #undef MPP_TYPE_
693 #define MPP_TYPE_ integer(i8_kind)
694 #undef MPP_TYPE_BYTELEN_
695 #define MPP_TYPE_BYTELEN_ 8
696 #undef MPI_TYPE_
697 #define MPI_TYPE_ MPI_INTEGER8
698 #include <mpp_transmit_mpi.fh>
699 
700 #undef MPP_TRANSMIT_
701 #define MPP_TRANSMIT_ mpp_transmit_int4
702 #undef MPP_TRANSMIT_SCALAR_
703 #define MPP_TRANSMIT_SCALAR_ mpp_transmit_int4_scalar
704 #undef MPP_TRANSMIT_2D_
705 #define MPP_TRANSMIT_2D_ mpp_transmit_int4_2d
706 #undef MPP_TRANSMIT_3D_
707 #define MPP_TRANSMIT_3D_ mpp_transmit_int4_3d
708 #undef MPP_TRANSMIT_4D_
709 #define MPP_TRANSMIT_4D_ mpp_transmit_int4_4d
710 #undef MPP_TRANSMIT_5D_
711 #define MPP_TRANSMIT_5D_ mpp_transmit_int4_5d
712 #undef MPP_RECV_
713 #define MPP_RECV_ mpp_recv_int4
714 #undef MPP_RECV_SCALAR_
715 #define MPP_RECV_SCALAR_ mpp_recv_int4_scalar
716 #undef MPP_RECV_2D_
717 #define MPP_RECV_2D_ mpp_recv_int4_2d
718 #undef MPP_RECV_3D_
719 #define MPP_RECV_3D_ mpp_recv_int4_3d
720 #undef MPP_RECV_4D_
721 #define MPP_RECV_4D_ mpp_recv_int4_4d
722 #undef MPP_RECV_5D_
723 #define MPP_RECV_5D_ mpp_recv_int4_5d
724 #undef MPP_SEND_
725 #define MPP_SEND_ mpp_send_int4
726 #undef MPP_SEND_SCALAR_
727 #define MPP_SEND_SCALAR_ mpp_send_int4_scalar
728 #undef MPP_SEND_2D_
729 #define MPP_SEND_2D_ mpp_send_int4_2d
730 #undef MPP_SEND_3D_
731 #define MPP_SEND_3D_ mpp_send_int4_3d
732 #undef MPP_SEND_4D_
733 #define MPP_SEND_4D_ mpp_send_int4_4d
734 #undef MPP_SEND_5D_
735 #define MPP_SEND_5D_ mpp_send_int4_5d
736 #undef MPP_BROADCAST_
737 #define MPP_BROADCAST_ mpp_broadcast_int4
738 #undef MPP_BROADCAST_SCALAR_
739 #define MPP_BROADCAST_SCALAR_ mpp_broadcast_int4_scalar
740 #undef MPP_BROADCAST_2D_
741 #define MPP_BROADCAST_2D_ mpp_broadcast_int4_2d
742 #undef MPP_BROADCAST_3D_
743 #define MPP_BROADCAST_3D_ mpp_broadcast_int4_3d
744 #undef MPP_BROADCAST_4D_
745 #define MPP_BROADCAST_4D_ mpp_broadcast_int4_4d
746 #undef MPP_BROADCAST_5D_
747 #define MPP_BROADCAST_5D_ mpp_broadcast_int4_5d
748 #undef MPP_SCATTERV_
749 #define MPP_SCATTERV_ mpp_scatterv_int4
750 #undef MPP_GATHER_
751 #define MPP_GATHER_ mpp_gather_int4
752 #undef MPP_GATHERV_
753 #define MPP_GATHERV_ mpp_gatherv_int4
754 #undef MPP_TYPE_
755 #define MPP_TYPE_ integer(i4_kind)
756 #undef MPP_TYPE_BYTELEN_
757 #define MPP_TYPE_BYTELEN_ 4
758 #undef MPI_TYPE_
759 #define MPI_TYPE_ MPI_INTEGER4
760 #include <mpp_transmit_mpi.fh>
761 
762 #undef MPP_TYPE_INIT_VALUE
763 #define MPP_TYPE_INIT_VALUE .false.
764 #undef MPP_TRANSMIT_
765 #define MPP_TRANSMIT_ mpp_transmit_logical8
766 #undef MPP_TRANSMIT_SCALAR_
767 #define MPP_TRANSMIT_SCALAR_ mpp_transmit_logical8_scalar
768 #undef MPP_TRANSMIT_2D_
769 #define MPP_TRANSMIT_2D_ mpp_transmit_logical8_2d
770 #undef MPP_TRANSMIT_3D_
771 #define MPP_TRANSMIT_3D_ mpp_transmit_logical8_3d
772 #undef MPP_TRANSMIT_4D_
773 #define MPP_TRANSMIT_4D_ mpp_transmit_logical8_4d
774 #undef MPP_TRANSMIT_5D_
775 #define MPP_TRANSMIT_5D_ mpp_transmit_logical8_5d
776 #undef MPP_RECV_
777 #define MPP_RECV_ mpp_recv_logical8
778 #undef MPP_RECV_SCALAR_
779 #define MPP_RECV_SCALAR_ mpp_recv_logical8_scalar
780 #undef MPP_RECV_2D_
781 #define MPP_RECV_2D_ mpp_recv_logical8_2d
782 #undef MPP_RECV_3D_
783 #define MPP_RECV_3D_ mpp_recv_logical8_3d
784 #undef MPP_RECV_4D_
785 #define MPP_RECV_4D_ mpp_recv_logical8_4d
786 #undef MPP_RECV_5D_
787 #define MPP_RECV_5D_ mpp_recv_logical8_5d
788 #undef MPP_SEND_
789 #define MPP_SEND_ mpp_send_logical8
790 #undef MPP_SEND_SCALAR_
791 #define MPP_SEND_SCALAR_ mpp_send_logical8_scalar
792 #undef MPP_SEND_2D_
793 #define MPP_SEND_2D_ mpp_send_logical8_2d
794 #undef MPP_SEND_3D_
795 #define MPP_SEND_3D_ mpp_send_logical8_3d
796 #undef MPP_SEND_4D_
797 #define MPP_SEND_4D_ mpp_send_logical8_4d
798 #undef MPP_SEND_5D_
799 #define MPP_SEND_5D_ mpp_send_logical8_5d
800 #undef MPP_BROADCAST_
801 #define MPP_BROADCAST_ mpp_broadcast_logical8
802 #undef MPP_BROADCAST_SCALAR_
803 #define MPP_BROADCAST_SCALAR_ mpp_broadcast_logical8_scalar
804 #undef MPP_BROADCAST_2D_
805 #define MPP_BROADCAST_2D_ mpp_broadcast_logical8_2d
806 #undef MPP_BROADCAST_3D_
807 #define MPP_BROADCAST_3D_ mpp_broadcast_logical8_3d
808 #undef MPP_BROADCAST_4D_
809 #define MPP_BROADCAST_4D_ mpp_broadcast_logical8_4d
810 #undef MPP_BROADCAST_5D_
811 #define MPP_BROADCAST_5D_ mpp_broadcast_logical8_5d
812 #undef MPP_SCATTERV_
813 #define MPP_SCATTERV_ mpp_scatterv_logical8
814 #undef MPP_GATHER_
815 #define MPP_GATHER_ mpp_gather_logical8
816 #undef MPP_GATHERV_
817 #define MPP_GATHERV_ mpp_gatherv_logical8
818 #undef MPP_TYPE_
819 #define MPP_TYPE_ logical(l8_kind)
820 #undef MPP_TYPE_BYTELEN_
821 #define MPP_TYPE_BYTELEN_ 8
822 #undef MPI_TYPE_
823 #define MPI_TYPE_ MPI_INTEGER8
824 #include <mpp_transmit_mpi.fh>
825 
826 #undef MPP_TRANSMIT_
827 #define MPP_TRANSMIT_ mpp_transmit_logical4
828 #undef MPP_TRANSMIT_SCALAR_
829 #define MPP_TRANSMIT_SCALAR_ mpp_transmit_logical4_scalar
830 #undef MPP_TRANSMIT_2D_
831 #define MPP_TRANSMIT_2D_ mpp_transmit_logical4_2d
832 #undef MPP_TRANSMIT_3D_
833 #define MPP_TRANSMIT_3D_ mpp_transmit_logical4_3d
834 #undef MPP_TRANSMIT_4D_
835 #define MPP_TRANSMIT_4D_ mpp_transmit_logical4_4d
836 #undef MPP_TRANSMIT_5D_
837 #define MPP_TRANSMIT_5D_ mpp_transmit_logical4_5d
838 #undef MPP_RECV_
839 #define MPP_RECV_ mpp_recv_logical4
840 #undef MPP_RECV_SCALAR_
841 #define MPP_RECV_SCALAR_ mpp_recv_logical4_scalar
842 #undef MPP_RECV_2D_
843 #define MPP_RECV_2D_ mpp_recv_logical4_2d
844 #undef MPP_RECV_3D_
845 #define MPP_RECV_3D_ mpp_recv_logical4_3d
846 #undef MPP_RECV_4D_
847 #define MPP_RECV_4D_ mpp_recv_logical4_4d
848 #undef MPP_RECV_5D_
849 #define MPP_RECV_5D_ mpp_recv_logical4_5d
850 #undef MPP_SEND_
851 #define MPP_SEND_ mpp_send_logical4
852 #undef MPP_SEND_SCALAR_
853 #define MPP_SEND_SCALAR_ mpp_send_logical4_scalar
854 #undef MPP_SEND_2D_
855 #define MPP_SEND_2D_ mpp_send_logical4_2d
856 #undef MPP_SEND_3D_
857 #define MPP_SEND_3D_ mpp_send_logical4_3d
858 #undef MPP_SEND_4D_
859 #define MPP_SEND_4D_ mpp_send_logical4_4d
860 #undef MPP_SEND_5D_
861 #define MPP_SEND_5D_ mpp_send_logical4_5d
862 #undef MPP_BROADCAST_
863 #define MPP_BROADCAST_ mpp_broadcast_logical4
864 #undef MPP_BROADCAST_SCALAR_
865 #define MPP_BROADCAST_SCALAR_ mpp_broadcast_logical4_scalar
866 #undef MPP_BROADCAST_2D_
867 #define MPP_BROADCAST_2D_ mpp_broadcast_logical4_2d
868 #undef MPP_BROADCAST_3D_
869 #define MPP_BROADCAST_3D_ mpp_broadcast_logical4_3d
870 #undef MPP_BROADCAST_4D_
871 #define MPP_BROADCAST_4D_ mpp_broadcast_logical4_4d
872 #undef MPP_BROADCAST_5D_
873 #define MPP_BROADCAST_5D_ mpp_broadcast_logical4_5d
874 #undef MPP_SCATTERV_
875 #define MPP_SCATTERV_ mpp_scatterv_logical4
876 #undef MPP_GATHER_
877 #define MPP_GATHER_ mpp_gather_logical4
878 #undef MPP_GATHERV_
879 #define MPP_GATHERV_ mpp_gatherv_logical4
880 #undef MPP_TYPE_
881 #define MPP_TYPE_ logical(l4_kind)
882 #undef MPP_TYPE_BYTELEN_
883 #define MPP_TYPE_BYTELEN_ 4
884 #undef MPI_TYPE_
885 #define MPI_TYPE_ MPI_INTEGER4
886 #include <mpp_transmit_mpi.fh>
887 #undef MPP_TYPE_INIT_VALUE
888 
889 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
890 ! !
891 ! GLOBAL REDUCTION ROUTINES: mpp_max, mpp_sum, mpp_min !
892 ! !
893 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
894 #undef MPP_REDUCE_0D_
895 #define MPP_REDUCE_0D_ mpp_max_real8_0d
896 #undef MPP_REDUCE_1D_
897 #define MPP_REDUCE_1D_ mpp_max_real8_1d
898 #undef MPP_TYPE_
899 #define MPP_TYPE_ real(r8_kind)
900 #undef MPP_TYPE_BYTELEN_
901 #define MPP_TYPE_BYTELEN_ 8
902 #undef MPI_TYPE_
903 #define MPI_TYPE_ MPI_REAL8
904 #undef MPI_REDUCE_
905 #define MPI_REDUCE_ MPI_MAX
906 #include <mpp_reduce_mpi.fh>
907 
908 #undef MPP_REDUCE_0D_
909 #define MPP_REDUCE_0D_ mpp_max_real4_0d
910 #undef MPP_REDUCE_1D_
911 #define MPP_REDUCE_1D_ mpp_max_real4_1d
912 #undef MPP_TYPE_
913 #define MPP_TYPE_ real(r4_kind)
914 #undef MPP_TYPE_BYTELEN_
915 #define MPP_TYPE_BYTELEN_ 4
916 #undef MPI_TYPE_
917 #define MPI_TYPE_ MPI_REAL4
918 #undef MPI_REDUCE_
919 #define MPI_REDUCE_ MPI_MAX
920 #include <mpp_reduce_mpi.fh>
921 
922 #undef MPP_REDUCE_0D_
923 #define MPP_REDUCE_0D_ mpp_max_int8_0d
924 #undef MPP_REDUCE_1D_
925 #define MPP_REDUCE_1D_ mpp_max_int8_1d
926 #undef MPP_TYPE_
927 #define MPP_TYPE_ integer(i8_kind)
928 #undef MPP_TYPE_BYTELEN_
929 #define MPP_TYPE_BYTELEN_ 8
930 #undef MPI_TYPE_
931 #define MPI_TYPE_ MPI_INTEGER8
932 #undef MPI_REDUCE_
933 #define MPI_REDUCE_ MPI_MAX
934 #include <mpp_reduce_mpi.fh>
935 
936 #undef MPP_REDUCE_0D_
937 #define MPP_REDUCE_0D_ mpp_max_int4_0d
938 #undef MPP_REDUCE_1D_
939 #define MPP_REDUCE_1D_ mpp_max_int4_1d
940 #undef MPP_TYPE_
941 #define MPP_TYPE_ integer(i4_kind)
942 #undef MPP_TYPE_BYTELEN_
943 #define MPP_TYPE_BYTELEN_ 4
944 #undef MPI_TYPE_
945 #define MPI_TYPE_ MPI_INTEGER4
946 #undef MPI_REDUCE_
947 #define MPI_REDUCE_ MPI_MAX
948 #include <mpp_reduce_mpi.fh>
949 
950 #undef MPP_REDUCE_0D_
951 #define MPP_REDUCE_0D_ mpp_min_real8_0d
952 #undef MPP_REDUCE_1D_
953 #define MPP_REDUCE_1D_ mpp_min_real8_1d
954 #undef MPP_TYPE_
955 #define MPP_TYPE_ real(r8_kind)
956 #undef MPP_TYPE_BYTELEN_
957 #define MPP_TYPE_BYTELEN_ 8
958 #undef MPI_TYPE_
959 #define MPI_TYPE_ MPI_REAL8
960 #undef MPI_REDUCE_
961 #define MPI_REDUCE_ MPI_MIN
962 #include <mpp_reduce_mpi.fh>
963 
964 #undef MPP_REDUCE_0D_
965 #define MPP_REDUCE_0D_ mpp_min_real4_0d
966 #undef MPP_REDUCE_1D_
967 #define MPP_REDUCE_1D_ mpp_min_real4_1d
968 #undef MPP_TYPE_
969 #define MPP_TYPE_ real(r4_kind)
970 #undef MPP_TYPE_BYTELEN_
971 #define MPP_TYPE_BYTELEN_ 4
972 #undef MPI_TYPE_
973 #define MPI_TYPE_ MPI_REAL4
974 #undef MPI_REDUCE_
975 #define MPI_REDUCE_ MPI_MIN
976 #include <mpp_reduce_mpi.fh>
977 
978 #undef MPP_REDUCE_0D_
979 #define MPP_REDUCE_0D_ mpp_min_int8_0d
980 #undef MPP_REDUCE_1D_
981 #define MPP_REDUCE_1D_ mpp_min_int8_1d
982 #undef MPP_TYPE_
983 #define MPP_TYPE_ integer(i8_kind)
984 #undef MPP_TYPE_BYTELEN_
985 #define MPP_TYPE_BYTELEN_ 8
986 #undef MPI_TYPE_
987 #define MPI_TYPE_ MPI_INTEGER8
988 #undef MPI_REDUCE_
989 #define MPI_REDUCE_ MPI_MIN
990 #include <mpp_reduce_mpi.fh>
991 
992 #undef MPP_REDUCE_0D_
993 #define MPP_REDUCE_0D_ mpp_min_int4_0d
994 #undef MPP_REDUCE_1D_
995 #define MPP_REDUCE_1D_ mpp_min_int4_1d
996 #undef MPP_TYPE_
997 #define MPP_TYPE_ integer(i4_kind)
998 #undef MPP_TYPE_BYTELEN_
999 #define MPP_TYPE_BYTELEN_ 4
1000 #undef MPI_TYPE_
1001 #define MPI_TYPE_ MPI_INTEGER4
1002 #undef MPI_REDUCE_
1003 #define MPI_REDUCE_ MPI_MIN
1004 #include <mpp_reduce_mpi.fh>
1005 
1006 #undef MPP_SUM_
1007 #define MPP_SUM_ mpp_sum_real8
1008 #undef MPP_SUM_SCALAR_
1009 #define MPP_SUM_SCALAR_ mpp_sum_real8_scalar
1010 #undef MPP_SUM_2D_
1011 #define MPP_SUM_2D_ mpp_sum_real8_2d
1012 #undef MPP_SUM_3D_
1013 #define MPP_SUM_3D_ mpp_sum_real8_3d
1014 #undef MPP_SUM_4D_
1015 #define MPP_SUM_4D_ mpp_sum_real8_4d
1016 #undef MPP_SUM_5D_
1017 #define MPP_SUM_5D_ mpp_sum_real8_5d
1018 #undef MPP_TYPE_
1019 #define MPP_TYPE_ real(r8_kind)
1020 #undef MPI_TYPE_
1021 #define MPI_TYPE_ MPI_REAL8
1022 #undef MPP_TYPE_BYTELEN_
1023 #define MPP_TYPE_BYTELEN_ 8
1024 #include <mpp_sum_mpi.fh>
1025 
1026 #ifdef OVERLOAD_C8
1027 #undef MPP_SUM_
1028 #define MPP_SUM_ mpp_sum_cmplx8
1029 #undef MPP_SUM_SCALAR_
1030 #define MPP_SUM_SCALAR_ mpp_sum_cmplx8_scalar
1031 #undef MPP_SUM_2D_
1032 #define MPP_SUM_2D_ mpp_sum_cmplx8_2d
1033 #undef MPP_SUM_3D_
1034 #define MPP_SUM_3D_ mpp_sum_cmplx8_3d
1035 #undef MPP_SUM_4D_
1036 #define MPP_SUM_4D_ mpp_sum_cmplx8_4d
1037 #undef MPP_SUM_5D_
1038 #define MPP_SUM_5D_ mpp_sum_cmplx8_5d
1039 #undef MPP_TYPE_
1040 #define MPP_TYPE_ complex(c8_kind)
1041 #undef MPI_TYPE_
1042 #define MPI_TYPE_ MPI_DOUBLE_COMPLEX
1043 #undef MPP_TYPE_BYTELEN_
1044 #define MPP_TYPE_BYTELEN_ 16
1045 #include <mpp_sum_mpi.fh>
1046 #endif
1047 
1048 #undef MPP_SUM_
1049 #define MPP_SUM_ mpp_sum_real4
1050 #undef MPP_SUM_SCALAR_
1051 #define MPP_SUM_SCALAR_ mpp_sum_real4_scalar
1052 #undef MPP_SUM_2D_
1053 #define MPP_SUM_2D_ mpp_sum_real4_2d
1054 #undef MPP_SUM_3D_
1055 #define MPP_SUM_3D_ mpp_sum_real4_3d
1056 #undef MPP_SUM_4D_
1057 #define MPP_SUM_4D_ mpp_sum_real4_4d
1058 #undef MPP_SUM_5D_
1059 #define MPP_SUM_5D_ mpp_sum_real4_5d
1060 #undef MPP_TYPE_
1061 #define MPP_TYPE_ real(r4_kind)
1062 #undef MPI_TYPE_
1063 #define MPI_TYPE_ MPI_REAL4
1064 #undef MPP_TYPE_BYTELEN_
1065 #define MPP_TYPE_BYTELEN_ 4
1066 #include <mpp_sum_mpi.fh>
1067 
1068 #ifdef OVERLOAD_C4
1069 #undef MPP_SUM_
1070 #define MPP_SUM_ mpp_sum_cmplx4
1071 #undef MPP_SUM_SCALAR_
1072 #define MPP_SUM_SCALAR_ mpp_sum_cmplx4_scalar
1073 #undef MPP_SUM_2D_
1074 #define MPP_SUM_2D_ mpp_sum_cmplx4_2d
1075 #undef MPP_SUM_3D_
1076 #define MPP_SUM_3D_ mpp_sum_cmplx4_3d
1077 #undef MPP_SUM_4D_
1078 #define MPP_SUM_4D_ mpp_sum_cmplx4_4d
1079 #undef MPP_SUM_5D_
1080 #define MPP_SUM_5D_ mpp_sum_cmplx4_5d
1081 #undef MPP_TYPE_
1082 #define MPP_TYPE_ complex(c4_kind)
1083 #undef MPI_TYPE_
1084 #define MPI_TYPE_ MPI_COMPLEX
1085 #undef MPP_TYPE_BYTELEN_
1086 #define MPP_TYPE_BYTELEN_ 8
1087 #include <mpp_sum_mpi.fh>
1088 #endif
1089 
1090 #undef MPP_SUM_
1091 #define MPP_SUM_ mpp_sum_int8
1092 #undef MPP_SUM_SCALAR_
1093 #define MPP_SUM_SCALAR_ mpp_sum_int8_scalar
1094 #undef MPP_SUM_2D_
1095 #define MPP_SUM_2D_ mpp_sum_int8_2d
1096 #undef MPP_SUM_3D_
1097 #define MPP_SUM_3D_ mpp_sum_int8_3d
1098 #undef MPP_SUM_4D_
1099 #define MPP_SUM_4D_ mpp_sum_int8_4d
1100 #undef MPP_SUM_5D_
1101 #define MPP_SUM_5D_ mpp_sum_int8_5d
1102 #undef MPP_TYPE_
1103 #define MPP_TYPE_ integer(i8_kind)
1104 #undef MPI_TYPE_
1105 #define MPI_TYPE_ MPI_INTEGER8
1106 #undef MPP_TYPE_BYTELEN_
1107 #define MPP_TYPE_BYTELEN_ 8
1108 #include <mpp_sum_mpi.fh>
1109 
1110 #undef MPP_SUM_
1111 #define MPP_SUM_ mpp_sum_int4
1112 #undef MPP_SUM_SCALAR_
1113 #define MPP_SUM_SCALAR_ mpp_sum_int4_scalar
1114 #undef MPP_SUM_2D_
1115 #define MPP_SUM_2D_ mpp_sum_int4_2d
1116 #undef MPP_SUM_3D_
1117 #define MPP_SUM_3D_ mpp_sum_int4_3d
1118 #undef MPP_SUM_4D_
1119 #define MPP_SUM_4D_ mpp_sum_int4_4d
1120 #undef MPP_SUM_5D_
1121 #define MPP_SUM_5D_ mpp_sum_int4_5d
1122 #undef MPP_TYPE_
1123 #define MPP_TYPE_ integer(i4_kind)
1124 #undef MPI_TYPE_
1125 #define MPI_TYPE_ MPI_INTEGER4
1126 #undef MPP_TYPE_BYTELEN_
1127 #define MPP_TYPE_BYTELEN_ 4
1128 #include <mpp_sum_mpi.fh>
1129 !--------------------------------
1130 #undef MPP_SUM_AD_
1131 #define MPP_SUM_AD_ mpp_sum_real8_ad
1132 #undef MPP_SUM_SCALAR_AD_
1133 #define MPP_SUM_SCALAR_AD_ mpp_sum_real8_scalar_ad
1134 #undef MPP_SUM_2D_AD_
1135 #define MPP_SUM_2D_AD_ mpp_sum_real8_2d_ad
1136 #undef MPP_SUM_3D_AD_
1137 #define MPP_SUM_3D_AD_ mpp_sum_real8_3d_ad
1138 #undef MPP_SUM_4D_AD_
1139 #define MPP_SUM_4D_AD_ mpp_sum_real8_4d_ad
1140 #undef MPP_SUM_5D_AD_
1141 #define MPP_SUM_5D_AD_ mpp_sum_real8_5d_ad
1142 #undef MPP_TYPE_
1143 #define MPP_TYPE_ real(r8_kind)
1144 #undef MPI_TYPE_
1145 #define MPI_TYPE_ MPI_REAL8
1146 #undef MPP_TYPE_BYTELEN_
1147 #define MPP_TYPE_BYTELEN_ 8
1148 #include <mpp_sum_mpi_ad.fh>
1149 
1150 #ifdef OVERLOAD_C8
1151 #undef MPP_SUM_AD_
1152 #define MPP_SUM_AD_ mpp_sum_cmplx8_ad
1153 #undef MPP_SUM_SCALAR_AD_
1154 #define MPP_SUM_SCALAR_AD_ mpp_sum_cmplx8_scalar_ad
1155 #undef MPP_SUM_2D_AD_
1156 #define MPP_SUM_2D_AD_ mpp_sum_cmplx8_2d_ad
1157 #undef MPP_SUM_3D_AD_
1158 #define MPP_SUM_3D_AD_ mpp_sum_cmplx8_3d_ad
1159 #undef MPP_SUM_4D_AD_
1160 #define MPP_SUM_4D_AD_ mpp_sum_cmplx8_4d_ad
1161 #undef MPP_SUM_5D_AD_
1162 #define MPP_SUM_5D_AD_ mpp_sum_cmplx8_5d_ad
1163 #undef MPP_TYPE_
1164 #define MPP_TYPE_ complex(c8_kind)
1165 #undef MPI_TYPE_
1166 #define MPI_TYPE_ MPI_DOUBLE_COMPLEX
1167 #undef MPP_TYPE_BYTELEN_
1168 #define MPP_TYPE_BYTELEN_ 16
1169 #include <mpp_sum_mpi_ad.fh>
1170 #endif
1171 
1172 #undef MPP_SUM_AD_
1173 #define MPP_SUM_AD_ mpp_sum_real4_ad
1174 #undef MPP_SUM_SCALAR_AD_
1175 #define MPP_SUM_SCALAR_AD_ mpp_sum_real4_scalar_ad
1176 #undef MPP_SUM_2D_AD_
1177 #define MPP_SUM_2D_AD_ mpp_sum_real4_2d_ad
1178 #undef MPP_SUM_3D_AD_
1179 #define MPP_SUM_3D_AD_ mpp_sum_real4_3d_ad
1180 #undef MPP_SUM_4D_AD_
1181 #define MPP_SUM_4D_AD_ mpp_sum_real4_4d_ad
1182 #undef MPP_SUM_5D_AD_
1183 #define MPP_SUM_5D_AD_ mpp_sum_real4_5d_ad
1184 #undef MPP_TYPE_
1185 #define MPP_TYPE_ real(r4_kind)
1186 #undef MPI_TYPE_
1187 #define MPI_TYPE_ MPI_REAL4
1188 #undef MPP_TYPE_BYTELEN_
1189 #define MPP_TYPE_BYTELEN_ 4
1190 #include <mpp_sum_mpi_ad.fh>
1191 
1192 #ifdef OVERLOAD_C4
1193 #undef MPP_SUM_AD_
1194 #define MPP_SUM_AD_ mpp_sum_cmplx4_ad
1195 #undef MPP_SUM_SCALAR_AD_
1196 #define MPP_SUM_SCALAR_AD_ mpp_sum_cmplx4_scalar_ad
1197 #undef MPP_SUM_2D_AD_
1198 #define MPP_SUM_2D_AD_ mpp_sum_cmplx4_2d_ad
1199 #undef MPP_SUM_3D_AD_
1200 #define MPP_SUM_3D_AD_ mpp_sum_cmplx4_3d_ad
1201 #undef MPP_SUM_4D_AD_
1202 #define MPP_SUM_4D_AD_ mpp_sum_cmplx4_4d_ad
1203 #undef MPP_SUM_5D_AD_
1204 #define MPP_SUM_5D_AD_ mpp_sum_cmplx4_5d_ad
1205 #undef MPP_TYPE_
1206 #define MPP_TYPE_ complex(c4_kind)
1207 #undef MPI_TYPE_
1208 #define MPI_TYPE_ MPI_COMPLEX
1209 #undef MPP_TYPE_BYTELEN_
1210 #define MPP_TYPE_BYTELEN_ 8
1211 #include <mpp_sum_mpi_ad.fh>
1212 #endif
1213 
1214 #undef MPP_SUM_AD_
1215 #define MPP_SUM_AD_ mpp_sum_int8_ad
1216 #undef MPP_SUM_SCALAR_AD_
1217 #define MPP_SUM_SCALAR_AD_ mpp_sum_int8_scalar_ad
1218 #undef MPP_SUM_2D_AD_
1219 #define MPP_SUM_2D_AD_ mpp_sum_int8_2d_ad
1220 #undef MPP_SUM_3D_AD_
1221 #define MPP_SUM_3D_AD_ mpp_sum_int8_3d_ad
1222 #undef MPP_SUM_4D_AD_
1223 #define MPP_SUM_4D_AD_ mpp_sum_int8_4d_ad
1224 #undef MPP_SUM_5D_AD_
1225 #define MPP_SUM_5D_AD_ mpp_sum_int8_5d_ad
1226 #undef MPP_TYPE_
1227 #define MPP_TYPE_ integer(i8_kind)
1228 #undef MPI_TYPE_
1229 #define MPI_TYPE_ MPI_INTEGER8
1230 #undef MPP_TYPE_BYTELEN_
1231 #define MPP_TYPE_BYTELEN_ 8
1232 #include <mpp_sum_mpi_ad.fh>
1233 
1234 #undef MPP_SUM_AD_
1235 #define MPP_SUM_AD_ mpp_sum_int4_ad
1236 #undef MPP_SUM_SCALAR_AD_
1237 #define MPP_SUM_SCALAR_AD_ mpp_sum_int4_scalar_ad
1238 #undef MPP_SUM_2D_AD_
1239 #define MPP_SUM_2D_AD_ mpp_sum_int4_2d_ad
1240 #undef MPP_SUM_3D_AD_
1241 #define MPP_SUM_3D_AD_ mpp_sum_int4_3d_ad
1242 #undef MPP_SUM_4D_AD_
1243 #define MPP_SUM_4D_AD_ mpp_sum_int4_4d_ad
1244 #undef MPP_SUM_5D_AD_
1245 #define MPP_SUM_5D_AD_ mpp_sum_int4_5d_ad
1246 #undef MPP_TYPE_
1247 #define MPP_TYPE_ integer(i4_kind)
1248 #undef MPI_TYPE_
1249 #define MPI_TYPE_ MPI_INTEGER4
1250 #undef MPP_TYPE_BYTELEN_
1251 #define MPP_TYPE_BYTELEN_ 4
1252 #include <mpp_sum_mpi_ad.fh>
1253 
1254 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1255 ! !
1256 ! SCATTER AND GATHER ROUTINES: mpp_alltoall !
1257 ! !
1258 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1259 
1260 #undef MPP_ALLTOALL_
1261 #undef MPP_ALLTOALLV_
1262 #undef MPP_ALLTOALLW_
1263 #undef MPP_TYPE_
1264 #undef MPP_TYPE_BYTELEN_
1265 #undef MPI_TYPE_
1266 #define MPP_ALLTOALL_ mpp_alltoall_int4
1267 #define MPP_ALLTOALLV_ mpp_alltoall_int4_v
1268 #define MPP_ALLTOALLW_ mpp_alltoall_int4_w
1269 #define MPP_TYPE_ integer(i4_kind)
1270 #define MPP_TYPE_BYTELEN_ 4
1271 #define MPI_TYPE_ MPI_INTEGER4
1272 #include <mpp_alltoall_mpi.fh>
1273 
1274 #undef MPP_ALLTOALL_
1275 #undef MPP_ALLTOALLV_
1276 #undef MPP_ALLTOALLW_
1277 #undef MPP_TYPE_
1278 #undef MPP_TYPE_BYTELEN_
1279 #undef MPI_TYPE_
1280 #define MPP_ALLTOALL_ mpp_alltoall_int8
1281 #define MPP_ALLTOALLV_ mpp_alltoall_int8_v
1282 #define MPP_ALLTOALLW_ mpp_alltoall_int8_w
1283 #define MPP_TYPE_ integer(i8_kind)
1284 #define MPP_TYPE_BYTELEN_ 8
1285 #define MPI_TYPE_ MPI_INTEGER8
1286 #include <mpp_alltoall_mpi.fh>
1287 
1288 #undef MPP_ALLTOALL_
1289 #undef MPP_ALLTOALLV_
1290 #undef MPP_ALLTOALLW_
1291 #undef MPP_TYPE_
1292 #undef MPP_TYPE_BYTELEN_
1293 #undef MPI_TYPE_
1294 #define MPP_ALLTOALL_ mpp_alltoall_real4
1295 #define MPP_ALLTOALLV_ mpp_alltoall_real4_v
1296 #define MPP_ALLTOALLW_ mpp_alltoall_real4_w
1297 #define MPP_TYPE_ real(r4_kind)
1298 #define MPP_TYPE_BYTELEN_ 4
1299 #define MPI_TYPE_ MPI_REAL4
1300 #include <mpp_alltoall_mpi.fh>
1301 
1302 #undef MPP_ALLTOALL_
1303 #undef MPP_ALLTOALLV_
1304 #undef MPP_ALLTOALLW_
1305 #undef MPP_TYPE_
1306 #undef MPP_TYPE_BYTELEN_
1307 #undef MPI_TYPE_
1308 #define MPP_ALLTOALL_ mpp_alltoall_real8
1309 #define MPP_ALLTOALLV_ mpp_alltoall_real8_v
1310 #define MPP_ALLTOALLW_ mpp_alltoall_real8_w
1311 #define MPP_TYPE_ real(r8_kind)
1312 #define MPP_TYPE_BYTELEN_ 8
1313 #define MPI_TYPE_ MPI_REAL8
1314 #include <mpp_alltoall_mpi.fh>
1315 
1316 #ifdef OVERLOAD_C4
1317 #undef MPP_ALLTOALL_
1318 #undef MPP_ALLTOALLV_
1319 #undef MPP_ALLTOALLW_
1320 #undef MPP_TYPE_
1321 #undef MPP_TYPE_BYTELEN_
1322 #undef MPI_TYPE_
1323 #define MPP_ALLTOALL_ mpp_alltoall_cmplx4
1324 #define MPP_ALLTOALLV_ mpp_alltoall_cmplx4_v
1325 #define MPP_ALLTOALLW_ mpp_alltoall_cmplx4_w
1326 #define MPP_TYPE_ complex(c4_kind)
1327 #define MPP_TYPE_BYTELEN_ 8
1328 #define MPI_TYPE_ MPI_COMPLEX8
1329 #include <mpp_alltoall_mpi.fh>
1330 #endif
1331 
1332 #ifdef OVERLOAD_C8
1333 #undef MPP_ALLTOALL_
1334 #undef MPP_ALLTOALLV_
1335 #undef MPP_ALLTOALLW_
1336 #undef MPP_TYPE_
1337 #undef MPP_TYPE_BYTELEN_
1338 #undef MPI_TYPE_
1339 #define MPP_ALLTOALL_ mpp_alltoall_cmplx8
1340 #define MPP_ALLTOALLV_ mpp_alltoall_cmplx8_v
1341 #define MPP_ALLTOALLW_ mpp_alltoall_cmplx8_w
1342 #define MPP_TYPE_ complex(c8_kind)
1343 #define MPP_TYPE_BYTELEN_ 16
1344 #define MPI_TYPE_ MPI_COMPLEX16
1345 #include <mpp_alltoall_mpi.fh>
1346 #endif
1347 
1348 #undef MPP_ALLTOALL_
1349 #undef MPP_ALLTOALLV_
1350 #undef MPP_ALLTOALLW_
1351 #undef MPP_TYPE_
1352 #undef MPP_TYPE_BYTELEN_
1353 #undef MPI_TYPE_
1354 #define MPP_ALLTOALL_ mpp_alltoall_logical4
1355 #define MPP_ALLTOALLV_ mpp_alltoall_logical4_v
1356 #define MPP_ALLTOALLW_ mpp_alltoall_logical4_w
1357 #define MPP_TYPE_ logical(l4_kind)
1358 #define MPP_TYPE_BYTELEN_ 4
1359 #define MPI_TYPE_ MPI_INTEGER4
1360 #include <mpp_alltoall_mpi.fh>
1361 
1362 #undef MPP_ALLTOALL_
1363 #undef MPP_ALLTOALLV_
1364 #undef MPP_ALLTOALLW_
1365 #undef MPP_TYPE_
1366 #undef MPP_TYPE_BYTELEN_
1367 #undef MPI_TYPE_
1368 #define MPP_ALLTOALL_ mpp_alltoall_logical8
1369 #define MPP_ALLTOALLV_ mpp_alltoall_logical8_v
1370 #define MPP_ALLTOALLW_ mpp_alltoall_logical8_w
1371 #define MPP_TYPE_ logical(l8_kind)
1372 #define MPP_TYPE_BYTELEN_ 8
1373 #define MPI_TYPE_ MPI_INTEGER8
1374 #include <mpp_alltoall_mpi.fh>
1375 
1376 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1377 ! !
1378 ! DATA TRANSFER TYPES: mpp_type_create, mpp_type_free !
1379 ! !
1380 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1381 
1382 #undef MPP_TYPE_CREATE_
1383 #undef MPP_TYPE_
1384 #undef MPI_TYPE_
1385 #define MPP_TYPE_CREATE_ mpp_type_create_int4
1386 #define MPP_TYPE_ integer(i4_kind)
1387 #define MPI_TYPE_ MPI_INTEGER4
1388 #include <mpp_type_mpi.fh>
1389 
1390 #undef MPP_TYPE_CREATE_
1391 #undef MPP_TYPE_
1392 #undef MPI_TYPE_
1393 #define MPP_TYPE_CREATE_ mpp_type_create_int8
1394 #define MPP_TYPE_ integer(i8_kind)
1395 #define MPI_TYPE_ MPI_INTEGER8
1396 #include <mpp_type_mpi.fh>
1397 
1398 #undef MPP_TYPE_CREATE_
1399 #undef MPP_TYPE_
1400 #undef MPI_TYPE_
1401 #define MPP_TYPE_CREATE_ mpp_type_create_real4
1402 #define MPP_TYPE_ real(r4_kind)
1403 #define MPI_TYPE_ MPI_REAL4
1404 #include <mpp_type_mpi.fh>
1405 
1406 #undef MPP_TYPE_CREATE_
1407 #undef MPP_TYPE_
1408 #undef MPI_TYPE_
1409 #define MPP_TYPE_CREATE_ mpp_type_create_real8
1410 #define MPP_TYPE_ real(r8_kind)
1411 #define MPI_TYPE_ MPI_REAL8
1412 #include <mpp_type_mpi.fh>
1413 
1414 #undef MPP_TYPE_CREATE_
1415 #undef MPP_TYPE_
1416 #undef MPI_TYPE_
1417 #define MPP_TYPE_CREATE_ mpp_type_create_cmplx4
1418 #define MPP_TYPE_ complex(c4_kind)
1419 #define MPI_TYPE_ MPI_COMPLEX8
1420 #include <mpp_type_mpi.fh>
1421 
1422 #undef MPP_TYPE_CREATE_
1423 #undef MPP_TYPE_
1424 #undef MPI_TYPE_
1425 #define MPP_TYPE_CREATE_ mpp_type_create_cmplx8
1426 #define MPP_TYPE_ complex(c8_kind)
1427 #define MPI_TYPE_ MPI_COMPLEX16
1428 #include <mpp_type_mpi.fh>
1429 
1430 #undef MPP_TYPE_CREATE_
1431 #undef MPP_TYPE_
1432 #undef MPI_TYPE_
1433 #define MPP_TYPE_CREATE_ mpp_type_create_logical4
1434 #define MPP_TYPE_ logical(l4_kind)
1435 #define MPI_TYPE_ MPI_INTEGER4
1436 #include <mpp_type_mpi.fh>
1437 
1438 #undef MPP_TYPE_CREATE_
1439 #undef MPP_TYPE_
1440 #undef MPI_TYPE_
1441 #define MPP_TYPE_CREATE_ mpp_type_create_logical8
1442 #define MPP_TYPE_ logical(l8_kind)
1443 #define MPI_TYPE_ MPI_INTEGER8
1444 #include <mpp_type_mpi.fh>
1445 
1446 ! Clear preprocessor flags
1447 #undef MPI_TYPE_
1448 #undef MPP_TYPE_
1449 #undef MPP_TYPE_CREATE_
1450 
1451 !> Deallocates memory for mpp_type objects
1452 !! @TODO This should probably not take a pointer, but for now we do this.
1453 subroutine mpp_type_free(dtype)
1454  type(mpp_type), pointer, intent(inout) :: dtype
1455 
1456  if (.NOT. module_is_initialized) &
1457  call mpp_error(fatal, 'MPP_TYPE_FREE: You must first call mpp_init.')
1458 
1459  if (current_clock .NE. 0) &
1460  call system_clock(start_tick)
1461 
1462  if (verbose) &
1463  call mpp_error(note, 'MPP_TYPE_FREE: using MPI_Type_free...')
1464 
1465  ! Decrement the reference counter
1466  dtype%counter = dtype%counter - 1
1467 
1468  if (dtype%counter < 1) then
1469  ! Remove from list
1470  dtype%prev => dtype%next
1471  datatypes%length = datatypes%length - 1
1472 
1473  ! Free resources
1474  deallocate(dtype%sizes)
1475  deallocate(dtype%subsizes)
1476  deallocate(dtype%starts)
1477 
1478  ! User-defined datatype cleanup
1479  if (dtype%id /= mpi_byte) then
1480  call mpi_type_free(dtype%id, error)
1481  deallocate(dtype)
1482  endif
1483  end if
1484 
1485  if (current_clock .NE. 0) &
1486  call increment_current_clock(event_type_free, mpp_type_bytelen_)
1487 
1488 end subroutine mpp_type_free
1489 !> @}
integer function stdout()
This function returns the current standard fortran unit numbers for output.
Definition: mpp_util.inc:42
subroutine mpp_init_warninglog()
Opens the warning log file, called during mpp_init.
Definition: mpp_util.inc:124
subroutine mpp_set_current_pelist(pelist, no_sync)
Set context pelist.
Definition: mpp_util.inc:514
integer function stderr()
This function returns the current standard fortran unit numbers for error messages.
Definition: mpp_util.inc:50
subroutine read_input_nml(pelist_name_in, alt_input_nml_path)
Reads an existing input nml file into a character array and broadcasts it to the non-root mpi-tasks....
Definition: mpp_util.inc:1250
subroutine mpp_type_free(dtype)
Deallocates memory for mpp_type objects @TODO This should probably not take a pointer,...
subroutine mpp_exit()
Finalizes process termination. To be called at the end of a run. Certain mpi implementations(openmpi)...
integer function stdlog()
This function returns the current standard fortran unit numbers for log messages. Log messages,...
Definition: mpp_util.inc:58
subroutine mpp_init_f08(flags, localcomm, test_level, alt_input_nml_path)
Initialize the mpp_mod module. Must be called before any usage.
integer function mpp_npes()
Returns processor count for current pelist.
Definition: mpp_util.inc:420
subroutine mpp_set_stack_size(n)
Set the mpp_stack variable to be at least n LONG words long.
integer function mpp_pe()
Returns processor ID.
Definition: mpp_util.inc:406
subroutine mpp_sync(pelist, do_self)
Synchronize PEs in list.
integer function mpp_clock_id(name, flags, grain)
Return an ID for a new or existing clock.
Definition: mpp_util.inc:736
subroutine mpp_broadcast_char(char_data, length, from_pe, pelist)
Broadcasts a character string from the given pe to it's pelist.