implicit deallocation

  • Follow


A few days ago, I realized that Fortran 2008 allows a finalizer to
allocate a local allocatable variable.  That was not possible using
standard conforming Fortran 2003 code.  It is now possible for the
finalizer for a local variable A to cause a local variable B to be
allocated if it is not already allocated.  Similarly, the finalizer
for B could cause A to be allocated if it is not already allocated.
If A or B or both are allocated on exit from a subprogram, the effect
of implicit deallocation does not seem to be defined.  My guess is
that most implementations will end up leaving one of A or B allocated
on exit.  I have not yet been able to test my conjecture, as the test
program requires an implementation that supports both finalizers and
internal procedures as targets of procedure pointers.

Bob Corbett
0
Reply robert.corbett (96) 4/20/2012 2:58:46 AM


0 Replies
54 Views

(page loaded in 0.241 seconds)

Similiar Articles:












7/19/2012 9:11:44 PM


Reply: