Ben Blackwell wrote:
> Within a module, I have the following statement:
> real(kind=wp), dimension(:), allocatable :: dx
BTW, maybe put a SAVE here (though I am not sure)?
> allocate(dx(num_elem))
May I suggest you try a small example and see if you can reproduce what the
problem is. There may be other things that you are not stating. For example,
a local allocatable array called dx would mask over the global one. The
following for example works for me on 3 different compilers.
module mod1
real, dimension(:), allocatable :: dx
contains
subroutine sub1
allocate(dx(10))
end subroutine sub1
end module mod1
program pr1
use mod1
call sub1
dx=10.0
end program
Best,
Aleksandar
|