Co-array Fortran (CAF)


Co-Array Fortran is a small set of extensions to Fortran 95 for Single Program Multiple Data, SPMD, parallel processing.Co-Array Fortran is a simple syntactic extension to Fortran 95 that converts it into a robust, efficient parallel language. It looks and feels like Fortran and requires Fortran programmers to learn only a few new rules.
A coarray Fortran program is interpreted as if it were replicated a number of times and all copies were executed asynchronously. Each copy has its own set of data objects and is termed an image. The array syntax of Fortran is extended with additional trailing subscripts in square brackets to provide a concise representation of references to data that is spread across images.
The Fortran 2008 standard now includes coarrays; the syntax in the Fortran 2008 standard is slightly different from the original CAF proposal.


Coarray Fortran (CAF) is a SPMD parallel programming model based on a small set of language extensions to Fortran 90. CAF supports access to non-local data using a natural extension to Fortran 90 syntax, lightweight and flexible synchronization primitives, pointers, and dynamic allocation of shared data.
An executing CAF program consists of a static collection of asynchronous process images. Like MPI programs, CAF programs explicitly manage locality, data and computation distribution; however, CAF is a shared-memory programming model based on one-sided communication. Rather than explicitly coding message exchanges to obtain off-processor data, CAF programs can directly reference off-processor values using an extension of Fortran 90 syntax for subscripted references. Since both remote data access and synchronization are expressed in the language, communication and synchronization are amenable to compiler-based optimizing transformations.


There were no found no significant applications that use CAF. It is used mainly for scientific purposes. It can and is used in supercomputing.
Its main implementation is provided by Cray Fortran 90 compiler since release 3.1. Another implementation has been developed by the Los Alamos Computer Science Institute (LACSI), at Rice University. They working on an open-source, portable, retargetable, high-quality Co-Array Fortran compiler suitable for use with production codes.

Additional Information

Robert W. Numrich and John Reid. Co-Array Fortran for parallel programming. ACM SIGPLAN Fortran Forum Archive, 17:1–31, August 1998.
C. Coarfa, Y. Dotsenko, J. Eckhardt, and J. Mellor-Crummey. Co-array Fortran performance and potential: An NPB experimental study. In 16th International Workshop on Languages and Compilers for Parallel Processing (LCPC), October 2003.
John Mellor-Crummey, Laksono Adhianto, William Scherer III, and Guohua Jin, A New Vision for Coarray Fortran, Proceedings PGAS09, 2009