title: Fortran findloc intrinsic
body: <p>I am using Intel's Visual Fortran Composer XE 2011, 12.1.3537.2010 and as it appears, the intrinsic <code>findloc</code> function is not supported (added at 2008 fortran mid-size extrension).</p>
  
  <p>What I want to do is to look up for a specific value in an array and have the index returned. Mostly I work with small size arrays.</p>
  
  <p>I have 2 questions:</p>
  
  <ol>
  <li>I would like to replace linear and binary searches with this functionality, and as I read in other threads it is not clear which algorithm is preferred for optimal performance. How does the intrinsic function deals with the problem? </li>
  <li><p>Since with my compiler this is not supported, a way to emulate <code>findloc</code> would be the following: </p>
  
  <pre><code>minloc( (array-value)**2 )
  </code></pre>
  
  <p>But... what about the performance? Any other ideas?</p></li>
  </ol>