in reply to limit stacksize unlimited

Sounds like some kernel parameter to me (I assume you use Unix?). A command like "limit stacksize unlimited" increases the limit to a maximum value (some kernel parameter). You can increase the maximum value if it's too small or fix it on the Fortran side (This is from the top of my head). See Set shell environment variables from within a perl script . Maybe run the ulimit command?

Hope this helps.

Update:
Maybe
Compiler and tools tricks is of any help?