1! This file created from f77/datatype/gaddressf.f with f77tof90
2!
3! Copyright (C) by Argonne National Laboratory
4!     See COPYRIGHT in top-level directory
5!
6
7      program main
8      use mpi
9      integer max_asizev
10      parameter (max_asizev=2)
11      integer (kind=MPI_ADDRESS_KIND) aint, aintv(max_asizev)
12
13      integer iarray(200), gap, intsize
14      integer ierr, errs
15
16      errs = 0
17
18      call MPI_Init(ierr)
19
20      call MPI_Get_address( iarray(1), aintv(1), ierr )
21      call MPI_Get_address( iarray(200), aintv(2), ierr )
22      gap = aintv(2) - aintv(1)
23
24      call MPI_Type_size( MPI_INTEGER, intsize, ierr )
25
26      if (gap .ne. 199 * intsize) then
27         errs = errs + 1
28         print *, ' Using get_address, computed a gap of ', gap
29         print *, ' Expected a gap of ', 199 * intsize
30      endif
31      if (errs .gt. 0) then
32          print *, ' Found ', errs, ' errors'
33      else
34          print *, ' No Errors'
35      endif
36
37      call MPI_Finalize( ierr )
38      end
39