Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28457 Discussions

allocatable arrays in modules an static memory

Chris_H_3
Beginner
335 Views

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
Arjen_Markus
Honored Contributor I
335 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
Steven_L_Intel1
Employee
335 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
Reply