I’ll illustrate the kind of problem where Fortran really shines. Let’s call this example “Summer ends on old Ralph’s farm.”
Farmer Ralph has two sons and two daughters, and a big farm. It’s the end of the summer and about time to cut the grass and make hay for the cattle to eat. But the pasture is big, and old Ralph is weak. His children, however, are young and strong. If they all work hard and as a team, they could get it done in a day. They agree to split the work between themselves in four equal parts. Each of Ralph’s children grabs a scythe and a fork and heads to their part of the pasture. They work hard, cutting grass row by row. Every hour or so, they meet at the edges to sharpen their tools and chat about how it’s going. The work is going well, and almost all of the grass is cut by mid-afternoon. Near the end of the day, they collect the hay into bales and take them to the barn. Old Ralph is happy that he has strong and hard-working children, but even more so that they make such a great team! Working together, they completed work that would take four times as long if only one of them was working.
Now you must be thinking, what the heck does old Ralph’s farm have to do with parallel Fortran programming? More than meets the eye, I can tell you! Old Ralph and his big pasture are an analogy to a slow computer and a big compute problem. Just like Ralph asked his children to help him with the chores, in a typical parallel problem we’ll divide the computational domain, or input data, into equal pieces and distribute them between CPUs. Recall that his children cut the grass row by row–some of the most efficient and expressive aspects of Fortran code are the whole-array operations and arithmetic. Periodically, they met at the edges to sharpen their tools and have a chat. In many real-world apps, you’ll instruct the parallel processes to exchange data, and this is true for most of the parallel examples that I’ll guide you through in this book. Finally, each parallel process asynchronously writes its data to disk, like taking the hay bales to the barn. I illustrate this pattern in figure 1.3.

Figure 1.3 Parallel programming patterns: divide the problem, exchange data, compute, and store the results to disk
Much like farmer Ralph, Fortran is old. This is by no means a bad thing! It’s a mature, robust, and dependable language that isn’t going anywhere. Although it does have some quirks of an old programming language, it’s been improved over decades by generations of computer scientists and programmers, and has been battle-tested in countless applications where performance is critical. The ease of parallel programming with Fortran is key for high-performance apps, which is why I made it a central theme of this book.