PCHSW(3)

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

NAME
pchsw - Limits excursion from data for PCHCS

LIBRARY
SLATEC (PCHIP)

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

AUTHOR
Fritsch, F. N., (LLNL)

DESCRIPTION
PCHSW: PCHCS Switch Excursion Limiter. Called by PCHCS 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 REAL DFMAX, D1, D2, H, SLOPE CALL PCHSW (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
PCHCS

ROUTINES CALLED
R1MACH, XERMSG

REVISION HISTORY (YYMMDD)
820218 DATE WRITTEN
820805 Converted to SLATEC library version.
870707 Replaced DATA statement for SMALL with a use of R1MACH.
890411 1. Added SAVE statements (Vers. 3.2). 2. Added REAL R1MACH for consistency with D.P. version.
890411 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)