# Specify Data Objects for Coarray Images

Each image has its own set of data objects, all of which can be accessed in the normal way.

The rank, bounds, extents, size, and shape of a whole coarray are provided by the data in parentheses in its declaration or allocation. Its corank, cobounds, and coextents are provided by the data in square brackets in its declaration or allocation. Any subobject of the coarray that is a coarray has the same corank, cobounds, and coextents. The cosize of a coarray is always equal to the number of images.

Objects can be declared with codimensions in square brackets immediately following dimensions in parentheses or in place of them, for example:

    real :: a[*], d[*]                              ! Scalar coarrays
    real, dimension(50), codimension[50,*] :: x     ! An array coarray
    integer :: n(100)[*]
    character :: b(40)[40,0:*]
    type(para) :: w[30,*]

Unless the coarray is allocatable, the form for the dimensions in square brackets is the same as that for dimensions in parentheses in an assumed-size array.

The total number of subscripts plus cosubscripts is limited to 31. Note that the Fortran 2018 Standard limits the total number of subscripts plus cosubscripts to 15.

You can address a coarray on another image by using subscripts in square brackets following any subscripts in parentheses, for example:

    b(6)[4,7] = n(6)[4]
    e[4] = c
    b(:)[3,4] = c[2]

Any object whose designator includes square brackets is called a coindexed object. Each subscript in square brackets must be a scalar integer expression.

Subscripts in parentheses must be used whenever the parent array has nonzero rank. For example, for a(:)[2,3], you cannot specify a[2,3].

Parent topic: Coarrays

## See Also

NUM_IMAGES