Best practices with arrays: http://mng.bz/pBp2
Summary
- An array is a sequence of values of the same type that is contiguous in memory.
- Arrays are Fortran’s only built-in data structure.
- Fortran arrays can be statically or dynamically allocated, and support up to 15 dimensions.
- You can index and slice arrays to reference specific elements or sections of them.
- Fortran’s
allocateanddeallocatestatements come with built-in error handling. - Take care to never index arrays out of bounds, or you’ll get undesired results and perhaps even crash the program.
- Arrays are the basis of their parallel analog, coarrays, which we’ll explore in chapter 7.
Further reading