Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Stack overflow (matrices)

dan789
Beginner
890 Views
When I am passing to my subroutine a 3D matrix (0:8, 40, 40), etc, the program works correctly. But when I am passing matrix (0:10, 59, 59), or higher number of elements, it causes stack overflow error. Are there any constrains on the number of matrix elements in CFV? Thanks!
0 Kudos
3 Replies
Steven_L_Intel1
Employee
890 Views
No, but the default stacksize is limited and the compiler may create array temporaries on the stack. See the on-disk documentation index under "stack, setting size of" for information on how to increase this.
0 Kudos
TimP
Honored Contributor III
890 Views
If you're running into the default stack limit, use the corresponding Windows link option
/link /stack:nnnnnnnnn
until your stack fills up the available space for your OS. There's about 200MB more in Windows 2000 SP4 than in Windows XP SP2. Some installed applications eat into it. Steve has written comprehensive articles on this link option, which may be part of his project to resurrect his Fortran reference site.
0 Kudos
dan789
Beginner
890 Views
Isee. Thank you
0 Kudos
Reply