title: There is no specific subroutine for the generic ‘fminsearch’
body: <p>I have written the following program in fortran90:</p>
  
  <pre><code>module constants
  
  
     real*8, parameter :: zero = 0.0d0
     real*8, parameter :: one = 1.0d0
     real*8, parameter :: two = 2.0d0
  
  end module constants
  
  module common
  
     use constants
     real*8 :: a_A, a_B, e_A, e_B, b_A, b_B
  
  end module common   
  
  module procedures
  
     use constants
  
     contains
  
     function f(p)
  
        use common
  
        real*8, dimension(2), intent(in) :: p
        real*8, dimension(2) :: f
  
        f(1) = a_A*((two*p(1)/p(1) + p(2))**(-e_A)) - (exp(b_A*p(1)) - one)
        f(2) = a_B*((two*p(2)/p(1) + p(2))**(-e_B)) - (exp(b_B*p(2)) - one)
  
        f = f
  
        return
  
     end function f
  
     subroutine wait
  
        write(6,"('Waiting...')")
        read *
  
        return
  
     end subroutine wait
  
  end module procedures
  
  program main 
  
     use constants
     use common
     use procedures
     use toolbox
  
     real*8, dimension(2) :: plow,phigh,pmin   
  
     a_A = one
     a_B = one
     e_A = one
     e_B = one
     b_A = 0.1d0
     b_b = 0.1d0
  
  
     plow(1) = 6.0d0
     plow(2) = 6.0d0
  
     phigh(1) = 8.0d0
     phigh(2) = 8.0d0
  
     pmin = one
  
     call fminsearch(pmin,fret,plow,phigh,f)
  
     write(6,"(3f15.8)") pmin(1),pmin(2), fret
  
  end program main  
  </code></pre>
  
  <p>When I run it I get the following error</p>
  
  <pre><code>call fminsearch(pmin, fret, plow, phigh, f)
                                       1
  Error: There is no specific subroutine for the generic ‘fminsearch’ at (1) 
  </code></pre>
  
  <p>I think it is a problem with my function arguments, but could anybody give me some clarity as to what is going wrong? I am new to fortran and do not quite understand. As far as I can tell, I have declared the x with intent(in) and have declared the vector output of the function. </p>
  
  <p>Thank you</p>