THIS_IMAGE — Function that returns the cosubscript index of this imageRESULT = THIS_IMAGE()
|
RESULT = THIS_IMAGE(DISTANCE)
|
RESULT = THIS_IMAGE(COARRAY [, DIM])
|
| DISTANCE | (optional, intent(in)) Nonnegative scalar integer
(not permitted together with COARRAY).
|
| 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.
|
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(HUGE(1)) /= THIS_IMAGE())
error stop "something is rotten here"