Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
17 Views

allocatable arrays in modules an static memory

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?

0 Kudos
2 Replies
Highlighted
Valued Contributor II
17 Views

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.

0 Kudos
Highlighted
17 Views

I updated the article to make it clear that for POINTER and ALLOCATABLE module variables, it's the "descriptor" that is static.

0 Kudos