Cryptic error message for procedure bound to a type
Armelius Cameron
armeliusc@gmail.com
Wed Sep 8 14:51:00 GMT 2010
Hello,
I have a module that defines a type with a procedure bound to the
type. When trying to compile with the latest gfortran from nightlies,
I got the following error message that I don't understand:
-----------
]$ gfortran -c UnitValue_Form.f90
UnitValue_Form.f90:12.15:
procedure, private, pass :: &
1
Error: Non-polymorphic passed-object dummy argument of 'initialize_mv'
at (1)
----
Below is the complete output and module file. This module can be
compiled fine with the Cray's compiler. Thank you for any help.
AC
----------------
]$ cat UnitValue_Form.f90
module UnitValue_Form
implicit none
private
type, public :: UnitValueForm
real :: &
Number = 1.0
character ( 10 ) :: &
Unit = ''
contains
procedure, private, pass :: &
Initialize_MV
generic :: &
Initialize => Initialize_MV
end type UnitValueForm
contains
subroutine Initialize_MV ( MV, Unit, Number )
type ( UnitValueForm ), intent ( inout ) :: &
MV
character ( 10 ), intent ( in ) :: &
Unit
real, intent ( in ) :: &
Number
MV % Number = Number
MV % Unit = Unit
end subroutine Initialize_MV
end module UnitValue_Form
]$ gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/local/gcc/trunk/bin/../libexec/gcc/x86_64-
unknown-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-trunk-source/gcc/configure --enable-
languages=c,c++,fortran --enable-checking=release --disable-bootstrap
--disable-libmudflap --enable-libgomp --enable-lto --enable-gold --
with-plugin-ld=/usr/bin/gold --prefix=/usr/local/gcc-trunk
Thread model: posix
gcc version 4.6.0 20100907 (experimental) [trunk revision 163940]
(GCC)
More information about the Fortran
mailing list