- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the following piece of code we tried four ways of dimensioning a simple integer-array. The first two methods (dimensioning by a common-block or a subroutine-argument) cause the error-message:
forrtl: severe (170): Program Exception - stack overflow
..., while the third and fourth way of declaring the bounds of the array work properly - all four ways allocate an array of the same size!
Is there an answer to this mystery??
Code (methods 2-4 not active)
forrtl: severe (170): Program Exception - stack overflow
..., while the third and fourth way of declaring the bounds of the array work properly - all four ways allocate an array of the same size!
Is there an answer to this mystery??
Code (methods 2-4 not active)
program test implicit double precision (a-h,o-z) common /mtest/ msize msize = 259931 isize = msize call subtest(isize) end subroutine subtest(i) implicit double precision (a-h,o-z) parameter (lsize = 259931) common /mtest/ msize ! the following two lines fail during run-time: dimension itestarray(i) ! dimension itestarray(msize) ! the following two lines don't fail during run-time: ! dimension itestarray(lsize) ! dimension itestarray(259931) end
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The third and fourth methods allocate the array at fixed addresses at link time, whereas the first and second are "automatic arrays" which get allocated on the stack at run-time.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I have the same problem. It seems that the only way to go around this problem is to expand the stack size. I tried with limit and it is not enough. How can I do this?
thanks
Giancarlo
I have the same problem. It seems that the only way to go around this problem is to expand the stack size. I tried with limit and it is not enough. How can I do this?
thanks
Giancarlo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
giancarlo,
What operating system are you using? You may want to consider using ALLOCATABLE arrays rather than automatic arrays.
Steve
What operating system are you using? You may want to consider using ALLOCATABLE arrays rather than automatic arrays.
Steve

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page