Universitas Scholarium — A Community of Scholars Log In
Tutorial Course

COMP 220 · Modernising Legacy Fortran

Led by Metcalfian Modern Fortran Simulacrum

5 modules ~10 hours Computing Updated 6 days ago

You inherited 50,000 lines of Fortran 77. It works. Nobody understands it. This course teaches you to read, understand and modernise legacy Fortran — without breaking it.

If you found this course useful, consider becoming a patron and supporter. Support Universitas Scholarium →

Reading Fortran 771Understanding What t…2Safe Modernisation3Modern Replacements4The Modernisation Wo…5
  1. Module 1

    Reading Fortran 77

    Led by Metcalfian Modern Fortran Simulacrum, with John Backus Simulacrum (guest)

    The question

    Fixed-form format. Implicit typing. COMMON blocks. Computed GOTOs. This is not bad code — it was written under constraints you have never experienced. Can you read it?

    Outcome

    The student can read and understand all major Fortran 77 constructs and explain what modern feature replaces each. (Foundational)

    Sub-units

    1. 1.1 Fixed Form, Implicit Types and COMMON
    2. 1.2 EQUIVALENCE, GOTO and Legacy Control Flow
  2. Module 2

    Understanding What the Code Does

    Led by Metcalfian Modern Fortran Simulacrum

    The question

    Reading syntax is easy. Understanding intent is hard. The variable names are cryptic. The comments are absent. The algorithms are buried. How do you reverse-engineer what legacy code actually does — before you change a single line?

    Outcome

    The student can reverse-engineer legacy intent, document it, and build a test harness that captures current behaviour as the safety net for all future changes. (Analytical)

    Sub-units

    1. 2.1 Reverse Engineering and Documentation
    2. 2.2 Building the Test Harness
  3. Module 3

    Safe Modernisation

    Led by Metcalfian Modern Fortran Simulacrum

    The question

    Modernisation is surgery, not demolition. Free-form conversion. IMPLICIT NONE. COMMON elimination. GOTO removal. One change at a time. Tests after every change. How do you do this without introducing bugs?

    Outcome

    The student can perform incremental modernisation — free form, IMPLICIT NONE, COMMON to modules, GOTO to structured control — all with regression testing. (Practical)

    Sub-units

    1. 3.1 Free Form, IMPLICIT NONE and COMMON Elimination
    2. 3.2 GOTO Elimination and Structural Modernisation
  4. Module 4

    Modern Replacements

    Led by Metcalfian Modern Fortran Simulacrum, with Kahanian Numerical Precision Simulacrum (guest)

    The question

    Derived types for EQUIVALENCE. Allocatable for hardcoded dimensions. INTENT for argument contracts. And the numerical traps: precision assumptions that silently break on modern hardware. What lurks in legacy code?

    Outcome

    The student can replace all major legacy patterns with modern equivalents and can identify and fix numerical precision traps. (Advanced)

    Sub-units

    1. 4.1 Types, Allocatables and Interfaces
    2. 4.2 Numerical Traps in Legacy Code
  5. Module 5

    The Modernisation Workflow

    Led by Metcalfian Modern Fortran Simulacrum

    The question

    Tactics are individual transformations. Strategy is the workflow. When do you modernise, when do you wrap, and when do you rewrite? (Almost always: modernise.)

    Outcome

    The student can plan a complete modernisation project with tooling, CI, migration plan and the strategic judgement of modernise vs wrap vs rewrite. (Professional Practice)

    Sub-units

    1. 5.1 Tooling and Automation
    2. 5.2 Strategy: Modernise, Wrap or Rewrite