Fortran procedures: modules, interfaces and intent

8 steps · about 3 h 5 min · Intermediate

  1. Learn — Fortran Programming Language (guide, fortran-lang.org, 10 min)

    Start at the community's official learning hub to see where the quickstart and reference material sit.

  2. Organising code structure — Fortran Programming Language (tutorial, fortran-lang.org, 40 min)

    This gives the core pattern in one page: subroutines and functions in modules, with intent(in/out/inout), assumed-shape arrays and optional arguments.

  3. Fortran 90 Tutorial (tutorial, PPPL (Hammett), 30 min)

    A short walk through INTENT, optional and keyword arguments, and when an interface block is obligatory.

  4. Program units and procedures — Fortran Programming Language (tutorial, fortran-lang.org, 25 min)

    This explains why explicit interfaces matter and why placing procedures in a module is the best way to get one.

  5. Explicit Interfaces for External Procedures (reference, Virginia Tech course notes, 15 min)

    Once modules are clear, this shows how to write interface blocks for legacy external procedures you cannot move into a module.

  6. Intent of dummy arguments (doc, IBM Documentation, 10 min)

    A compiler vendor's view of how INTENT enables error checking and optimisation.

  7. INTERFACE (doc, Intel Fortran documentation, 15 min)

    The precise rules for interface blocks, including generic names and which procedures already have explicit interfaces.

  8. Introduction to Modern Fortran Modules and Interfaces (guide, Nick Maclaren, University of Cambridge, 40 min)

    A university-course treatment of module design and its pitfalls, such as very large modules and procedure arguments.