concept allocate in category fortran

This is an excerpt from Manning's book Modern Fortran: Building efficient parallel applications.
You may have noticed that in both array declarations, we used integer literals to set the size and shape of the array. However, what if our array dimensions are not known until runtime? Fortran provides excellent support for dynamic arrays, also known as allocatable arrays. When you declare an allocatable array, you only specify the rank (number of dimensions) of the array in the declaration, not the size of the dimensions. Once the size is known, the
allocatestatement is used to allocate the array with specified dimensions. Allocatable arrays can also be reallocated dynamically any number of times. You’ll see more on allocatable arrays in chapter 5, where we’ll put them to good use in our app.
It’s also possible to dynamically allocate an array based on the size of another array. The
allocatestatement accepts two optional arguments:
Listing 5.9. Checking for allocation status before and after
allocateanddeallocatestatements.language="fortran" linenumbering="unnumbered">real, allocatable :: a(:) print *, allocated(a) #1 allocate(a(10)) print *, allocated(a) #2 deallocate(a) print *, allocated(a) #3