THIS_IMAGE
— Function that returns the cosubscript index of this image ¶RESULT = THIS_IMAGE([TEAM]) |
RESULT = THIS_IMAGE(COARRAY [, DIM][, TEAM]) |
Returns the cosubscript for this image.
Transformational function
TEAM | (optional, intent(in)) The team for which the index of this image is desired. The current team is used, when no team is given. |
COARRAY | Coarray of any type (optional; if DIM present, required). |
DIM | default integer scalar (optional). If present, DIM shall be between one and the corank of COARRAY. |
Default integer. If COARRAY is not present, it is scalar; if
TEAM is not present, its value is the image index on the invoking image
for the current team; if TEAM is present, returns the image index of
the invoking image as given to the FORM TEAM (..., NEW_INDEX=..)
call,
or a implementation specific unique number, when NEW_INDEX=
was absent
from FORM TEAM
. Otherwise when the COARRAY is
present, if DIM is not present, a rank-1 array with corank elements is
returned, containing the cosubscripts for COARRAY specifying the invoking
image (in the team when TEAM is present). If DIM is present, a
scalar is returned, with the value of the DIM element of
THIS_IMAGE(COARRAY)
.
INTEGER :: value[*] INTEGER :: i value = THIS_IMAGE() SYNC ALL IF (THIS_IMAGE() == 1) THEN DO i = 1, NUM_IMAGES() WRITE(*,'(2(a,i0))') 'value[', i, '] is ', value[i] END DO END IF ! Check whether the current image is the initial image IF (THIS_IMAGE(GET_TEAM(INITIAL_TEAM)) /= THIS_IMAGE()) error stop "something is rotten here"
Fortran 2008 and later. With TEAM argument, Fortran 2018 or later
NUM_IMAGES
— Function that returns the number of images,
IMAGE_INDEX
— Function that converts a cosubscript to an image index