This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
host association question..
- From: "Christopher D. Rickett" <crickett at lanl dot gov>
- To: fortran at gcc dot gnu dot org
- Cc: crasmussen at lanl dot gov
- Date: Wed, 15 Feb 2006 15:20:09 -0700 (MST)
- Subject: host association question..
given the following code:
module myMod
integer, parameter :: mine = 4
type :: MYFTYPE_1
integer :: i, j
real :: s
end type MYFTYPE_1
interface
subroutine blah()
implicit none
type(myftype_1) :: myStruct
type(myftype_1) :: myStruct2
integer(mine) :: myInt
end subroutine blah
end interface
end module myMod
gfortran will produce the following error:
In file myMod.f90:14
integer(mine) :: myInt
1
Error: Symbol 'mine' at (1) has no IMPLICIT type
ifort will give the following errors for the same code:
fortcom: Error: myMod.f90, line 12: This derived type name has not been
declared. [MYFTYPE_1]
type(myftype_1) :: myStruct
------------^
fortcom: Error: myMod.f90, line 13: This derived type name has not been
declared. [MYFTYPE_1]
type(myftype_1) :: myStruct2
------------^
fortcom: Error: myMod.f90, line 14: A kind type parameter must be a
compile-time constant. [MINE]
integer(mine) :: myInt
---------------^
if you remove the one reference to 'mine' w/in the blah(), gfortran will
compile the code. however, i think that this is an error, if i understand
host association. it appears that ifort gives the 3 errors because
neither 'myftype_1' nor 'mine' can be host associated for the subroutine
blah() to use them. in order to be host associated, the module 'myMod'
must contain the subroutine. is this correct?
these tests were done with ifort 9.0 and gfortran 4.2.0 20060130
(experimental). it was also done with gfortran 4.1.0 20051026
(experimental). both versions of gfortran behaved the same way.
Thanks.
Chris