C ===QUADRATIC INTERPOLATION =============
      REAL*8  FUNCTION KVINT(XX,X,Y,IN,IK)
      REAL*8 XX,X(*),Y(*),T,Z
      INTEGER IK,IN
      K=IN
      L=IK-2
   10 I=(K+L-1)/2.0+0.6
      IF(I.EQ.K) GOTO 20
      IF(XX.GE.X(I)) GOTO 1
      L=I
      GOTO 10
    1 K=I
      GOTO 10
   20 T=XX-X(K)
      Z=((XX-X(K+1))/(X(K)-X(K+2)))*T
      KVINT=Y(K)+(T+Z)/(X(K)-X(K+1))*(Y(K)-Y(K+1))-
     *(Z/(X(K+1)-  X(K+2)))*(Y(K+1)-Y(K+2))
      RETURN
      END
