Modules & allocatable arrays

Modules & allocatable arrays

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

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

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

Steve - Intel Developer Support

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

Steve - Intel Developer Support

Leave a Comment

Please sign in to add a comment. Not a member? Join today