; this procedure returns linearly interpolated intermediate ; values from an array storing a list of values of a dependent ; variable; the desired location is that for the value of the ; independent variable input. ; ............................................ pro interp2,index,x,arrayxy,y if (x lt arrayxy(0,0)) then begin y=arrayxy(2,0) endif if (x gt arrayxy(0,index)) then begin y=arrayxy(2,index) endif for i=0,index-1 do begin if ((x ge arrayxy(0,i)) and (x le arrayxy(0,i+1))) then begin y=((x-arrayxy(0,i+1))*arrayxy(2,i)+(arrayxy(0,i)-x)*arrayxy(2,i+1))/(arrayxy(0,i)-arrayxy(0,i+1)) endif endfor return end