        SUBROUTINE      CDOPFN (
*
*  inputs
*
     :                  X, ORDER, NPMAX, NPTS, ORTHO,
*
*  outputs
*
     :                  Y)
*
*  Module number:
*
*  Module name:
*
*  Keyphrase:
*  ----------
*  evaluate (orthogonal) polynomial of degree ORDER at X(I) and store in Y(I)
*
*  Description:
*  ------------
*  Maximum order is 20.
*
*  FORTRAN name: CDOPFN.FOR
*
*  Keywords of accessed files and tables:
*  --------------------------------------
*  Name                         I/O     Description / Comments
*       None
*
*  Subroutines Called:
*  -------------------
*  CDBS:
*       None
*  SDAS:
*       None
*  Others:
*       None
*
*  History:
*  --------
*  Version      Date        Author          Description
*     1       12-01-87     J.-C. HSU        design and coding
*
*-------------------------------------------------------------------------------
*
*== input:
*                                       --X array
        DOUBLE PRECISION        X(1)
*                                       --order of the polynomial
        INTEGER                 ORDER,
*                                       --maximum polynomial order (size)
     :                          NPMAX,
*                                       --number of data points
     :                          NPTS
*                                       --orthogonal polymial construct
        DOUBLE PRECISION        ORTHO(0:NPMAX, 0:NPMAX)
*
*== output:
*                                       --functional value(s)
        DOUBLE PRECISION        Y(1)
*
*== local:
*                                       --loop indices
        INTEGER                 I, J, L
*                                       --working buffer
        DOUBLE PRECISION        TEMP(0:20)
*
*------------------------------------------------------------------------------
*
        DO 30 I = 1, NPTS
            TEMP(0) = 1.D0
*
            DO 20 J = 1, ORDER
                TEMP(J) = X(I) ** J
*
                DO 10 L = 0, J-1
                    TEMP(J) = TEMP(J) + ORTHO(L, J) * TEMP(L)
   10           CONTINUE
   20       CONTINUE
*
            Y(I) = TEMP(ORDER)
   30   CONTINUE
*
        RETURN
        END
