title: Fortran interface to call a C function that return a pointer
body: <p>I have a C function,</p>
  
  <pre><code>double* foofunc() 
  {
    /* Function Body */
  }
  </code></pre>
  
  <p>I don't know how to declare an interface in <code>Fortran</code> to call this <code>C</code> function.</p>
  
  <p>Also if a pointer is supposed to be pointing to <code>GPU device memory</code>, how could I define that in the <code>Fortran</code> interface? Do I need to use <code>DEVICE</code> attribute.</p>
  
  <p>Please use features supported by <code>Fortran</code> up to 2003.</p>
  
  <p>Any suggestions?</p>