These rules do not apply to variables whose scopes are predetermined by the OpenMP specification, such as loop iteration variables of worksharing DO or FOR loops. Refer to OpenMP 3.0 Specification (section 184.108.40.206, page 78) for a complete listing of variables whose scopes are predetermined.
S1: If the use of the variable in the parallel region is free of data race conditions for the threads in the team executing the region, then the variable is scoped SHARED.
S2: If in each thread executing the parallel region, the variable is always written before being read by the same thread, then the variable is scoped PRIVATE. The variable is scoped as LASTPRIVATE if it can be scoped PRIVATE and is read before it is written after the parallel region, and the construct is either a PARALLEL DO or a PARALLEL SECTIONS.
S3: If the variable is used in a reduction operation that can be recognized by the compiler, then the variable is scoped REDUCTION with that particular operation type.
A1: If the use of the array in the parallel region is free of data race conditions for the threads in the team executing the region, then the array is scoped as SHARED.