3 SUBROUTINE spline(JTB,NOLD,XOLD,YOLD,Y2,NNEW,XNEW,YNEW,P,Q)
32 integer,
intent(in) :: JTB,NOLD,NNEW
33 real,
dimension(JTB),
intent(in) :: XOLD,YOLD,XNEW
34 real,
dimension(JTB),
intent(inout) :: P,Q,Y2
35 real,
dimension(JTB),
intent(out) :: YNEW
37 integer NOLDM1,K,K1,K2,KOLD
38 real DXL,DXR,DYDXL,DYDXR,RTDXC,DXC,DEN,XK,Y2K,Y2KP1,DX,RDX, &
45 dydxl=(yold(2)-yold(1))/dxl
46 dydxr=(yold(3)-yold(2))/dxr
49 p(1)= rtdxc*(6.*(dydxr-dydxl)-dxl*y2(1))
59 dydxr=(yold(k+1)-yold(k))/dxr
61 den=1./(dxl*q(k-2)+dxc+dxc)
63 p(k-1)= den*(6.*(dydxr-dydxl)-dxl*p(k-2))
71 200 y2(k)=p(k-1)+q(k-1)*y2(k+1)
81 IF(xold(k2)<=xk)
GO TO 400
88 450
IF(k1==1)
GO TO 500
103 ak=.1666667*rdx*(y2kp1-y2k)
105 ck=rdx*(yold(k+1)-yold(k))-.1666667*dx*(y2kp1+y2k+y2k)
110 ynew(k1)=ak*xsq*x+bk*xsq+ck*x+yold(k)
113 IF(k1<=nnew)
GO TO 300