      if ( id == 0 ) then               <-- MASTER receives maximums.

        x_max = -1000.0
        tag = 2

        do i = 1, p - 1

          call MPI_Recv ( x_max_local, 1, MPI_DOUBLE_PRECISION, 
     &      MPI_ANY_SOURCE, tag, MPI_COMM_WORLD, status, ierr )

          x_max = max ( x_max, x_max_local )

        end do

      else                             <-- WORKERS send maximums.

        x_max_local = x(1)

        do i = 2, n
          if ( x_max_local .lt. x(i) ) x_max_local = x(i)
        end do

        target = 0
        tag = 2
        call MPI_Send ( x_max_local, 1, MPI_DOUBLE_PRECISION, target, 
     &    tag, MPI_COMM_WORLD, ierr )

      end if

      return
      end
