From: Arjen Markus on
Hello,

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
From: Tobias Burnus on
On 02/08/2010 10:33 AM, Arjen Markus wrote:
> 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):

The code seems to be valid and it compile just fine with a newer version
of ifort (11.1.046).

Tobias
From: aerogeek on
On Feb 8, 8:11 pm, Tobias Burnus <bur...(a)net-b.de> wrote:
> On 02/08/2010 10:33 AM, Arjen Markus wrote:
>
> > 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):
>
> 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.
From: Arjen Markus on
On 9 feb, 02:26, aerogeek <sukhbinder.si...(a)gmail.com> wrote:
> On Feb 8, 8:11 pm, Tobias Burnus <bur...(a)net-b.de> wrote:
>
> > On 02/08/2010 10:33 AM, Arjen Markus wrote:
>
> > > 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):
>
> > 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