The SHARED(varlist) qualifier specifies that all scalars and arrays in the list varlist are shared for the DOALL loop. Both arrays and scalars can be specified as shared. Shared scalars and arrays are common to all the iterations of a DOALL loop. All other scalars and arrays referenced in the DOALL loop, but not contained in the shared list, conform to their appropriate default scoping rules.
Example: Specify a shared variable:
equivalence (a(1),y) C$PAR DOALL SHARED(y) do i = 1,n a(i) = y end do
In the preceding example, the variable y has been specified as a variable whose value should be shared among the iterations of the i loop.