allocatable arrays in commom blocks ?

Hi there

I think it is a basic question, but Can I use allocatable arrays in commom blocks ?

I am running on Debian and using F90 .

Best,
RNT

Hi RNT,

No, allocatable arrays can not be used in a common block.

  • Mat

Hi Mat

Thank for you response. Let me ask you one more thing.
I also try use the allocatable array as an argument between the subroutines. It also doens’t work.
Is there any way to solve this ? If not, the final conclusion is :
In Fortran, any allocatable array it is confined in the routine where it was allocated, is this correct ?

Thank you in advance
Cheers
RNT

Hi RNT,

also try use the allocatable array as an argument between the subroutines. It also doens’t work.

This is illegal in F95 but has been added as an extension to the language and has been adopted in the F2003 standard. The PGI pgf95 compiler will have support for this extension in the up-coming 7.0 release.

Is there any way to solve this ? If not, the final conclusion is :
In Fortran, any allocatable array it is confined in the routine where it was allocated, is this correct ?

Either use POINTERS or place your allocatable arrays inside modules.

Hope this helps,
Mat