Quantcast
Channel: Intel® Fortran Compiler
Viewing all articles
Browse latest Browse all 3270

FINAL routines in Fortran 2003

$
0
0

I am having some trouble understanding the need for and use of FINAL routines in Fortran 2003.  I have a TYPE (or CLASS) which has a second TYPE extending it.  The second TYPE and the first TYPE each have FINAL routines.  I explicitly CALL the FINAL routine for the second TYPE.  According to the F2003 standard, should it be the case that the first FINAL routine gets called as well?  I can run the application in debug and put a break in the first FINAL routine and note it is never reached.

Now here is the heart of the matter.  What is the use of the FINAL routine?  In the deep dark past of which I am accustomed, final-like routines were mainly used to prevent memory leaks.  The current Fortran standard seems to have memory "management" which does not explicitly require a DEALLOCATE statement for every ALLOCATE.  So, what is the use of FINAL?


Viewing all articles
Browse latest Browse all 3270

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>