title: Openmp and Fortran, crashing code
body: <p>This is related to a <a href="https://stackoverflow.com/questions/35203586/paralelize-mixed-f77-f90-fortran-code">previous question</a>. I am trying to parallelize a code with mixed syntax (f77 and f90)</p>
  
  <p>I've added into one of the many routines this portion in the code</p>
  
  <pre><code> !$omp parallel shared (xdif,cdiff, dg,bfvisc,r,ro,xm ) private ( l ) 
   !$omp do
   DO L=2,n-1
          xdif(l)=cdiff(l)*fjc+(dg(l)+bfvisc(l))*
   &amp;           (4.d0*pi*r(l)**2*ro(l)/xm(n))**2
  
   ENDDO
  
   !$omp end do
   !$omp end parallel
  </code></pre>
  
  <p>After compiling (using <code>-fopenmp</code>) the code runs but just for a few seconds and the only error I'm getting is: Segmentation fault (core dumped)</p>
  
  <p>I didn't use the module <code>omp_lib</code> (since that was suggested in an answer to the previous question) but I also try with it (using <code>call omp_set_num_threads(4)</code> before the first line). And both ways I have the same problem.</p>
  
  <p>What can I do?</p>
  
  <p>I've been advised also to print the output with the flags <code>-g -fbacktrace -fcheck=all -Wall</code>.  Here it is:</p>
  
  <pre><code> At line 2828 of file mainII.f
   Fortran runtime error: Index '0' of dimension 1 of array 'l1mlos' below lower bound of 1
  </code></pre>