I've had stack overflows happen when I tried to initialize large variables inside of a subroutine/function. My solution was to initialize them inside of the main stack, the main program that calls the subroutine.
In my project, I use the module to dynamicly allocate the variables and array variables. I guss it do not have the same reasons as you mentioned.
However, I use a few libraries which are compiled in Compaq Visual Fortran. I got a lot warnings about these lirbraries, but no error. I am thinking whether these libraries will cause the stack overflow.
Does anybody have ideas?