Strange label usage for an IF condition in a DO loop [duplicate]

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

Leave a Comment