Test which checks the omp parallel copyin directive. 2.0 omp parallel copyin omp critical,omp threadprivate ! Changelog: INTEGER FUNCTION omp_copyin() IMPLICIT NONE INTEGER known_sum ! INTEGER, SAVE::sum1 ! implicitly by omp_threadprivate, see spec25 Chap. 2.8.2 INTEGER sum1 COMMON /csum1/ sum1 INTEGER sum, i, threads COMMON /orphvars/ sum, i, threads ! C. Niethammer 30.11.06: moved threadprivate statement into the orphaned ! function !$omp threadprivate(/csum1/) sum = 0 sum1 = 7 threads = 0 !$omp parallel copyin(sum1) ! print *,"sum1",sum1 !$omp do DO i=1, 999 sum1 = sum1 + i END DO !$omp critical sum = sum + sum1 threads = threads + 1 !$omp end critical !$omp end parallel known_sum = 999*1000/2 + 7*threads IF ( known_sum .EQ. sum ) THEN = 1 ELSE = 0 END IF END