ABSTRACT

An allocatable array is a variety of “deferred-shape” array. (There is another variety, the “array pointer”, dealt with in Section 13.5.) An allocatable array is initially declared with a certain rank, i.e. a certain number of dimensions, but the extent of each dimension (the “bounds”) can be set and may be changed during the running of the program. This can be very valuable when a processor is limited in memory and it means that a program may expand and contract its memory requirements during running to minimize the demands made on the processor. For example, a program may need a large amount of memory to read a database, but may then carry out an analysis using just a small fraction of the input information: using allocatable arrays, most of the memory needed at input could be released by the program when it proceeds to the analysis stage.