REAL(r64) FUNCTION POLY1F(X,A,N)
! FUNCTION INFORMATION:
! AUTHOR George N. Walton
! DATE WRITTEN May 1977
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS FUNCTION:
! This function evaluates a polynomial of the form:
! POLY = A(1) + A(2)*X + A(3)*X**2 + ... + A(N)*X**(N-1)
! METHODOLOGY EMPLOYED:
! Uses Horner's Rule.
! REFERENCES:
! na
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! FUNCTION ARGUMENT DEFINITIONS:
INTEGER N ! number of terms in polynomial
REAL(r64) X ! independent variable
REAL(r64) A(N) ! array of polynomial coefficients
! FUNCTION PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! FUNCTION LOCAL VARIABLE DECLARATIONS:
INTEGER I ! Loop parameter
REAL(r64) SUM ! Temporary summation variable
SUM=A(N)
DO I=2,N
SUM=SUM*X+A(N-I+1)
ENDDO
POLY1F=SUM
RETURN
END FUNCTION POLY1F