function fintrp(xtab, ytab, ntab, xx) implicit double precision (o-z, a-h) dimension xtab(ntab), ytab(ntab) i1 = locate(xtab,ntab,xx) i2 = i1 + 1 rr = (xx - xtab(i1)) / (xtab(i2) - xtab(i1)) fintrp = ytab(i1) + (rr * (ytab(i2) - ytab(i1))) return end function locate(xtab, ndim, x) implicit double precision (o-z, a-h) dimension xtab(ndim) jl = 0 ju = ndim + 1 10 if ((ju - jl) .gt. 1) then jm = (ju + jl) / 2 if ((xtab(ndim) .gt. xtab(1)) .eqv. (x .gt. xtab(jm))) then jl = jm else ju = jm end if goto 10 end if locate = jl return end