This book will teach you how to write modern, efficient, and parallel Fortran programs. Working through each chapter, we’ll build from scratch a fully functional, parallel, fluid dynamics solver with a specific application to tsunami prediction. If you work through the book, you’ll come out with three distinct skill sets:
- You’ll be fluent with most modern Fortran features. This is a unique and desired skill in a robust, multibillion-dollar market that is HPC.
- You’ll be able to recognize problems that are parallel in nature. You’ll think parallel-first, and parallel solutions to problems will seem intuitive. In contrast, a serial solution to a parallel problem will become an edge-case scenario.
- You’ll get a grasp on good software design, writing reusable code, and sharing your project with the online community. You’ll also be able to adapt existing Fortran libraries in your project and contribute back. This will not only make your project useful to others, but can open doors in terms of career and learning opportunities. It did for me!
While I’m not expecting you to have prior Fortran experience, I assume you have at least some programming experience in a language like Python, R, MATLAB, or C. We won’t go into detail about what is a program, a variable, a data type, source code, or computer memory, and I’ll assume that you have an idea about these concepts. Occasionally, we’ll touch on elements of calculus, although it’s not crucial that you’re familiar with it. We’ll also work quite a bit in the terminal (compiling and running programs), so I assume you’re at least comfortable navigating the command line. Whatever the case, to help ensure clarity, any Fortran concept in this book will be taught from scratch.
Given the theme of the book, I expect it will be ideal for several audiences, such as the following:
- Undergraduate and graduate students in physical science, engineering, or applied math, especially with a focus on fluid dynamics
- Instructors and researchers in the above fields
- Meteorologists, oceanographers, and other fluid dynamicists working in the industry
- Serial Fortran programmers who want to step up their parallel game
- HPC system administrators
If you fit in one of the above categories, you may already know that Fortran’s main selling point is its ease of programming efficient and parallel programs for large supercomputers. This has kept it as the dominant HPC language of physical sciences and engineering. Although this book will teach you Fortran from the ground up, I will also take the unconventional approach and teach it in the context of parallel programming from the get-go. Rather than gaining just another technical skill as an afterthought, you’ll learn how to think parallel. You’ll recognize ways you can distribute the workload and memory to arrive at the solution more efficiently. With parallel thinking, you’ll come out with two critical advantages:
- You’ll be able to solve problems in less time.
- You’ll be able to solve problems that can’t fit onto a single computer.
While the first is at least a nice-to-have, the second is essential. Some problems simply can’t be solved without parallel programming. The next section will give you a gentle introduction and an example of parallel programming.