title: Understand the basics of using BIND(C) in fortran
body: <p>I have this very small example of Fortran code which I would like to understand please.</p>
  
  <pre><code>  subroutine test_iso_c
  
    use ISO_C_BINDING
  
    implicit real(c_double) (a-h,o-z)    
  
    real :: var, expression
  
    interface
      real(c_double) function test (y) bind( c )
       use ISO_C_BINDING
         real(c_double), value :: y
       end
    end interface
  
  
    ! call 
    var = test(expression) ! - expression  is a real declared variable which is calculated using simple  arithmetic operation.   
  
    end 
  </code></pre>
  
  <p>Can you explain to me thee  following (I assume c_double means double precision in a C code scope?)</p>
  
  <p>1 -  What does <code>implicit real(c_double) (a-h,o-z)</code>?</p>
  
  <p>2 -  what does <code>value</code> and <code>bind(c)</code> do in the function interface </p>
  
  <p>3 - I saw this of code as  part of a larger routine, can you say what this test function provide/do? </p>