- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Are type-bound procedures and classes supported yet by the ifort compiler?
This is a subset of the module I'm writting that still shows the errors I've included below. I've been trying to find my errors for some time. Is it simply something that has gone into my programming 'blind spot' or are the features not yet supported? If they aren't supported are there suggestions as to a compiler that would support them?
thank you!
Richard
module planet_class
implicit none
integer, parameter :: dbl = selected_real_kind(p=15, r=200)
type, public :: planet
private
integer :: planetID = -1
real(kind=dbl) :: gravitySurf, densitySurf, scaleHeight, radiusPlanet
contains
procedure, pass :: rho=>getDensity
procedure, pass :: p=>getPressure
end type planet
contains
real function getDensity(this, altitude)
implicit none
class(planet), intent(in) :: this
real(kind=dbl), intent(in) :: altitude
getDensity = altitude+1 ! temp equation
end function getDensity
real function getPressure(this, altitude)
implicit none
class(planet) :: this
real(kind=dbl), intent(in) :: altitude
getPressure = altitude+1 ! temp equation
end function getPressure
end module planet_class
=================================
This code generates the following errors:
fortcom: Error: test.f90, line 11: Syntax error, found ',' following statement keyword
procedure, pass :: rho=>getDensity
--------------^
fortcom: Error: test.f90, line 11: Syntax error, found 'PROCEDURE' when expecting one of:
This is a subset of the module I'm writting that still shows the errors I've included below. I've been trying to find my errors for some time. Is it simply something that has gone into my programming 'blind spot' or are the features not yet supported? If they aren't supported are there suggestions as to a compiler that would support them?
thank you!
Richard
module planet_class
implicit none
integer, parameter :: dbl = selected_real_kind(p=15, r=200)
type, public :: planet
private
integer :: planetID = -1
real(kind=dbl) :: gravitySurf, densitySurf, scaleHeight, radiusPlanet
contains
procedure, pass :: rho=>getDensity
procedure, pass :: p=>getPressure
end type planet
contains
real function getDensity(this, altitude)
implicit none
class(planet), intent(in) :: this
real(kind=dbl), intent(in) :: altitude
getDensity = altitude+1 ! temp equation
end function getDensity
real function getPressure(this, altitude)
implicit none
class(planet) :: this
real(kind=dbl), intent(in) :: altitude
getPressure = altitude+1 ! temp equation
end function getPressure
end module planet_class
=================================
This code generates the following errors:
fortcom: Error: test.f90, line 11: Syntax error, found ',' following statement keyword
procedure, pass :: rho=>getDensity
--------------^
fortcom: Error: test.f90, line 11: Syntax error, found 'PROCEDURE' when expecting one of:
Link kopiert
1 Antworten
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Not yet supported. Probably in the next major release, whenever that is. (At the moment, I would not venture a guess.) Procedure pointers and type-bound procedures are not commonly implemented. You could try NAG.

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