we ran into a problem with an abstract interface. The code below is
not accepted by the Intel Fortran
compiler (version 11) but is accepted by a recent version of gfortran
(4.4.1):
!module MessageHandlingInterface
! abstract interface
! subroutine callbackiface(level)
! integer, intent(in) :: level
! end subroutine callbackiface
! end interface
!end module MessageHandlingInterface
module MessageHandling
! use MessageHandlingInterface
implicit none
abstract interface
subroutine callbackiface(level)
integer, intent(in) :: level
end subroutine callbackiface
end interface
procedure(callbackiface), pointer :: mh_callback => null()
contains
subroutine SetMessageHandling(callback)
procedure(callbackiface), optional, pointer :: callback
if (present(callback) ) mh_callback =>callback
end subroutine SetMessageHandling
end module
The Intel Fortran compiler complains that the callbackiface interface
is not declared.
Strangely enough, if we move the interface to a separate module, it
does accept the
code. Which compiler is right?
Regards,
Arjen
The code seems to be valid and it compile just fine with a newer version
of ifort (11.1.046).
Tobias
Yes, i too tested the code with ifort 11.1 and its compiling.
Good to hear that - I will have to ask my IT colleagues about it.
Regards,
Arjen