To pack data:
mpi_pack (inbuf, incount, datatype, outbuf, outsize, position, comm, ierr)
This takes incount items of specified datatype from buffer inbuf and packs them into outbuf starting at offset position.