real function interp(x) real x common /pawc/nwpaw,ixpawc,ihbook,ixhigz,ixkuip,ifence(5), & lmain(8),q(500000) call kuvect('x',ixlo,ixhi) call kuvect('y',iylo,iyhi) do ix=ixlo,ixhi if (q(ix).gt.x) goto 1 end do 1 if (ix.le.ixlo) then interp = q(iylo) else if (ix.gt.ixhi) then interp = q(iylo+ixhi-ixlo) else iy = ix + iylo-ixlo frac = (x - q(ix-1))/(q(ix) - q(ix-1)) interp = q(iy)*frac + q(iy-1)*(1-frac) end if return end