title: openmp: different answer using ifort than gfortran
body: <p>I have recently encountered a compiler specific openmp issue. I have written a code that works correctly using openmp and gfortran. I have recently used ifort and openmp to compile the same code, and now the openmp section segfaults. I have cut most of the fat away, and wrote this snippet of code which reproduces my error</p>
  
  <pre><code>!$omp parallel do schedule(dynamic) reduction(+:energy) default(private) shared(r,tr)
  
       do i=0,listvar%ncellT-1
  
             c1s = tr(i)%start
             c1e = tr(i)%end
  
             do j = c1s,c1e
  
                x1 = r(j)%x; y1 = r(j)%y; z1 = r(j)%z
                energy = energy + x1
             enddo
          enddo
  
          !$omp end parallel do
  </code></pre>
  
  <p>All this loop does is access pointers to elements in r from the array tr, and then loop between those elements. However, ifort is for some reason assigning nonsense values to c1s and c1e causing the code to segfault when I loop over r. Again, the code works with gfortran. Does anyone have any idea why this may be?</p>