In this related thread it is mentioned that stack overflows should be dealt with using /heap-arrays (Fortran > Optimization > Heap Arrays > 0). (that means specify 0, not a number >0).
Quite a few years ago I dealt with such a problem with the Linker/System/Stack Reserve size option, i.e. /STACK:50000000, probably at Dr. Fortran's suggestion, but maybe not, it was so long ago.
Is Heap Arrays now the recommended way? Are there any gotcha's to be aware of? This is with regards to a console EXE program running in Windows.
My first recommendation is to enable heap-arrays.
If you do choose /LINK /STACK, don't start with a high value. Start at 100000000 and increase in units of the same. Too high a value will prevent the program from running at all.
I'll give heap-arrays a shot. Given that in visual studio this option is on the Fortran/Optimizations tab, is this option affected by other optimization settings?
For a long time now I have been using /stack with 50 million without any trouble. I was revisiting this because overflow happened today when running a Release build for which I forgot to set it. It also requires running a calculation case with a relatively large input model since small models do not trigger it.