subroutine exchng1( a, nx, s, e, comm1d, bottom_nbr, top_nbr )
include 'mpif.h'
integer nx, s, e
double precision a(0:nx+1,s-1:e+1)
integer comm1d, bottom_nbr, top_nbr
integer status_array(MPI_STATUS_SIZE,4), ierr, req(4)
C
call MPI_IRECV ( a(1,s-1), nx, MPI_DOUBLE_PRECISION, bottom_nbr,
* 0, comm1d, req(1), ierr )
call MPI_ISEND ( a(1,e), nx, MPI_DOUBLE_PRECISION, top_nbr, 0,
* comm1d, req(3), ierr )
call MPI_IRECV ( a(1,e+1), nx, MPI_DOUBLE_PRECISION, top_nbr, 1,
* comm1d, req(2), ierr )
call MPI_ISEND ( a(1,s), nx, MPI_DOUBLE_PRECISION, bottom_nbr, 1,
* comm1d, req(4), ierr )
C
call MPI_WAITALL ( 4, req, status_array, ierr )
return
end