DPCHSW(3)

SYNOPSIS
SUBROUTINE DPCHSW (DFMAX, IEXTRM, D1, D2, H, SLOPE, IERR)

NAME
dpchsw - Limits excursion from data for DPCHCS

LIBRARY
SLATEC (PCHIP)

TYPE
DOUBLE PRECISION (PCHSW-S, DPCHSW-D)

AUTHOR
Fritsch, F. N., (LLNL)

DESCRIPTION
DPCHSW: DPCHCS Switch Excursion Limiter. Called by DPCHCS to adjust D1 and D2 if necessary to insure that the extremum on this interval is not further than DFMAX from the extreme data value. ---------------------------------------------------------------------- Calling sequence: INTEGER IEXTRM, IERR DOUBLE PRECISION DFMAX, D1, D2, H, SLOPE CALL DPCHSW (DFMAX, IEXTRM, D1, D2, H, SLOPE, IERR) Parameters: DFMAX -- (input) maximum allowed difference between F(IEXTRM) and the cubic determined by derivative values D1,D2. (assumes DFMAX.GT.0.) IEXTRM -- (input) index of the extreme data value. (assumes IEXTRM = 1 or 2 . Any value .NE.1 is treated as 2.) D1,D2 -- (input) derivative values at the ends of the interval. (Assumes D1*D2 .LE. 0.) (output) may be modified if necessary to meet the restriction imposed by DFMAX. H -- (input) interval length. (Assumes H.GT.0.) SLOPE -- (input) data slope on the interval. IERR -- (output) error flag. should be zero. If IERR=-1, assumption on D1 and D2 is not satisfied. If IERR=-2, quadratic equation locating extremum has negative discriminant (should never occur). ------- WARNING: This routine does no validity-checking of arguments. ------- Fortran intrinsics used: ABS, SIGN, SQRT.

SEE ALSO
DPCHCS

ROUTINES CALLED
D1MACH, XERMSG

REVISION HISTORY (YYMMDD)
820218 DATE WRITTEN
820805 Converted to SLATEC library version.
870707 Corrected XERROR calls for d.p. name(s).
870707 Replaced DATA statement for SMALL with a use of D1MACH.
870813 Minor cosmetic changes.
890206 Corrected XERROR calls.
890411 1. Added SAVE statements (Vers. 3.2). 2. Added DOUBLE PRECISION declaration for D1MACH.
890531 Changed all specific intrinsics to generic. (WRB)
890531 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)
900328 Added TYPE section. (WRB)
910408 Updated AUTHOR and DATE WRITTEN sections in prologue. (WRB)
920526 Eliminated possible divide by zero problem. (FNF)
930503 Improved purpose. (FNF)