title: function as argument in fortran 90
body: <p>For an academic paper, the authors have provided their code of their results and so I am trying to run their code. When I compile, there is an error which says that a function cannot be used as an argument. Here below I provide the relevant parts of the code that the error seem to point out (In particular the message is: <code>"error 997 - An internal FUNCTION, such as FOC, cannot be used as an actual argument"</code>). </p>
  
  <p>.........</p>
  
  <pre><code> function foc(ain)
      implicit none
      real*8:: ain, foc
  
      foc =  plterm+meru(ain,i)-upap(n,ain,i)
    end function foc
  </code></pre>
  
  <p>...........</p>
  
  <pre><code>  yy1 = zbrent(foc,a(np-1),yexp,errrel)
  </code></pre>
  
  <p>where zbrent is a subroutine called by the main program. If necessary I can attach the whole code.  </p>
  
  <pre><code>FUNCTION zbrent (func,x1,x2,tol)
    implicit none
    real(8), external:: func
    real(8), intent(in):: x1,x2,tol
  
  END FUNCTION zbrent
  </code></pre>
  
  <p>I am not familiar with Fortran or any programming and wondering whether someone can advice something. </p>