c
c	gxand.f 1.4 92/07/01 15:20:47
c
c  Copyright 1991 Intel Corporation, Inc.
c  See the "Copyright" file for complete rights and liability information.
c
c  Performs a bitwise AND on a vector and its bitwise-complement.
c  A vector bitwise ANDed with its own bitwise-complement is all
c  zeroes.
c
c  The gland() call works similarly to giand().

      integer iam
      integer x(5), work(5)

c  Identify self.

      iam = mynode()

c  Node 0 builds simple vector.

      if(iam .eq. 0) then

         print *, 'Starting ...'

         do 1, i = 1, 5
            x(i) = i
1        continue

         write(*, 100) (x(i), i = 1, 5)
100      format('Vector is:                           ', 5i6)

      else

c  Node 1 builds bitwise-complement of Node 0's vector.

         do 2, i = 1, 5
            x(i) = inot(i)
2        continue

         write(*, 300) (x(i), i = 1, 5)
300      format('Complement Vector is:                ', 5i6)

      endif

c  Perform bitwise AND.

      call giand(x, 5, work)

c  Node 0 displays resulting vector.

      if (iam .eq. 0 ) write(*, 200) (x(i), i = 1, 5)
200   format('Vector ANDed with its complement is: ', 5i6)

      end
