Next: TIME, Previous: TANH, Up: Intrinsic Procedures [Contents][Index]
THIS_IMAGE
— Function that returns the cosubscript index of this imageReturns the cosubscript for this image.
Fortran 2008 and later
Transformational function
RESULT = THIS_IMAGE() |
RESULT = THIS_IMAGE(COARRAY [, DIM]) |
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 and its value
is the index of the invoking image. Otherwise, if DIM is not present,
a rank-1 array with corank elements is returned, containing the cosubscripts
for COARRAY specifying the invoking image. 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