title: how to use the private variables's value outside the parallel region
body: <p>I have a parallel fortran code with OpenMP. This is the parallel part of code: </p>
  
  <pre><code>!$OMP PARALLEL DEFAULT(SHARED) PRIVATE(iconf,d,randx,                   &amp;
  !$OMP&amp; randy,randz,unit_cg,theta1,theta2,theta3,fr1,fr2,fr3,Q,          &amp;
  !$OMP&amp; plproduct_avg,correlation_term) 
  
        allocate(randx(num),randy(num),randz(num),unit_cg(num),           &amp;
       &amp;         fr1(num),fr2(num),fr3(num),theta1(order,num),            &amp;
       &amp;         theta2(order,num),theta3(order,num),                     &amp;
       &amp;         Q(nfftdim1,nfftdim2,nfftdim3))
  
  
  !$OMP DO 
  
        do 250 iconf = 1,1600
         write(6,*)'configuration number',iconf
  
         {some calculations}
  
         do 350 d = 0,int(nfft1/2)
          write(6,*)'correlation term of iconf =',iconf,'d=',d,           &amp;
       &amp;             correlation_term(d,iconf)
  350    continue
  
  250   continue
  
  !$OMP END DO
  
        deallocate(randx,randy,randz,unit_cg,fr1,fr2,fr3,theta1,theta2,   &amp;
       &amp;           theta3,Q)
  
  !$OMP END PARALLEL
  </code></pre>
  
  <p>As it is clear, this loop calculates the <code>correlation_term(iconf)</code> (they are private) and prints them on output file correctly. But when I use these variables outside the parallel region, all of them are zero.</p>
  
  <p>How can I use the values of <code>correlation_term(iconf)</code> calculated in parallel region, outside it?</p>