- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
When I use the -gen-interface option I would expect that the resulting interface definition is startdard conform. This is not the case. In my subroutine definition I have a parameter i of type integer. I would expect in the interface definition to have I of type integer as well, but is is of integer(kind=4). For the Intel compiler this might be identical but this is not standard conforming (see also http://gcc.gnu.org/onlinedocs/gcc-3.4.6/g77/Kind-Notation.html).
My input file is:
===========
Module interf_tst
INTEGER, PARAMETER :: dp=kind(1.0D0)
end module
subroutine tst_interf(i, r, d, p)
use interf_tst
implicit none
integer :: i
real :: r
double precision :: d
real(kind=dp) :: p
end
Resulting interface file:
==================
!COMPILER-GENERATED INTERFACE MODULE: Mon Mar 21 14:59:15 2011
MODULE TST_INTERF__genmod
INTERFACE
SUBROUTINE TST_INTERF(I,R,D,P)
INTEGER(KIND=4) :: I
REAL(KIND=4) :: R
REAL(KIND=8) :: D
REAL(KIND=8) :: P
END SUBROUTINE TST_INTERF
END INTERFACE
END MODULE TST_INTERF__genmod
Expected interface fle:
=================
!COMPILER-GENERATED INTERFACE MODULE: Mon Mar 21 14:59:15 2011
MODULE TST_INTERF__genmod
INTERFACE
SUBROUTINE TST_INTERF(I,R,D,P)
INTEGER :: I
REAL :: R ! or REAL(KIND=.0E0) :: R
DOUBLE PRECISION :: D ! or READ(KIND=.0D0) :: D
REAL(KIND=dp) :: P
END SUBROUTINE TST_INTERF
END INTERFACE
END MODULE TST_INTERF__genmod
Fortran compiler version: c11.1.059_f11.1.059
Best regards,
Albert
My input file is:
===========
Module interf_tst
INTEGER, PARAMETER :: dp=kind(1.0D0)
end module
subroutine tst_interf(i, r, d, p)
use interf_tst
implicit none
integer :: i
real :: r
double precision :: d
real(kind=dp) :: p
end
Resulting interface file:
==================
!COMPILER-GENERATED INTERFACE MODULE: Mon Mar 21 14:59:15 2011
MODULE TST_INTERF__genmod
INTERFACE
SUBROUTINE TST_INTERF(I,R,D,P)
INTEGER(KIND=4) :: I
REAL(KIND=4) :: R
REAL(KIND=8) :: D
REAL(KIND=8) :: P
END SUBROUTINE TST_INTERF
END INTERFACE
END MODULE TST_INTERF__genmod
Expected interface fle:
=================
!COMPILER-GENERATED INTERFACE MODULE: Mon Mar 21 14:59:15 2011
MODULE TST_INTERF__genmod
INTERFACE
SUBROUTINE TST_INTERF(I,R,D,P)
INTEGER :: I
REAL :: R ! or REAL(KIND=.0E0) :: R
DOUBLE PRECISION :: D ! or READ(KIND=.0D0) :: D
REAL(KIND=dp) :: P
END SUBROUTINE TST_INTERF
END INTERFACE
END MODULE TST_INTERF__genmod
Fortran compiler version: c11.1.059_f11.1.059
Best regards,
Albert
Link kopiert
3 Antworten
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Albert,
I think you misunderstand the use of -gen-interface. This is part of the Intel compiler's "interface checking" diagnostic feature and is not intended as a general purpose mechanism for creating portable interfaces. The kind is part of the interface because when you compiled TST_INTERF, default integer was kind 4. The generated .f90 is really just a side-effect for your reference and is not used by the compiler.
In any case, the use of KIND=4 certainly is standard-conforming, though it may not be portable since kind values are implementation-dependent.
I think you misunderstand the use of -gen-interface. This is part of the Intel compiler's "interface checking" diagnostic feature and is not intended as a general purpose mechanism for creating portable interfaces. The kind is part of the interface because when you compiled TST_INTERF, default integer was kind 4. The generated .f90 is really just a side-effect for your reference and is not used by the compiler.
In any case, the use of KIND=4 certainly is standard-conforming, though it may not be portable since kind values are implementation-dependent.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Steve,
I know that the compiler is not using the generated .f90 file (and I don't think it wil use the mod file either, not sure about this it might be used for other routines in the same source file). It would be nice if the compiler would generate portable interfaces. I have to read up on the "interface checking" diagnostic feature, but I could not find the required manual (and our system administrator didn't install it as far as I know).
I do agree that it is standard conforming, I should have used the word portable instead.
Albert
I know that the compiler is not using the generated .f90 file (and I don't think it wil use the mod file either, not sure about this it might be used for other routines in the same source file). It would be nice if the compiler would generate portable interfaces. I have to read up on the "interface checking" diagnostic feature, but I could not find the required manual (and our system administrator didn't install it as far as I know).
I do agree that it is standard conforming, I should have used the word portable instead.
Albert
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
The .mod is certainly used. If -warn interface is enabled (this implies -gen-interface as of 11.1) and the compiler runs across a reference to a procedure for which there is no explicit interface visible, it looks to see if there is a generated module for that procedure. If so, it uses it to perform error checking (it is not a substitute for a user-provided explicit interface where the language requires it.)
I don't think it's possible to install the compiler without the documentation.
I don't think it's possible to install the compiler without the documentation.

Antworten
Themen-Optionen
- RSS-Feed abonnieren
- Thema als neu kennzeichnen
- Thema als gelesen kennzeichnen
- Diesen Thema für aktuellen Benutzer floaten
- Lesezeichen
- Abonnieren
- Drucker-Anzeigeseite