我收到以下错误消息:
The name of the module procedure conflicts with a name
in the encompassing scoping unit. [ADD_SUB]
在64 位平台ifort 12.0.3
上编译下面的源代码时。ubuntu 12.04
有任何想法吗?
Module Header
Type :: hello
Integer :: a
Integer :: b
Integer :: sum
contains
procedure, pass :: add => add_sub
End type hello
Interface
Subroutine add_sub(this)
Import hello
Implicit None
class(hello) :: this
End Subroutine add_sub
End Interface
End Module
Module Routines
use Header
contains
Subroutine add_sub(this)
Implicit None
class(hello), intent(inout) :: this
this%sum=this%a+this%b
End Subroutine
End Module
Program Test
use Header
use Routines
Implicit None
Type(hello) :: x
x%a=1
x%b=2
call x%add()
write(*,*) x
End Program Test