- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My understanding is that /Qsave will place almost all variables into static allocation. I have also read that arrays declared as:
Subroutine Example(A,n)
Integer :: n
Integer :: A(n)
The rest of the program...
End Subroutine
Are allocated on the stack unless /heap-arrays is specified. Where are arrays of these type (automatic arrays?) allocated with the /Qsave switch? I appreciate any insight anyone might be able to offer. Thanks.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your example is what is called an "adjustable array" - a dummy argument whose bounds are taken from another dummy argument (or a COMMON or module variable.) Its allocation comes from the caller.
Now if you had left A out of the argument list, then you'd indeed have an automatic array. /Qsave has no effect on these. An automatic array is stack allocated unless /heap-arrays is in effect.
/Qsave applies to local variables that are not automatic. It is the equivalent of adding SAVE for every non-automatic variable in the routine. One unfortunate side effect is that it also makes any ALLOCATABLE variables SAVEd, which may not be what you want.

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