Dear all,
I'm new to this forum and to the FTN95 Personal edition compiler. I tried to compile some of my code and I got an, in my opinion, strange error message or warning (depending on the compiler options).
Source code:
module problem_ftn95 contains subroutine fie1 implicit none type type1 integer :: elem(2) integer :: scal end type type1
type (type1) :: var1
var1%elem(1) = 7
var1%scal = 7
end subroutine fie1
subroutine fie2 implicit none type type2 integer :: elem(2) integer :: scal end type type2
type(type2) :: var2
var2%elem(1) = 5
var2%scal = 7
end subroutine fie2 end module problem_ftn95
Compilation:
D:\problem_ftn95>ftn95 /error_num /iso problem_ftn95.f90 [FTN95/Win32 Ver. 5.50.0 Copyright (c) Silverfrost Ltd 1993-2010] PROCESSING MODULE [<PROBLEM_FTN95> FTN95/Win32 v5.50.0] NO ERRORS [<FIE1> FTN95/Win32 v5.50.0] 0019) integer :: elem(2) *** Error 149: Duplicate definition of elem 1 ERROR [<FIE2> FTN95/Win32 v5.50.0] NO ERRORS [<PROBLEM_FTN95> FTN95/Win32 v5.50.0] *** Compilation failed
Compilation:
D:\problem_ftn95>ftn95 /error_num problem_ftn95.f90 [FTN95/Win32 Ver. 5.50.0 Copyright (c) Silverfrost Ltd 1993-2010] PROCESSING MODULE [<PROBLEM_FTN95> FTN95/Win32 v5.50.0] NO ERRORS [<FIE1> FTN95/Win32 v5.50.0] 0019) integer :: elem(2) WARNING - 520: elem has been declared more than once with the same type (see line 1) NO ERRORS, 1 WARNING [<FIE2> FTN95/Win32 v5.50.0] NO ERRORS [<PROBLEM_FTN95> FTN95/Win32 v5.50.0]
I don't understand why the elem member, inside a type definition results in this error / warning. The problem only occurs for arrays.
Anybody an idea or is this a compiler bug ?
Best Regards,
Albert