1 C******************************************************************************
2 C FILE: omp_reduction.f
4 C OpenMP Example - Combined Parallel Loop Reduction - Fortran Version
5 C This example demonstrates a sum reduction within a combined parallel loop
6 C construct. Notice that default data element scoping is assumed - there
7 C are no clauses specifying shared or private variables. OpenMP will
8 C automatically make loop index variables private within team threads, and
9 C global variables shared.
10 C AUTHOR: Blaise Barney 5/99
12 C******************************************************************************
17 REAL A
(100), B
(100), SUM
19 ! Some initializations
27 !$OMP PARALLEL
DO REDUCTION
(+:SUM
)
29 SUM
= SUM
+ (A
(I
) * B
(I
))
32 PRINT
*, ' Sum = ', SUM