PCHIA(3)

SYNOPSIS
REAL FUNCTION PCHIA (N, X, F, D, INCFD, SKIP, A, B, IERR)

NAME
pchia - Evaluate the definite integral of a piecewise cubic Hermite function over an arbitrary interval.

LIBRARY
SLATEC (PCHIP)

CATEGORY
E3, H2A1B2

TYPE
SINGLE PRECISION (PCHIA-S, DPCHIA-D)

KEYWORDS
CUBIC HERMITE INTERPOLATION, NUMERICAL INTEGRATION, PCHIP, QUADRATURE

AUTHOR
Fritsch, F. N., (LLNL) Lawrence Livermore National Laboratory P.O. Box 808 (L-316) Livermore, CA 94550 FTS 532-4275, (510) 422-4275

DESCRIPTION
PCHIA: Piecewise Cubic Hermite Integrator, Arbitrary limits Evaluates the definite integral of the cubic Hermite function defined by N, X, F, D over the interval [A, B]. To provide compatibility with PCHIM and PCHIC, includes an increment between successive values of the F- and D-arrays. ---------------------------------------------------------------------- Calling sequence: PARAMETER (INCFD = ...) INTEGER N, IERR REAL X(N), F(INCFD,N), D(INCFD,N), A, B REAL VALUE, PCHIA LOGICAL SKIP VALUE = PCHIA (N, X, F, D, INCFD, SKIP, A, B, IERR) Parameters: VALUE -- (output) value of the requested integral. N -- (input) number of data points. (Error return if N.LT.2 .) X -- (input) real array of independent variable values. The elements of X must be strictly increasing: X(I-1) .LT. X(I), I = 2(1)N. (Error return if not.) F -- (input) real array of function values. F(1+(I-1)*INCFD) is the value corresponding to X(I). D -- (input) real array of derivative values. D(1+(I-1)*INCFD) is the value corresponding to X(I). INCFD -- (input) increment between successive values in F and D. (Error return if INCFD.LT.1 .) SKIP -- (input/output) logical variable which should be set to preceding parameters, or to .FALSE. otherwise. This will save time in case these checks have already been performed (say, in PCHIM or PCHIC). SKIP will be set to .TRUE. on return with IERR.GE.0 . A,B -- (input) the limits of integration. NOTE: There is no requirement that [A,B] be contained in [X(1),X(N)]. However, the resulting integral value will be highly suspect, if not. IERR -- (output) error flag. Normal return: IERR = 0 (no errors). Warning errors: IERR = 1 if A is outside the interval [X(1),X(N)]. IERR = 2 if B is outside the interval [X(1),X(N)]. IERR = 3 if both of the above are true. (Note that this means that either [A,B] contains data interval or the intervals do not intersect at all.) "Recoverable" errors: IERR = -1 if N.LT.2 . IERR = -2 if INCFD.LT.1 . IERR = -3 if the X-array is not strictly increasing. (VALUE will be zero in any of these cases.) NOTE: The above errors are checked in the order listed, and following arguments have **NOT** been validated. IERR = -4 in case of an error return from PCHID (which should never occur).

REFERENCES
(NONE)

ROUTINES CALLED
CHFIE, PCHID, XERMSG

REVISION HISTORY (YYMMDD)
820730 DATE WRITTEN
820804 Converted to SLATEC library version.
870707 Corrected double precision conversion instructions.
870813 Minor cosmetic changes.
890411 Added SAVE statements (Vers. 3.2).
890531 Changed all specific intrinsics to generic. (WRB)
890703 Corrected category record. (WRB)
890831 Modified array declarations. (WRB)
890831 REVISION DATE from Version 3.2
891214 Prologue converted to Version 4.0 format. (BAB)
900315 CALLs to XERROR changed to CALLs to XERMSG. (THJ)
930503 Corrected to set VALUE=0 when IERR.lt.0. (FNF)
930504 Changed CHFIV to CHFIE. (FNF)