- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This was stated in Steve's article on memory for 32 and 64 bit builds:
In Fortran, COMMON and module variables are always static
Is this true for allocatable arrays in modules as well?
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, it cannot be - allocatable arrays usually have variable sizes (the main reason for making them allocatable) and even if they have the same size throughout the execution of the program, they still have to be allocated before you can use them.
Hence, static and allocatable are not unifiable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I updated the article to make it clear that for POINTER and ALLOCATABLE module variables, it's the "descriptor" that is static.
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