I want to do a simple linear interpolation between points. I read in the following data using
DO 50 I = 1,NUMBR,1
READ(25,*)MD(I),INC(I),AZM(I)
50 CONTINUE
Data
MD(I) INC(I) AZM(I) 0 0 0 100 0.21 24.234 200 0.255 22.873 300 0.347 37.584 400 0.459 39.115 500 0.419 28.605 600 0.586 344.075 700 0.623 341.053 800 0.59 338.811 900 0.47 354.067 1000 0.36 351.009
I use the next routine to read in points that may may or or may not equal to main point set.
DO 51 K = 1,POINTS,1 READ(25,*)MD(K) 51 CONTINUE
Data
MD(K) 150 250 350
I then use the following loop to find do a linear interpolation to find INC(K) and AZM(K). This is the routine I am using:
399 DO 400 I = 1,NUMBR,1 IF(MD(K).EQ.MD(I))MD(K)=MD(I) INC(K)=INC(I) AZM(K)=AZM(I) ELSEIF(MD(K).GE.MD(I).AND.MD(K).LT.MD(I+1))THEN DMD(K)=DMD(K)-MD(I) INC(K)=INC(I)+((INC(I+I)-INC(I))((MD(K)-MD(I))/DMD(I+1))) AZM(K)=AZM(I)+((AZM(I+I)-AZM(I))((MD(K)-MD(I))/DMD(I+1))) ENDIF 400 CONTINUE
I get the error 'Found ELSE IF without a corresponding IF statement'.
Anyone have an idea of what is wrong and how do I fix the error?