function jget(tv) IMPLICIT NONE include 'parameter.par' include 'common.com' integer jget, j double precision tv,tc,tp,dp,dc c------------------------------------------------------------------------------ if(tv.le.tmn)then jget = 0 return endif if(tv.gt.tmx)then jget = n return endif do j=1,n-1 tc = temp(j) tp = temp(j+1) dp = tp-tv dc = tc-tv if(dc*dp.lt.0.0)then jget = j if(j.lt.1.or.j.gt.n-1)stop 'jget: bad j' return endif end do stop 'jget: unallowed exit' end c------------------------------------------------------------------------------