This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Are type-bound procedures and classes supported yet by gfortran?
- From: "Richard Otero" <rich dot otero at gmail dot com>
- To: fortran at gcc dot gnu dot org
- Date: Mon, 31 Dec 2007 13:59:58 -0500
- Subject: Are type-bound procedures and classes supported yet by gfortran?
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=gYlhTfUNWbLbz89EXfb9RoI0NSpx1+qFP4zkuPFBHPA=; b=Y7NqVDUCyGtYwrKDXsx539RYH3xDuupVA4x6cg/zU4eeItH1YFRdvVagrqey4RLWgcH7oneoN69nR8oPtFyFfWFD8BtMjKbcrcE2xKTin4HBuiQfBGUKeC3InrugYPYrMDckCu2Rstx22E1uT+7dAzgTMw69Uci+rY9+UCXH808=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=DXHALVyvXYG45fgRJUdUIIXNCaoYMkYAgpJmIFEuvY+clQ8cq/r4vc+BiQ50Fl2QF3deon5/Jj71N7qNs8H/JM/7A4x4lvs6cqptW16MEBpFPOI5jLhesNWpFXQ2j2ecFLG99iJ6SG0PdLSK1tXTOqeMhCE90gkjOekgXmKNpmA=
Hi all,
Thank you for your work on gfortran! I was wondering if type-bound
procedures and classes supported yet?
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 just gone into my
programming 'blind spot' or are the features not yet supported? If
they aren't supported are there suggestions as to what I should use to
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:
richard@panther:~/testCode/pesst$ gfortran -o run test.f90
test.f90:10.10:
contains
1
Error: Unexpected CONTAINS statement at (1)
test.f90:11.4:
procedure, pass :: rho=>getDensity
1
Error: Unclassifiable statement at (1)
test.f90:12.4:
procedure, pass :: p=>getPressure
1
Error: Unclassifiable statement at (1)
test.f90:19.6:
class(planet), intent(in) :: this
1
Error: Unclassifiable statement at (1)
test.f90:26.6:
class(planet) :: this
1
Error: Unclassifiable statement at (1)
test.f90:24.34:
real function getPressure(this, altitude)
1
Error: Symbol 'this' at (1) has no IMPLICIT type
test.f90:17.33:
real function getDensity(this, altitude)
1
Error: Symbol 'this' at (1) has no IMPLICIT type