c
c	gopf2.f 1.4 92/07/01 15:20:20
c
c  Copyright 1991 Intel Corporation, Inc.
c  See the "Copyright" file for complete rights and liability information.
c
c  Part 2 of 2:
c    Runs on all nodes.
c    Returns the largest value across all nodes.
c    Called from the program defined in the file gopf1.f.

      integer function max_node(mine, work)

      include 'fcube.h'

      real mine(3), work(3)

      if(mine(1) .lt. work(1) .or.
     1  (mine(1) .eq. work(1) .and. mine(3) .gt. work(3)) )
     2  then
         mine(1) = work(1)
         mine(2) = work(2)
         mine(3) = work(3)
      endif

      return

      end
