      SUBROUTINE host (nchans, chan)
      IMPLICIT NONE
      INTEGER nchans, chan
      INTEGER i, item
      DO 10 i = 1, 9
        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
      INTEGER rank (0 : dim - 1)
      INTEGER Icoord
      x = rank(0)
      y = rank(1)
      CALL OU2D (chan, x, y, 3 * Icoord(x) + Icoord(y), 1, 0)
      END

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