I’m having trouble compiling the following test code:
module mymod contains subroutine mysub( A ) real, allocatable, dimension(:,:) :: A allocate( A(4,3) ) A = 3.14 end subroutine mysub end module mymod program test use mymod, only : mysub real, allocatable, dimension(:,:) :: A call mysub( A ) deallocate( A ) end program test
The error message I get is:
PGF90-S-0084-Illegal use of symbol a - must be an allocatable array (test.f90: 5)
The code compiles OK if I change it so that A is no longer being passed out of subroutine mysub. Is there something wrong with my code? Is there a better way to code this? For what it’s worth, this code compiles fine with Intel’s compiler. Thanks for the help.