- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i have one simple Problem with one subroutine, which hangs up, if an internal static allocated array, is to big, means, n_nodes >32000, somewhere. It makes no problem, if i make the array xn, as an allocatable.
Is there some compiler options to set, for larger arrays, or what should i do. I do not want to make all arrays in my subroutines as allocatable, this is to comples.
subroutine profil(n_nodes)
implicit none
integer(4) n_nodes
real xn(3,n_nodes)
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jaeger,
In the example code given the array is allocated from the stack. It would appear that your stack size is too small. See options
/Fn
/STACK:reserve
/STACK:reserve,commit
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
And you may need to specify
real, automatic ::xn(3,n_nodes)
Although in this case since n_nodes is a dummy argument automatic is implicit. (Or it may be allocated from the heap depending on option switches. Note, if the subroutine also contained
real :: tempArray(12345)
And if you wanted to assure that tempArray was on the stack then automatic _may_ be require (dependent on option switches).
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would suggest trying the option /heap-arrays.
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