title: Unclassifiable statement at (1) when calling a function
body: <p>I'm relatively new to Fortran and I have an assignment to find quadrature weights and points where the points are the zeros of the nth legendre polynomial (found using Newton's method); I made functions to find the value of Pn(x) and P'n(x) to sub into Newton's method.</p>
  
  <p>However when actually using the functions in my quadrature subroutine it comes back with:</p>
  
  <pre><code>Coursework2a.f90:44.3:
  
     x = x - P(n,x)/dP(n,x)
     1
  Error: Unclassifiable statement at (1)
  </code></pre>
  
  <p>Does anybody know any reasons why this statement could be classed as unclassifiable?</p>
  
  <pre><code>subroutine Quadrature(n)
  
  implicit none
  integer, parameter :: dpr = selected_real_kind(15) !Double precision
  real(dpr) :: P, dP, x, x_new, error = 1, tolerance = 1.0E-6, Pi = 3.141592 !Define Variables
  integer, intent(in) :: n
  integer :: i
  
  !Next, find n roots. Start with first guess then iterate until error is greater than some tolerance.
  
  do i = 1,n
  
      x = -cos(((2.0*real(i)-1.0)/2.0*real(n))*Pi)
  
      do while (error &gt; tolerance)
  
          x_new = x
  
          x = x - P(n,x)/dP(n,x)
  
          error = abs(x_new-x)
  
  
      end do 
  
      print *, x
  
  end do
  
  end subroutine Quadrature
  </code></pre>