REAL(r64) FUNCTION POLY2F(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)*X + A(2)*X**2 + ... + A(N)*X**N
! 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)*X
DO I=2,N
SUM=X*(SUM+A(N-I+1))
ENDDO
POLY2F=SUM
RETURN
END FUNCTION POLY2F