concept arrays in category fortran

This is an excerpt from Manning's book Modern Fortran: Building efficient parallel applications.
Shorthand syntax for declaring arrays
Back in section 3.2.2, I gave you a sneak peek into how to replace entire
doloops in the tsunami simulator with single-line, whole-array operations. We’re now going to take a deep dive into Fortran arrays and learn the mechanics of declaring arrays, allocating them in memory, and using them with familiar arithmetic operators. For this chapter, we’ll take a small break from the tsunami simulator and explore Fortran arrays by writing a stock price analysis app. You’ll learn how to declare, allocate, and initialize dynamic arrays; read and store data into them; and then perform whole-array arithmetic to quantify stock performance, volatility, and other metrics. This knowledge will give you a solid foundation for what’s coming in the next few chapters—parallelizing the tsunami simulator with Fortran coarrays and expanding it into two dimensions for more realistic tsunami prediction.
However, you won’t always know the size of the arrays ahead of time. It just so happens that each stock data CSV file has the same number of records (4620), but this may not always be the case, as some companies may have a much longer presence in the public markets than others. Furthermore, if you chose to later work on a different or larger stock price dataset, it would be unwieldy to have to hardcode the size of the arrays every time. This is where dynamic, or, in Fortran lingo, allocatable, arrays come in. Whenever the size of the array is unknown ahead of time, or you anticipate that it will change at some time during the life of the program, declare it as
allocatable:real, allocatable :: h(:) #1Writing more general and flexible apps will also require allocating arrays at runtime.