subroutine intrr1(rdat,n) c c interpolates missing (.lt.0) values in real count array rdat(n) c will allow up to 3 contiguous non-defined values, more than three and c interpolation is inhibited. c c v1.0 jfe johnson 15 nov 81 c real rdat(n) real factj(2,2),factk(2,2) data factj/0.5,0.333,0.667,0.5/ data factk/0.5,0.667,0.333,0.5/ c do 10 i=1,n c is this value defined ? if(rdat(i).ge.0.0)go to 10 c no, so look at left side if(i.le.1)go to 10 j=i-1 if(rdat(j).ge.0.0)go to 20 if(j.le.1)go to 10 j=j-1 if(rdat(j).ge.0.0)go to 30 go to 10 20 il=1 go to 40 30 il=2 40 continue c now look at right side if(i.ge.n)go to 10 k=i+1 if(rdat(k).ge.0.0)go to 50 if(k.ge.n)go to 10 k=k+1 if(rdat(k).ge.0.0)go to 60 go to 10 50 ir=1 go to 70 60 ir=2 70 continue c appropriate combination defined - so interpolate rdat(i)=factj(il,ir)*rdat(j)+factk(il,ir)*rdat(k) 10 continue return end