program main use omp_lib integer i, j, m, n real f, total, x, y total = 0.0 !$omp parallel do private ( i, j, x, y ) shared ( m, n ) reduction ( + : total ) do j = 1, n y = j / real ( n ) do i = 1, m x = i / real ( m ) total = total + f ( x, y ) end do end do !$omp end parallel do stop end