I am not sure which version of Fortran is this piece of code, also I am not very good at it but here is the piece of code that I try to understand...
DO 55 J=1,N
IF(KODE(J)) 55,55,40 ! Can not figure out what this line does
40 DO 50 I=1,N
CH=G(I,J)
G(I,J)=-H(I,J)
H(I,J)=-CH
50 CONTINUE
55 CONTINUE
In the loop given above, could you help me to understand what the 2nd line does, specifically the labels 55,55,40
This is a code from a boundary element book that I am trying to understand...
Wow ... I haven't seen that syntax in a while. That is a Fortran Arithmetic IF Statement. The result of KODE(J)
is a number. If it is less than zero, then the first jump is used, if it is equal to zero, then the second jump is used, otherwise, the third jump is used. This is roughly equivalent to:
X=KODE(J)
IF (X.LT.0) GO TO 55
IF (X.EQ.0) GO TO 55
GO TO 40
My Fortran skills have faded significantly, but this is what I remember.
In this particular case, even simpler for programmer to write
X=KODE(J)
IF (X.LE.0) GO TO 55
GO TO 40