        SUBROUTINE CDPVAL (
*
*  inputs
*
     :                          TEMP, EPOCH, BASE, COEFF, TEMP0, EPOCH0,
*
*  output
*
     :                          VALUE)
*
*  Module Number: 15.0.1.2
*
*  Module Name: vevalpoly
*
*  Keyphrase:
*  ----------
*  Evaluate a 3rd order polynomial of temperature and epoch
*
*  Description:
*  ------------
*  Evaluate a quantity which is a 3rd order polynomial of temperature and epoch,
*  expressed as:
*
*       value = base_value * [a(1) + a(2)*(temp-temp0) + a(3)*(temp-temp0)**2
*                               + a(4)*(temp-temp0)**3]
*       where
*
*       a(i) = coeff(i, 1) + coeff(i,2)*(epoch - epoch0)
*               + coeff(i,3)*(epoch-epoch0)**2 + coeff(i,4)*(epoch-epoch0)**3
*
*  FORTRAN Name: CDPVAL
*
*  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       04-15-86     J.-C. Hsu        Design and coding
*     2       08-15-87     J.-C. Hsu        F77 standard
*
*-------------------------------------------------------------------------------
*
*== input:
*                                       --(detector or DEA) temperature
        REAL                    TEMP,
*                                       --base value of the quantity to be evaluated
     :                          BASE,
*                                       --coefficients of the polynomials
     :                          COEFF(4,4),
*                                       --reference temperature
     :                          TEMP0
*                                       --epoch at observation
        DOUBLE PRECISION        EPOCH,
*                                       --reference epoch
     :                          EPOCH0
*
*== output:
*                                       --functional value of the polynomial
        REAL                    VALUE
*
*== local:
*
        DOUBLE PRECISION        A(4),
     :                          DPVAL,
     :                          DT,
     :                          DE
*                                       --loop index
        INTEGER                 I, J
*-------------------------------------------------------------------------------
*
        DPVAL = 0.D0
        DT = DBLE(TEMP - TEMP0)
        DE = EPOCH - EPOCH0
*
        DO 20 I = 1, 4
            A(I) = 0
            DO 10 J = 1, 4
                A(I) = A(I) + DBLE(COEFF(I,J)) * DE**(J - 1)
   10       CONTINUE
            DPVAL = DPVAL + A(I) * DT**(I - 1)
   20   CONTINUE
        VALUE = REAL(DBLE(BASE) * DPVAL)
*
        RETURN
        END
