Fortran tries to adhere to a pattern, when it comes to using * and :
: generally means that the variable in question may have different values for the corresponding attribute during execution of the code where it is in scope. The whole idea of ALLOCATABLE is indeed that, in that scope, its co-extents could be one value in some statement, and a different in another statement. Other examples: assumed-shape arrays REAL, INTENT(IN) :: X(:,:), deferred-shape arrays POINTER, REAL :: Y(:).
* generally means that the value of that attribute is not known at compile-time but will remain fixed during the scope that name comes into existence for. Other examples: assumed-size arrays REAL :: A(LDA,*), implied-shape constant arrays PARAMETER, INTEGER :: I(*)=[1,2,3]
For the CODIMENSION, since the number of images is fixed at the beginning of execution and will never change, the * is the appropriate symbol.
the error happens when I take the “initiative” to change it as
real(real32), allocatable :: gather(:)[*]
in the source code. I get why I caused the error, I do not get why the definition of the book/standard is not making sense. Because for a scalar is like that
Well, the syntax in the scalar nonallocatable case declaration a[*] looks exactly like the syntax in the ALLOCATE, [*]. ALLOCATABLE variables need : at declaration and must use * (as the last one) at allocation time. Non-allocatables must use * at declaration.