Part III: Interoperability and Ecosystem
"No language is an island." — adapted, with apologies to John Donne, for the age of mixed-language scientific software
No serious scientific code today is written in one language. The fast numerical kernel is in Fortran; the orchestration, the plotting, and the machine learning are in Python; the operating-system glue and some libraries are in C. A modern Fortran programmer is therefore a diplomat — fluent in how Fortran talks to the rest of the software world — and a citizen of an ecosystem of libraries, package managers, and community tools that most people do not know exists. Part III makes you both.
You will learn the standardized, portable way Fortran and C call each other (iso_c_binding), which is
the doorway to essentially every system library and every language that can speak the C ABI. You will
learn to wrap a Fortran routine so Python can call it with f2py — and you will measure, yourself, the
ten-to-a-hundred-fold speedup that justifies the whole exercise for the Python-native reader. And you
will get the lay of the land: LAPACK and BLAS and FFTW, the package manager fpm, the standard library,
and the tools (editors, docs, tests) that make Fortran pleasant in 2026.
What You Will Learn
Chapter 14 — C-Fortran Interoperability. iso_c_binding, bind(c), and passing arrays, strings,
and structs across the language boundary in both directions.
Chapter 15 — Fortran-Python Interoperability. f2py, ctypes, the NumPy column-major gotcha, and
the workflow that pairs Fortran's speed with Python's convenience — with a real, measured speedup.
Chapter 16 — The Fortran Ecosystem. LAPACK, BLAS, FFTW, NetCDF, HDF5; the Fortran Package Manager
(fpm); the standard library; and the editors, documentation generators, and test frameworks that
round out a modern toolchain.
How This Part Fits
Part III depends on procedures (Chapter 6), arrays (Chapter 5), and I/O (Chapter 7). It is placed early — before the numerical and parallel parts — deliberately: once you know how to call C and Python and how to pull in a library, every later chapter can lean on the wider ecosystem instead of reinventing it. Chapter 16 in particular sets up Part V, where you finally put LAPACK to work in Chapter 21.
Time Investment
| Chapter | Title | Difficulty | Est. hours |
|---|---|---|---|
| 14 | C-Fortran Interoperability | Advanced | 5 |
| 15 | Fortran-Python Interoperability | Intermediate | 5 |
| 16 | The Fortran Ecosystem | Intermediate | 4 |
| Part III total | ~14 hours |
Start with Chapter 14: how Fortran and C — the two languages that between them run most of computing — call each other cleanly and portably.