subroutine gather_tmp4(u_i) use m_parameters use m_io use m_work implicit none integer :: i,j,k real*8, dimension(nx,ny,nz_all) :: u_i !====================================================================== ! --- defining the size of whole array count = nx*ny*nz if (myid.ne.master) then id_to = master tag = myid call MPI_SEND(tmp4,count,MPI_REAL8,master,tag,MPI_COMM_TASK,mpi_err) else u_i(:,:,1:nz) = tmp4(:,:,:) do id_from=1,numprocs-1 tag = id_from call MPI_RECV(tmp4,count,MPI_REAL8,id_from,tag,MPI_COMM_TASK,mpi_status,mpi_err) u_i(:,:,id_from*nz+1:id_from*nz+nz) = tmp4(:,:,:) end do end if !====================================================================== return end subroutine gather_tmp4