Yesterday I have noticed something peculiar when deallocating a fortran array. I declared an allocatable array, allocated it with a (lx,ly,lz) shape using the allocate function and then deallocated it. However after deallocation if I print shape(array) it still gives me the shape I gave the array. Allocated(array) returns .false. as expected though. I am using gfortran-10, no pointers.
Asked
Active
Viewed 49 times
0
-
The linked question asks about `size` instead of `shape`, but the same thing holds: you are not allowed to ask the shape of an array which is not allocated. If you do, you don't have a Fortran program and the compiler is allowed to give any answer it wants to give. – francescalus Sep 22 '21 at 10:26
-
Thank you for the explanation :) – mgo.fis Sep 22 '21 at 17:34