      SUBROUTINE host (nchans, chan)
      IMPLICIT NONE
      INTEGER nchans
      INTEGER chan
      LOGICAL report
      INTEGER local, procid
      COMMON /acids/ report, local, procid
      INTEGER result
      CALL OUTPUT (chan, 37, 1, 0)
      END

      SUBROUTINE worker (nchans, chan, dim, rank)
      IMPLICIT NONE
      INTEGER dim, nchans
      INTEGER chan
      INTEGER rank (0 : dim - 1)
      LOGICAL report
      INTEGER local, procid, result
      COMMON /acids/ report, local, procid
      CALL INPUT (chan, result, 1, 0)
      WRITE (6, *) 'result =', result
      END

      IMPLICIT NONE
	EXTERNAL host, worker
	INTEGER xid, yid
	INTEGER xsize, ysize
	INTEGER chan
	INTEGER rank (2)
	PARAMETER (xid   = 0, yid   = 1)
	PARAMETER (xsize = 2, 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
