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

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

No, it cannot be -

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

I updated the article to make

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

Retired 12/31/2016
0 Kudos