      SUBROUTINE host (nchans, chan)
      IMPLICIT NONE
      INTEGER nchans
      INTEGER chan
      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)
      INTEGER result
      CALL INPUT (chan, result, 1, 0)
      print *, 'Called OUTPUT on worker, result = ', result
      END

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