subroutine create_MPI_data_type(nx,ny,nz,locnx,locnz, * twoslice,subslice,myid,comm) c Routine to create a specialized data type for MPI data swaps c between processors. See real and complex data maps for details. implicit none #include "mpif.h" integer nx,ny,nz,locnx,locnz integer myid,comm,ierr integer sizeofreal,oneslice,twoslice,subslice call MPI_TYPE_EXTENT(MPI_REAL,sizeofreal,ierr) c data type for 1d section of basic data slice: 2*locnx call MPI_TYPE_VECTOR(2*locnx,1,1,MPI_REAL,oneslice,ierr) c data type for 2d section of basic data slice: ny+1 1d sections call MPI_TYPE_HVECTOR(ny+1,1,(nx+2)*sizeofreal,oneslice,twoslice,ierr) if( myid .eq. 0 ) then if( ierr .ne. 0 ) write(6,*) ' TYPE_HVECTOR twoslice failure' endif call MPI_TYPE_COMMIT(twoslice,ierr) c data type for 3d section of basic data slice: locnz 2d sections call MPI_TYPE_HVECTOR(locnz,1,(nx+2)*(ny+1)*sizeofreal, * twoslice,subslice,ierr) if( myid .eq. 0 ) then if( ierr .ne. 0 ) write(6,*) ' TYPE_HVECTOR subslice failure' endif call MPI_TYPE_COMMIT(subslice,ierr) return end