PCHCS(3)

SYNOPSIS
SUBROUTINE PCHCS (SWITCH, N, H, SLOPE, D, INCFD, IERR)

NAME
pchcs - Adjusts derivative values for PCHIC

LIBRARY
SLATEC (PCHIP)

TYPE
SINGLE PRECISION (PCHCS-S, DPCHCS-D)

AUTHOR
Fritsch, F. N., (LLNL)

DESCRIPTION
PCHCS: PCHIC Monotonicity Switch Derivative Setter. Called by PCHIC to adjust the values of D in the vicinity of a switch in direction of monotonicity, to produce a more "visually pleasing" curve than that given by PCHIM . ---------------------------------------------------------------------- Calling sequence: PARAMETER (INCFD = ...) INTEGER N, IERR REAL SWITCH, H(N), SLOPE(N), D(INCFD,N) CALL PCHCS (SWITCH, N, H, SLOPE, D, INCFD, IERR) Parameters: SWITCH -- (input) indicates the amount of control desired over local excursions from data. N -- (input) number of data points. (assumes N.GT.2 .) H -- (input) real array of interval lengths. SLOPE -- (input) real array of data slopes. If the data are (X(I),Y(I)), I=1(1)N, then these inputs are: H(I) = X(I+1)-X(I), SLOPE(I) = (Y(I+1)-Y(I))/H(I), I=1(1)N-1. D -- (input) real array of derivative values at the data points, as determined by PCHCI. (output) derivatives in the vicinity of switches in direction of monotonicity may be adjusted to produce a more "visually pleasing" curve. The value corresponding to X(I) is stored in D(1+(I-1)*INCFD), I=1(1)N. No other entries in D are changed. INCFD -- (input) increment between successive values in D. This argument is provided primarily for 2-D applications. IERR -- (output) error flag. should be zero. If negative, trouble in PCHSW. (should never happen.) ------- WARNING: This routine does no validity-checking of arguments. ------- Fortran intrinsics used: ABS, MAX, MIN.

SEE ALSO
PCHIC

ROUTINES CALLED
PCHST, PCHSW

REVISION HISTORY (YYMMDD)
820218 DATE WRITTEN
820617 Redesigned to (1) fix problem with lack of continuity approaching a flat-topped peak (2) be cleaner and easier to verify. Eliminated subroutines PCHSA and PCHSX in the process.
820622 1. Limited fact to not exceed one, so computed D is a convex combination of PCHCI value and PCHSD value. 2. Changed fudge from 1 to 4 (based on experiments).
820623 Moved PCHSD to an inline function (eliminating MSWTYP).
820805 Converted to SLATEC library version.
870813 Minor cosmetic changes.
890411 Added SAVE statements (Vers. 3.2).
890531 Changed all specific intrinsics to generic. (WRB)
890831 Modified array declarations. (WRB)
890831 REVISION DATE from Version 3.2
891214 Prologue converted to Version 4.0 format. (BAB)
900328 Added TYPE section. (WRB)
910408 Updated AUTHOR section in prologue. (WRB)
930503 Improved purpose. (FNF)