Software Archive
Read-only legacy content
17061 Discussions

Modules & allocatable arrays

Deleted_U_Intel
Employee
255 Views
Is it possible to include allocatable arrays in a module - I can find nothing about this in the language reference.

eg.

MODULE grid_cells
IMPLICIT NONE

integer, ALLOCATABLE :: kzn(:)
real, ALLOCATABLE :: znx(:), zny(:)

SAVE

END MODULE grid_cells

Then USE grid_cells in 3 scoping units, the arrays allocated in one of these.

eg. ALLOCATE( znx(max_grids), zny(max_grids), kzn(max_grids) )

The compiler does not like the above syntax. Is there some other way of doing it, or is there no way to include allocatable arrays in a module ?

David
0 Kudos
2 Replies
Steven_L_Intel1
Employee
255 Views
This should work fine. You don't give the actual source code nor the error message, so I have no idea what is going wrong. I suggest you send a short but complete example to us at vf-support@compaq.com and we'll take a look.

Steve
0 Kudos
Steven_L_Intel1
Employee
255 Views
Curious - I have not seen that symptom before. If you can reproduce it in the future, please send a ZIP file of the project to us and we'll take a look.

Steve
0 Kudos
Reply