subroutine spl1d2(n,x,f,w,ij,y,tab) c where n= number of points in the interpolation c x= origin of table of the independent variable c f= origin of table of the dependent variable c w= origin of table of second derivatives as calculated by c spl1d1 c ij= spacing in the tables f and w c y= the point at which interpolation is desired c tab= an array of dimension 3 which contains the function c value, first derivative, and second derivative at y c-------------------------------------------------------------------------- c dimension x(n),f(n),w(n),tab(3) c-------------------------------------------------------------------------- c* c c locate y in the x table call interv (x,n-1,y,i) 30 mi=(i-1)*ij+1 k1=mi+ij flk=x(i+1)-x(i) c c calculate f(y) c a=(w(mi)*(x(i+1)-y)**3+w(k1)*(y-x(i))**3)/(6.*flk) b=(f(k1)/flk-w(k1)*flk/6.)*(y-x(i)) c=(f(mi)/flk-flk*w(mi)/6.)*(x(i+1)-y) tab(1)=a+b+c c c calculate the first derivative at y c a=(w(k1)*(y-x(i))**2-w(mi)*(x(i+1)-y)**2)/(2.*flk) b=(f(k1)-f(mi))/flk c=flk*(w(mi)-w(k1))/6. tab(2)=a+b+c c c calculate the second derivative at y c tab(3)=(w(mi)*(x(i+1)-y)+w(k1)*(y-x(i)))/flk return end c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++