      SUBROUTINE host (nchans, chan)
      IMPLICIT NONE
      INTEGER nchans, chan
      INTEGER i, item
      DO 10 i = 1, 27
        CALL INPUT (chan, item, 1, 0)
      print *, 'Host input', item
10    CONTINUE
      END

      SUBROUTINE worker (nchans, chan, dim, rank)
      IMPLICIT NONE
      INTEGER dim, nchans
      INTEGER chan, x, y, z, place(0:3, 0:3, 0:3)
      INTEGER rank (0 : dim - 1), wkr, ix, iy, iz
      INTEGER Icoord
      x = rank(0)
      y = rank(1)
      z = rank(2)
      wkr = 4 * Icoord(x) + 2 * Icoord(y) + Icoord(z)
      DO 20 ix = 0, Icoord(x)
        DO 30 iy = 0, Icoord(y)
          DO 40 iz = 0, Icoord(z)
            place(ix, iy, iz) = wkr
40        CONTINUE
30      CONTINUE
20    CONTINUE
      print *, 'Worker calling OU3DAR'
      CALL OU3DAR (chan, x, y, z,  1 + Icoord(x),
     :         1+Icoord(y), 1+Icoord(z),  place, 1, 4, 4, 4, 0)
      END

      IMPLICIT NONE
	EXTERNAL host, worker
	INTEGER xid, yid, zid
	INTEGER xsize, ysize, zsize
	INTEGER chan
	INTEGER rank (3)
	PARAMETER (xid   = 0, yid = 1, zid = 2)
	PARAMETER (xsize = 2, ysize = 2, zsize = 2)
	PARAMETER (chan = 0)
	DATA rank /xid, yid, zid/
	CALL acbegn ()
	CALL acindx (xid, xsize)
        CALL acindx (yid, ysize)
        CALL acindx (zid, zsize)
	CALL acchan (chan, 0)
	CALL acarry (host,   1, chan, 0)
	CALL acarry (worker, 1, chan, 3, rank)
	CALL acdone ()
      END
