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

Automatic array overflow

llynisa
Beginner
1,587 Views
I have been successfully calling a subroutine whose integer arguments nRange, nVal & nPtMax are used to set the size of a working array real*4 xydata(nRange*nVal*nPtMax).

All is well when nRange*nVal*nPtMax = 240,000, but when increased to 260,000 it fails with a stack overflow error.

If I set the size of the array to a constant value eg 280,000 it works perfectly. Is there a limit on automatically sized arrays?

Puzzled again

Alan
0 Kudos
3 Replies
TimP
Honored Contributor III
1,587 Views
There's a limit on stack space. Increase it by appending the options /link /stack:nnnnnnnnn




0 Kudos
llynisa
Beginner
1,587 Views
Many thanks for your prompt reply - I now realise that I should have remembered the solution, but it's been a couple of years since I had any similar problems.

Alan
0 Kudos
Steven_L_Intel1
Employee
1,587 Views
I'll note that the on-disk documentation has help under "stack", and there has been a Visual Fortran Newsletter article on the same topic.

Steve
0 Kudos
Reply