subroutine splint(xa,ya,y2a,n,x,y) C + + + argument definitions + + + real x, y, y2a, ya, xa integer n C + + + local variables integer klo, khi, k real h, a, b dimension xa(n),ya(n),y2a(n) klo=1 khi=n c.... begin debug lines c do i=1,13 c write (56,*)'n=',n,' xa(i)=', xa(i),' ya(i)=',ya(i), c & ' y2a(i)=',y2a(i) c end do c ......end debug lines 1 IF (KHI-KLO.GT.1) THEN K=(KHI+KLO)/2 IF(XA(K).GT.X)THEN KHI=K ELSE KLO=K ENDIF GOTO 1 ENDIF H=XA(KHI)-XA(KLO) IF (H.EQ.0.) PAUSE 'Bad XA input.' A=(XA(KHI)-X)/H B=(X-XA(KLO))/H Y=A*YA(KLO)+B*YA(KHI)+ * ((A**3-A)*Y2A(KLO)+(B**3-B)*Y2A(KHI))*(H**2)/6. c.... debug line write(56,*)x,y RETURN END