I’ve recently come to maintain a large amount of scientific calculation-intensive FORTRAN code. I’m having difficulties getting a handle on all of the, say, nuances, of a forty year old language, despite google & two introductory level books. The code is rife with ‘performance enhancing improvements’. Does anyone have any guides or practical advice for de-optimizing FORTRAN into CS 101 levels? Does anyone have knowledge of how FORTRAN code optimization operated? Are there any typical FORTRAN ‘gotchas’ that might not occur to a Java/C++/.NET raised developer taking over a FORTRAN 77/90 codebase?
I’ve recently come to maintain a large amount of scientific calculation-intensive FORTRAN code. I’m
Share
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.
Common FORTRAN-isms I deal with, that hurt readability are:
Strategies for solving these involve:
Convert all DO loops to the newer F90 syntax
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
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.