Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You kind of have to get a "feel" for what programmers had to do back in the day. The vast majority of the code I work with is older than I am and ran on machines that were "new" when my parents were in high school.</p> <p>Common FORTRAN-isms I deal with, that hurt readability are:</p> <ul> <li>Common blocks</li> <li>Implicit variables</li> <li>Two or three DO loops with shared CONTINUE statements</li> <li>GOTO's in place of DO loops</li> <li>Arithmetic IF statements</li> <li>Computed GOTO's</li> <li>Equivalence REAL/INTEGER/other in some common block</li> </ul> <p>Strategies for solving these involve:</p> <ol> <li>Get <a href="http://www.polyhedron.com/spag0html" rel="noreferrer">Spag / plusFORT</a>, worth the money, it solves a lot of them automatically and Bug Free(tm)</li> <li>Move to Fortran 90 if at all possible, if not move to free-format Fortran 77</li> <li>Add IMPLICIT NONE to each subroutine and then fix every compile error, time consuming but ultimately necessary, some programs can do this for you automatically (or you can script it)</li> <li>Moving all COMMON blocks to MODULEs, low hanging fruit, worth it</li> <li>Convert arithmetic IF statements to IF..ELSEIF..ELSE blocks</li> <li>Convert computed GOTOs to SELECT CASE blocks</li> <li><p>Convert all DO loops to the newer F90 syntax</p> <pre><code>myloop: do ii = 1, nloops ! do something enddo myloop </code></pre></li> <li><p>Convert equivalenced common block members to either ALLOCATABLE memory allocated in a module, or to their true character routines if it is Hollerith being stored in a REAL</p></li> </ol> <p>If you had more specific questions as to how to accomplish some readability tasks, I can give advice. I have a code base of a few hundred thousand lines of Fortran which was written over the span of 40 years that I am in some way responsible for, so I've probably run across any "problems" you may have found.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload