I don’t have much advice for GOTO statements other than that all GOTO cases I have encountered have been fixable, though the fix comes with much agony and mental torture. You can use named block and other constructs to reduce the suffering in disentangling complex spaghetti mixes of GOTO statements. More importantly, my advice for code modernization is to make all entities in the algorithms generically defined, particularly constants. No explicit dependence on a particular type or kind should exist in the algorithm unless enforced by the nature of the problem. This will tremendously simplify migration to templates once they appear in Fortran, hopefully very soon.
2 Likes