- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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
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
Lien copié
2 Réponses
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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 [email protected] and we'll take a look.
Steve
Steve
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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
Répondre
Options du sujet
- S'abonner au fil RSS
- Marquer le sujet comme nouveau
- Marquer le sujet comme lu
- Placer ce Sujet en tête de liste pour l'utilisateur actuel
- Marquer
- S'abonner
- Page imprimable