title: Open MP if OpenMP:...else
body: <p>Problem: 
  I have a some code that myself and a few others have been writing, I took the code and made it use mpi and openmp with great results (helps that I am running it on a Blue Gene/Q).</p>
  
  <p>One thing I am not a fan of is that now I cannot compile the code without the -openmp directive because to get the speedup I needed I used reduction variables.
  Example:</p>
  
  <pre><code>!$OMP parallel do schedule(DYNAMIC, 4) reduction(min:min_val)
  ....
      min_val = some_expression(i)
  ....
  !$OMP end parallel do
  result = sqrt(min_val)
  </code></pre>
  
  <p>I am looking for something like:</p>
  
  <pre><code>!$OMP if OMP:
  !$OMP min_val = some_expression(i)
  !$OMP else:
  if ( min_val .gt. some_expression(i) ) min_val = some_expression(i)
  !$OMP end else
  </code></pre>
  
  <p>Anybody know of something like this?  Notice that without -openmp the !$OMP lines are ignored and the code runs normally with the correct, er same, answer.</p>
  
  <p>Thanks,</p>
  
  <p>(Yes it is FORTRAN code, but its almost identical to C and C++)</p>