IntelĀ® Fortran Compiler 18.0 Developer Guide and Reference

Coarray Dummy Arguments

If a dummy argument is a coarray, the corresponding actual argument must be a coarray and must have the VOLATILE attribute if and only if the dummy argument has the VOLATILE attribute.

If a dummy argument is an array coarray that has the CONTIGUOUS attribute or is not of assumed shape, the corresponding actual argument must be simply contiguous.

Examples

When a procedure is invoked on a particular image, each dummy coarray is associated with its ultimate argument on the image. During the execution of the procedure, this image can access the coarray corresponding to the ultimate argument on any other image. For example, consider the following:

INTERFACE
   SUBROUTINE MY_SUB(Y)
      REAL :: Y[*]
   END SUBROUTINE MY_SUB
END INTERFACE
...
REAL :: B(700)[:]
...
CALL MY_SUB(B(10))

When subroutine MY_SUB is invoked, the executing image has access through the syntax Y[P] to B(10) on image P.

Each invocation of a procedure with a nonallocatable coarray dummy argument establishes a dummy coarray for the image with its own bounds and cobounds. During the execution of the procedure, this image may use its own bounds and cobounds to access the coarray corresponding to the ultimate argument on any other image. For example, consider the following:

INTERFACE
   SUBROUTINE MY_SUB(Y,I)
      INTEGER :: I
      REAL :: Y(I,I)[I,*]
   END SUBROUTINE MY_SUB
END INTERFACE
...
REAL :: B(1000)[:]
...
CALL MY_SUB(B,10)

When subroutine MY_SUB is invoked, the executing image has access through the syntax Y(1,2)[3,4] to B(11) on the image with image index 33.

See Also