I have the following problem:
- I use an allocatable structure, which is defined inside a module;
- the module is used in the main program, in "subroutine 1" and in "subroutine 2";
- from the main program sub1 is called, and in turn sub 1 calls sub2;
- inside sub2 I have lines like these:
if (allocated(structure)) deallocate (structure)
allocate (structure(N))
do i=1,N
allocate structure(i).elem(k)
enddo
- when control returns to sub2, the content of the structure is messed up (and I get an error)
- actually this works under Solaris (with f95), but I have this problem using Compaq Visual Fortran (6.6) under windows.
Any suggestion? Thank you.
Alessandro