CO_MAX(3f)

DESCRIPTION
CO_MAX determines element-wise the maximal value of A on all images of the current team. If RESULT_IMAGE is present, the maximum values are returned in A on the specified image only and the value of A on the other images become undefined. If RESULT_IMAGE is not present, the value is returned on all images. If the execution was successful and STAT is present, it is assigned the value zero. If the execution failed, STAT gets assigned a nonzero value and, if present, ERRMSG gets assigned a value describing the occurred error.

STANDARD
Technical Specification (TS) 18508 or later

CLASS
Collective subroutine

SYNTAX
CALL CO_MAX(A [, RESULT_IMAGE, STAT, ERRMSG])

ARGUMENTS

A shall be an integer, real or character variable, which has the same type and type parameters on all images of the team. RESULT_IMAGE (optional) a scalar integer expression; if present, it shall have the same the same value on all images and refer to an image of the current team. STAT (optional) a scalar integer variable ERRMSG (optional) a scalar character variable

EXAMPLE
          program test
            integer :: val
            val = this_image ()
            call co_max (val, result_image=1)
            if (this_image() == 1) then
              write(*,*) "Maximal value", val ! prints num_images()
            end if
          end program test

SEE ALSO
CO_MIN, CO_SUM, CO_REDUCE, CO_BROADCAST

AUTHOR

This information was taken from the GFortran documentation (https://gcc.gnu.org/onlinedocs/gcc-5.3.0/gfortran/) and converted to a manpage by AstroFloyd (http://astrofloyd.org).