Without wishing to water down the INTENT=BUG_REPORT, but in the interests of INTENT=HISTORICAL_CURIOSITY, in the absence of the computed GOTO, and without logical IFs and suchlike, one might write:
IF ((I-1)*(15-I)) 80,10,10
10 IF (I-2) 999, 999, 20
20 IF (I-4) 130, 150, 30
30 IF (I-6) 170, 190, 40
40 IF (I-8) 210, 230, 50
50 IF (I-10) 250, 270, 60
60 IF (I-12) 290, 310, 70
70 IF (I-14) 330, 350, 500
80 CONTINUE
Using the ICL Fortran compiler (for Fortran 66 under the George OS on 1900 and 2900 series computers) statement 0 meant 'next line', so this could be written with far fewer statement numbers:
IF ((I-1)*(15-I)) 10,0,0
IF (I-2) 999, 999, 0
IF (I-4) 130, 150, 0
IF (I-6) 170, 190, 0
IF (I-8) 210, 230, 0
IF (I-10) 250, 270, 0
IF (I-12) 290, 310, 0
IF (I-14) 330, 350, 500
10 CONTINUE
This whole shebang would have been on cards, so obviously no comments or blank lines ...
Of course, the IFs could have been interspersed with the code, but I've always preferred to have the route map in advance. Indeed, that rules out for me at least, elaborate IF ... THEN ... etc constructs. The first arithmetic IF provides the range check. If efficiency rather than clarity was the goal, the first statement (in standard, not ICL) might be better as:
IF (I*(16-I)) 80,80,10
By clarity I mean that the statement does not contain the numerical values of the first and last admissible i value, nor the first inadmissible one.
Rather interestingly, one would perhaps change the order of the IF statements and their content to match the frequency with which various I values were likely to crop up to minimise the number of IF statements executed.
And why all this? I believe there is still a role for hand optimisation which (within the limitations of the tools you work with) does not have to lead to difficult to follow code. If I had the list of arithmetic IFs as above, my first step in 'improving' it would be to add a comment or ten explaining what it does, and leave well alone afterwards until I had several idle hours to spend on it.
But I wouldn't write it like that nowadays!
Eddie