In the following program, FTN95 remembers the shape of the allocatable array after it is deallocated. In other compilers the call to Shape generates a run-time error.
Program p
Integer, Dimension(:), Allocatable :: i
Allocate (i(2))
Deallocate (i)
Print*, Shape(i), Allocated(i)
End Program p
In my larger programme I am getting inconsistent behaviour when it is rerun with exactly the same inputs. I am wondering whether this problem is somehow related. Occasionally it seems that FTN95 returns an error when trying to reallocate this memory (I am using IOSTAT=, which returns 1), although I can confirm that allocated (i) is false before the call.