- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.

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