Numerical Computing with Modern Fortran

Richard J. Hanson and Tim Hopkins

Chapter 14: Coarrays in Standard Fortran

Source Code:

  1. in zip format
  2. in gzipped tar format

These executable routines use Fortran coarrays to compute quantities that benefit from using parallel resources. There are two simple examples in two separate source files. The compiler must support coarrays and should allow more than one image in the work group.

Sample Output from approximatePi using 8 images

Input the number of quadrature points:
1000000
 Using            8  images, and n =      1000000
 Approximate Value of PI =    3.14159265358989
 Relative error =  -3.095739889957823E-014

Sample Output from matvecmult using 8 images

8 images being used
Input m, the number of rows (<=0 to quit):
10000
Input n, the number of cols (<=0 to quit):
1000
Satisfactory Error Check on IMAGE 1 =   3.0314E-15
Donate · Contact Us · Site Map · Join SIAM · My Account
Facebook Twitter Youtube linkedin google+