2 SUBROUTINE pchim (N, X, F, D, INCFD, IERR)
143 REAL del1, del2, dmax, dmin, drat1, drat2, dsave,
144 * h1, h2, hsum, hsumt3, three, w1, w2, zero
147 DATA zero /0./, three /3./
152 IF ( n.LT.2 ) go to 5001
153 IF (
incfd.LT.1 ) go to 5002
155 IF (
x(i).LE.
x(i-1) ) go to 5003
163 del1 = (
f(1,2) -
f(1,1))/h1
168 IF (nless1 .GT. 1) go to 10
177 del2 = (
f(1,3) -
f(1,2))/h2
183 w1 = (h1 + hsum)/hsum
185 d(1,1) = w1*del1 + w2*del2
186 IF (
pchst(
d(1,1),del1) .LE. zero)
THEN
188 ELSE IF (
pchst(del1,del2) .LT. zero)
THEN
191 IF (
abs(
d(1,1)) .GT.
abs(dmax))
d(1,1) = dmax
197 IF (i .EQ. 2) go to 40
203 del2 = (
f(1,i+1) -
f(1,i))/h2
209 IF (
pchst(del1,del2) ) 42, 41, 45
214 IF (del2 .EQ. zero) go to 50
227 hsumt3 = hsum+hsum+hsum
228 w1 = (hsum + h1)/hsumt3
229 w2 = (hsum + h2)/hsumt3
234 d(1,i) = dmin/(w1*drat1 + w2*drat2)
242 w2 = (h2 + hsum)/hsum
243 d(1,n) = w1*del1 + w2*del2
244 IF (
pchst(
d(1,n),del2) .LE. zero)
THEN
246 ELSE IF (
pchst(del1,del2) .LT. zero)
THEN
249 IF (
abs(
d(1,n)) .GT.
abs(dmax))
d(1,n) = dmax
262 CALL
xermsg(
'SLATEC',
'PCHIM',
263 +
'NUMBER OF DATA POINTS LESS THAN TWO',
ierr, 1)
269 CALL
xermsg(
'SLATEC',
'PCHIM',
'INCREMENT LESS THAN ONE',
ierr,
276 CALL
xermsg(
'SLATEC',
'PCHIM',
'X-ARRAY NOT STRICTLY INCREASING'