回 帖 发 新 帖 刷新版面

主题:Fortran编译错误!

我把主程序省略了,子程序也只列出编译出错部分,主要程序如下:

    subroutine Inverse(A,B,n) 
   use imsl
   implicit none


   integer :: n,i,j
   complex(kind=8) :: A(n,n),B(n,n)
   integer, parameter :: m=12                                           
   complex(kind=8) :: E(m,m),E1(m,1)

 

   E=0.
   forall(i=1:m,j=1:m,i==j) E(i,j)=(1.,0.)
   E1(:,1)= E(:,1)
   end

 

编译时出现的错误如下:

Error1: The attributes of this name conflict with those made accessible by a USE statement.   [E1]

       complex(kind=8) :: E(m,m),E1(m,1)

 

Error2: The syntax of this substring is invalid.   [E1]

      E1(:,1)= E(:,1)

 

 

将use IMSL 注释掉后( ! use imsl),编译就通过了,我想知道为什么这两个语句和IMSl冲突呢? 谢!

 

回复列表 (共2个回复)

沙发

可能是 IMSL 里有 E1 了,试着把 E1 换成其他名字。

板凳


修改了以后就好了,看来是因为这个原因了,这些问题都很小,很细。谢谢了!

我来回复

您尚未登录,请登录后再回复。点此登录或注册