how can i keep variables private in subroutines which are called in a parallel section of openmp?
问题 i am calling a nested for loop as follows: do ir = 1,Nr do iom = iom1, iom2 xyz(1) = xo(1) + xom(iom)*r xyz(2) = xo(2) + yom(iom)*r xyz(3) = xo(3) + zom(iom)*r call FUNSUB(xyz,Nprop,PropXYZ) enddo enddo where FUNSUB evaluates a property in the following manner: id = 1 do l=0,lmax do m=-l,l id = id + 1 Prop(id) = RHO * Ylm(l,m,xl(1),xl(2),xl(3)) enddo enddo now i am trying to parallelize this with something of the form !$OMP parallel do reduction(+:Prop) private(ir, l, m, j, iom, r, wrad, xyz,