- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
the program below gives an internal compiler error when compiled with Ifort 11.1 on Windows (build: 20091130). I know it contains a syntax error, but the error message is not clear ;). If I leave out the
"pointer" attribute on zf, a different message is generated which is not very clear either - it claims the name
zf is already used as an external procedure name.
If I correct the syntax error (...%zfunc => zf) it compiles correctly.
Regards,
Arjen
------
! mechanism.f90 --
! Module for registering the implementations of failure mechanisms
!
module mechanism_data
implicit none
type mechanism
character(len=40) :: name ! Name of the mechanism
character(len=40), dimension(:), pointer :: param ! Names of the relevant parameters
procedure(zfunc_evaluation), pointer, nopass :: zfunc ! Pointer to the zfunc subroutine
end type
abstract interface
subroutine zfunc_evaluation( param_value, zvalue )
real, dimension(:), intent(in) :: param_value
real, intent(in) :: zvalue
end subroutine
end interface
end module mechanism_data
module mechanism_general
use mechanism_data
implicit none
type(mechanism), dimension(100) :: registered_mechanism ! Array of mechanisms
integer :: no_registered = 0 ! Number registered
contains
subroutine register_mechanism( name, param, zf )
character(len=*), intent(in) :: name
character(len=*), dimension(:), intent(in) :: param
procedure(), pointer :: zf
integer :: i
if ( no_registered < size(registered_mechanism) ) then
i = no_registered + 1
registered_mechanism(i)%name = name
allocate( registered_mechanism(i)%param(size(param)) )
registered_mechanism(i)%param = param
registered_mechanism(i)%zfunc = zf
else
write(*,*) 'Too many mechanisms! Program stopped'
endif
end subroutine register_mechanism
end module mechanism_general
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If the compiler experienced an internal error, the implication of the terminal statement that it made could not be more clear: "I am so thoroughly confused that I have to stop!".
With your code, the current release (11.1.072) of the Linux version of the compiler gives the error message
[bash] Intel Fortran 11.1-2739After making the modification of leaving out the pointer attribute for zf, the additional error message is
markus.f90(34): error #8321: An EXTERNAL procedure name must not appear as the right side expression in an assignment statement. [ZF]
[/bash]
[bash]The POINTER attribute must be specified for a procedure component definition.The messages appear to be worded reasonably.
procedure(zfunc_evaluation), nopass :: zfunc ! Pointer to the zfunc subroutine
^[/bash]
You may find this recent thread on the Linux/Mac Fortran forum to be of some relevance:
http://software.intel.com/en-us/forums/showthread.php?t=76793&o=d&s=lr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
version for me ;).
Regards,
Arjen

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