program pp_omp_ex6 !Example of workshare !$ use omp_lib implicit none integer,parameter :: n=7 integer :: i,j,a(n),b(n),c(n) !$omp parallel shared(a,b,c) private(i,j) !$omp workshare forall (i=1:n) a(i)=i forall (j=1:n) b(j)=2*j !OMP makes sure that all results are available before the next line c(1:n)=a(1:n)+b(1:n) !$omp end workshare !$omp end parallel end program pp_omp_ex6