インテル® Fortran コンパイラー 19.0 デベロッパー・ガイドおよびリファレンス

THIS_IMAGE

Transformational Intrinsic Function (Generic): Returns cosubscripts for the image.

result = THIS_IMAGE ([coarray [, dim]])

coarray

(Input; optional) Must be a coarray; it can be of any type. If it is allocatable, it must be allocated.

dim

(Input; optional) Must be a default integer scalar. Its value must be in the range 1 <= dim <= n, where n is the corank of coarray. The corresponding actual argument must not be an optional dummy argument.

Results

The result type is default integer. It is scalar if coarray does not appear or dim is present; otherwise, the result has rank one and its size is equal to the corank of coarray.

The result depends on which arguments are specified:

Example

Consider that coarray C is declared by the following statement:

REAL C(5, 10) [10, 0:9, 0:*]

On image 5, THIS_IMAGE ( ) has the value 5 and THIS IMAGE (C) has the value [5, 0, 0]. For the same coarray on image 213, THIS_IMAGE (C) has the value [3, 1, 2].

In the following example, image 1 is used to read data. The other images then copy the data:

IF (THIS_IMAGE()==1) READ (*,*) P
SYNC ALL
P = P[1]