call mpi_recv (message, size, MPI_PACKED,
MPI_ANY_SOURCE, MPI_ANY_TAG,
comm, status, ierr)
pos = 0
call mpi_unpack (message, size, pos,
typeid, 1, MPI_INTEGER,
comm, ierr)
do while (typeid .gt. 0)
call mpi_unpack (message, size, pos,
nitems, 1, MPI_INTEGER,
comm, ierr)
if (typeid .eq. 1) then
UNPACK INTEGERS
else
UNPACK REALS
end if
call mpi_unpack (message, size, pos,
typeid, 1, MPI_INTEGER,
comm, ierr)
end do