- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In Fortran 2003 standard finalization of derived types is proposed by "final :: " keyword, that could be included in the specification of type. Consider the following example
[fortran]module test_mod type mytyp double precision, allocatable :: a(:,:) contains final :: mytyp_finalize end type contains subroutine mytyp_finalize(arg) implicit none type(mytyp),intent(inout) :: arg if(allocated(arg%a))deallocate(arg%a) end subroutine end module [/fortran]
I have the following error during compilation.
[bash]$ uname -a Linux localhost 2.6.28-11-generic #42-Ubuntu SMP Fri Apr 17 01:58:03 UTC 2009 x86_64 GNU/Linux $ ifort -V Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.1 Build 20091130 Package ID: l_cprof_p_11.1.064 Copyright (C) 1985-2009 Intel Corporation. All rights reserved. FOR NON-COMMERCIAL USE ONLY $ ifort t.f90 t.f90(5): error #5082: Syntax error, found '::' when expecting one of: ( % : . = => final :: mytyp_finalize --------^ t.f90(5): error #6590: This statement is not permitted as a statement within a derived-type-def final :: mytyp_finalize --^ t.f90(6): error #8295: The type bound procedure part in derived type definition must have at least one procedure binding statement. end type -^ compilation aborted for t.f90 (code 1) [/bash]
Does this mean that finalization is not avaliable in the current version of Intel Fortran Compiler? Do you plan to add finalization in the nearest future?
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
correct, FINAL is not currently supported. This will be coming in the next major version of the compiler, tendatively scheduled for fall 2010.
ron
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
correct, FINAL is not currently supported. This will be coming in the next major version of the compiler, tendatively scheduled for fall 2010.
ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you, Ron!

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page