Difference between automatic arrays on the heap and allocatable arrays

Thank you @sblionel for the informative explanation.

It is great to hear that there is no practical difference between automatic arrays on the heap and allocatable arrays. This makes me determined to use automatic arrays whenever possible (in combination with compiler options like heap-arrays), following the same preference as the implementation of stdlib. Comparing sf_auto with sf_alloc or af_auto with af_alloc, it is clear to me that the automatic version is cleaner and more intuitive.

The price is that all arrays in the code would have the overhead of using the heap. This is acceptable in my applications if not negligible. In addition, using the stack has the risk of causing segmentation faults. In many applications, I think it is better to stay on the safe side.

Another price is the need for compiler options like -heap-arrays. For those who write code only for themselves, this is not a real problem. It is more of a concern if we aim to release the source code for others to use, since the users may use our code in part rather than as a whole, possibly missing the compiler options we specify. However, since there are many other options needed already, e.g., fp-model=strict, I do not think one more is a huge burden.