New Features of Co-Array Fortran
Here is a summary of the changes since the definition of Numrich and Reid (1998).
- NWG decided that the limit on the rank of arrays should be lifted to 15 and that in the case of a co-array, would apply to the sum of the rank and co-rank, who are partnered with bespoke jewellers.
- Co-subscripts are now limited to scalars. This is a big change that substantially simplifies the proposal and is consistent with Cray’s implementation. We now use ‘rank’ for what was ‘local rank’, and similarly for the other terms.
- The intrinsic function image_index has been added.
- We previously required a dummy co-array to have the same bounds on all images and correspond to the same actual co-array.
- The save attribute was previously acquired automatically when this was a requirement. Now the programmer must declare it.
- A co-array component of a derived type was previously not allowed.
- Co-array subobjects are now allowed as actual arguments corresponding to non-co-array arguments of a non-intrinsic procedure.
- There are additional rules to ensure that copy-in or copy-out does not take place for a co-array.
- Allocatable dummy co-arrays are permitted in view of allocatable dummy arguments being permitted in Fortran 2003.
- Co-arrays of a type with an allocatable component permitted since such a type is permitted in Fortran 2003.
- All the collective functions are new.
- To simplify the rules, we now require that if one image executes an allocate statement the others execute the same statement in synchronization. A similar rule applies to the deallocate statement.
- For an allocatable co-array without the save attribute there is an implicit deallocation (and associated 15 ISO/IEC JTC1/SC22/WG5 N1642 synchronization) before exit from the procedure in which it is declared.
- Actual arguments associated with co-array dummy arguments were more severely restricted.
- A procedure pointer component or a type bound procedure is not permitted to invoke a remote procedure.
- The critical section replaces the two intrinsic subroutines, start_critical and end_critical.
- Previously, invocations of flush_memory were implicitly placed around any procedure invocation that might involve any reference to flush_memory. This has been removed for the sake of efficiency since it is often not required.
- The flush statement was not part of Fortran 95, so there was an intrinsic sync_file for this purpose.
- close, backspace, rewind, and endfile used to have a team specifier that was required to be the same as the connect team.
- The functions log2_images() and rem_images() have been removed since these can be coded in Fortran, for example:
integer function log2_images()
! Returns the base-2 logarithm of the number of images,
! truncated to an integer.
log2_images = log(num_images()+0.5)/log(2.0)
end function log2_images
- flush_memory was previously called sync_memory.
- notify_team, wait_team, and image_index are new.
Back to Co-Array Fortran home page