Modern Fortran
eBook - ePub

Modern Fortran

Building efficient parallel applications

Milan Curcic

Partager le livre
  1. 416 pages
  2. English
  3. ePUB (adapté aux mobiles)
  4. Disponible sur iOS et Android
eBook - ePub

Modern Fortran

Building efficient parallel applications

Milan Curcic

DĂ©tails du livre
Aperçu du livre
Table des matiĂšres
Citations

À propos de ce livre

Modern Fortran teaches you to develop fast, efficient parallel applications using twenty-first-century Fortran. In this guide, you'll dive into Fortran by creating fun apps, including a tsunami simulator and a stock price analyzer. Filled with real-world use cases, insightful illustrations, and hands-on exercises, Modern Fortran helps you see this classic language in a whole new light. Summary
Using Fortran, early and accurate forecasts for hurricanes and other major storms have saved thousands of lives. Better designs for ships, planes, and automobiles have made travel safer, more efficient, and less expensive than ever before. Using Fortran, low-level machine learning and deep learning libraries provide incredibly easy, fast, and insightful analysis of massive data. Fortran is an amazingly powerful and flexible programming language that forms the foundation of high performance computing for research, science, and industry. And it's come a long, long way since starting life on IBM mainframes in 1956. Modern Fortran is natively parallel, so it's uniquely suited for efficiently handling problems like complex simulations, long-range predictions, and ultra-precise designs. If you're working on tasks where speed, accuracy, and efficiency matter, it's time to discover—or re-discover—Fortran.. About the technology
For over 60 years Fortran has been powering mission-critical scientific applications, and it isn't slowing down yet! Rock-solid reliability and new support for parallel programming make Fortran an essential language for next-generation high-performance computing. Simply put, the future is in parallel, and Fortran is already there.Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications. About the book
Modern Fortran teaches you to develop fast, efficient parallel applications using twenty-first-century Fortran. In this guide, you'll dive into Fortran by creating fun apps, including a tsunami simulator and a stock price analyzer. Filled with real-world use cases, insightful illustrations, and hands-on exercises, Modern Fortran helps you see this classic language in a whole new light. What's inside Fortran's place in the modern world
Working with variables, arrays, and functions
Module development
Parallelism with coarrays, teams, and events
Interoperating Fortran with C About the reader
For developers and computational scientists. No experience with Fortran required. About the author
Milan Curcic is a meteorologist, oceanographer, and author of several general-purpose Fortran libraries and applications. Table of Contents PART 1 - GETTING STARTED WITH MODERN FORTRAN1 Introducing Fortran2 Getting started: Minimal working appPART 2 - CORE ELEMENTS OF FORTRAN3 Writing reusable code with functions and subroutines4 Organizing your Fortran code using modules5 Analyzing time series data with arrays6 Reading, writing, and formatting your dataPART 3 - ADVANCED FORTRAN USE7 Going parallel with Fortan coarrays8 Working with abstract data using derived types9 Generic procedures and operators for any data type10 User-defined operators for derived typesPART 4 - THE FINAL STRETCH11 Interoperability with C: Exposing your app to the web12 Advanced parallelism with teams, events, and collectives

Foire aux questions

Comment puis-je résilier mon abonnement ?
Il vous suffit de vous rendre dans la section compte dans paramĂštres et de cliquer sur « RĂ©silier l’abonnement ». C’est aussi simple que cela ! Une fois que vous aurez rĂ©siliĂ© votre abonnement, il restera actif pour le reste de la pĂ©riode pour laquelle vous avez payĂ©. DĂ©couvrez-en plus ici.
Puis-je / comment puis-je télécharger des livres ?
Pour le moment, tous nos livres en format ePub adaptĂ©s aux mobiles peuvent ĂȘtre tĂ©lĂ©chargĂ©s via l’application. La plupart de nos PDF sont Ă©galement disponibles en tĂ©lĂ©chargement et les autres seront tĂ©lĂ©chargeables trĂšs prochainement. DĂ©couvrez-en plus ici.
Quelle est la différence entre les formules tarifaires ?
Les deux abonnements vous donnent un accĂšs complet Ă  la bibliothĂšque et Ă  toutes les fonctionnalitĂ©s de Perlego. Les seules diffĂ©rences sont les tarifs ainsi que la pĂ©riode d’abonnement : avec l’abonnement annuel, vous Ă©conomiserez environ 30 % par rapport Ă  12 mois d’abonnement mensuel.
Qu’est-ce que Perlego ?
Nous sommes un service d’abonnement Ă  des ouvrages universitaires en ligne, oĂč vous pouvez accĂ©der Ă  toute une bibliothĂšque pour un prix infĂ©rieur Ă  celui d’un seul livre par mois. Avec plus d’un million de livres sur plus de 1 000 sujets, nous avons ce qu’il vous faut ! DĂ©couvrez-en plus ici.
Prenez-vous en charge la synthÚse vocale ?
Recherchez le symbole Écouter sur votre prochain livre pour voir si vous pouvez l’écouter. L’outil Écouter lit le texte Ă  haute voix pour vous, en surlignant le passage qui est en cours de lecture. Vous pouvez le mettre sur pause, l’accĂ©lĂ©rer ou le ralentir. DĂ©couvrez-en plus ici.
Est-ce que Modern Fortran est un PDF/ePUB en ligne ?
Oui, vous pouvez accĂ©der Ă  Modern Fortran par Milan Curcic en format PDF et/ou ePUB ainsi qu’à d’autres livres populaires dans Ciencia de la computaciĂłn et Lenguajes de programaciĂłn. Nous disposons de plus d’un million d’ouvrages Ă  dĂ©couvrir dans notre catalogue.

Informations

Éditeur
Manning
Année
2020
ISBN
9781638350057

Part 1. Getting started with Modern Fortran

In this part, you’ll get a taste of Fortran and a gentle introduction into the language.
In chapter 1, we’ll discuss the design and features of Fortran, and the kinds of problems for which Fortran is suitable. You’ll learn why parallel programming is important and when you should use it.
In chapter 2, we’ll build a minimal working example of the tsunami simulator that we’ll be working on throughout the book. This example will give you a taste of the Fortran essentials: variable declaration, data types, arrays, loops, and branches.
If you’re new to Fortran, this is the place to start. At the end of this part of the book, you’ll be able to write simple yet useful Fortran programs. More importantly, you’ll be ready to learn about Fortran essentials in more depth.

1 Introducing Fortran

This chapter covers
  • What is Fortran and why learn it?
  • Fortran’s strengths and weaknesses
  • Thinking in parallel
  • Building a parallel simulation app from scratch
This is a book about Fortran, one of the first high-level programming languages in history. It will teach you the language by guiding you step-by-step through the development of a fully featured, parallel physics simulation app. Notice the emphasis on parallel. Parallel programming allows you to break your problem down into pieces and let multiple processors each work on only part of the problem, thus reaching the solution in less time. By the end, you’ll be able to recognize problems that can be parallelized, and use modern Fortran techniques to solve them.
This book is not a comprehensive reference manual for every Fortran feature--I’ve omitted significant parts of the language on purpose. Instead, I focus on the most practical features that you’d use to build a real-world Fortran application. As we work on our app chapter by chapter, we’ll apply modern Fortran features and software design techniques to make our app robust, portable, and easy to use and extend. This isn’t just a book about Fortran; it’s a book about building robust, parallel software using modern Fortran.

1.1 What is Fortran?

I don’t know what the language of the year 2000 will look like, but I know it will be called Fortran.
--Tony Hoare, winner of the 1980 Turing Award
Fortran is a general-purpose, parallel programming language that excels in scientific and engineering applications. Originally called FORTRAN (FORmula TRANslation) in 1957, it has evolved over decades to become a robust, mature, and high perfomance-oriented programming language. Today, Fortran keeps churning under the hood of many systems that we take for granted:
  • Numerical weather, ocean, and surf prediction
  • Climate science and prediction
  • Computational fluid dynamics software used in mechanical and civil engineering
  • Aerodynamics solvers for designing cars, airplanes, and spacecraft
  • Fast linear algebra libraries used by machine learning frameworks
  • Benchmarking the fastest supercomputers in the world (https://top500.org)
Here’s a specific example. In my work, I develop numerical models of weather, ocean surface waves, and deep ocean circulation. Talking about it over the years, I found that most people didn’t know where weather forecasts came from. They had the idea that meteorologists would get together and draw a chart of what the weather would be like tomorrow, next week, or a month from now. This is only partly true. In reality, we use sophisticated numerical models that crunch a huge amount of numbers on computers the size of a warehouse. These models simulate the atmosphere to create an educated guess about what the weather will be like in the future. Meteorologists use the output of these models to create a meaningful weather map, like the one shown in figure 1.1. This map shows just a sliver of all the data that this model produces. The output size of a weather forecast like this is counted in hundreds of gigabytes.
Figure 1.1 A forecast of Hurricane Irma on September 10, 2017, computed by an operational weather prediction model written in Fortran. Shading and barbs show surface wind speed in meters per second, and contours are isolines of sea-level pressure. A typical weather forecast is computed in parallel using hundreds or thousands of CPUs. (Data provided by the NOAA National Center for Environmental Prediction [NCEP])
The most powerful Fortran applications run in parallel on hundreds or thousands of CPUs. Development of the Fortran language and its libraries has been largely driven by the need to solve extremely large computational problems in physics, engineering, and biomedicine. To access even more computational power than what the most powerful single computer at the time could offer, in the late 20th century we started connecting many computers with high-bandwidth networks and let them each work on a piece of the problem. The result is the supercomputer, a massive computer made up of thousands of commodity CPUs (figure 1.2). Supercomputers are similar to modern server farms hosted by Google or Amazon, except that the network infrastructure in supercomputers is designed to maximize bandwidth and minimize latency between the servers themselves, rather than between them and the outside world. As a result, the CPUs in a supercomputer act like one giant processor with distributed-memory access that’s nearly as fast as local memory access. To this day, Fortran remains the dominant language used for such massive-scale parallel computations.
Figure 1.2 The MareNostrum 4 supercomputer at the Barcelona Supercomputing Center. The computer is housed inside the Torre Girona Chapel in Barcelona, Catalonia, Spain. A high-speed network connects all of the cabinets to each another. With 153,216 Intel Xeon cores, MareNostrum 4 is the fastest supercomputer in Spain, and the 37th fastest in the world as of June 2020. (https://www.top500.org/lists/2020/06). It’s used for many scientific applications, from astrop...

Table des matiĂšres