Test which checks the omp single copyprivate directive.
2.0
omp single copyprivate
omp parllel,omp critical
INTEGER FUNCTION single_copyprivate()
IMPLICIT NONE
INTEGER omp_get_thread_num
INCLUDE "omp_testsuite.f"
INTEGER i,j,thread,nr_iterations,result
COMMON /orphvars/ nr_iterations,result
result=0
nr_iterations=0
!$omp parallel private(i,j,thread)
DO i=0,LOOPCOUNT-1
thread=OMP_GET_THREAD_NUM()
!$omp single
nr_iterations=nr_iterations+1
j=i
!$omp end single copyprivate(j)
!$omp critical
result=result+j-i;
!$omp end critical
END DO
!$omp end parallel
IF(result .EQ. 0 .AND.
& nr_iterations .EQ. LOOPCOUNT) THEN
=1
ELSE
=0
END IF
END FUNCTION