回 帖 发 新 帖 刷新版面

主题:一个调用模块的错误,请大师指点

我先定义了一个  module parameter1

module parameter1


!--------------------------------定   义---------------------------------------

    real k                                                    !    有效增殖系数
    real e1                                                    !    k的收敛判据
    real e2                                                    !    phy的收敛判据
    integer n                                                !    网格数
    integer m                                                !    材料数


    real*8,allocatable,save ::d1(:)                            !    快群扩散系数    
    real*8,allocatable,save ::d2(:)                            !    热群扩散系数
    real*8,allocatable,save ::sigma_a1(:)                    !    快群吸收截面
    real*8,allocatable,save ::sigma_a2(:)                    !    热群吸收截面
    real*8,allocatable,save ::sigma_tr1(:)                    !    快群移出截面
    real*8,allocatable,save ::sigma_tr2(:)                    !    热群移出截面
    real*8,allocatable,save ::vsigma_f1(:)                    !    快群裂变截面
    real*8,allocatable,save ::vsigma_f2(:)                    !    热群裂变截面
    real*8,allocatable,save ::sigma_12(:)                    !    快群散射到热群截面


    real*8,allocatable,save ::phy1(:)                        !    快群中子通量
    real*8,allocatable,save ::phy2(:)                        !    热群中子通量
    real*8,allocatable,save ::dx(:)                            !    网格间距
    real*8,allocatable,save ::a1(:)                            !    三对角矩阵中间量
    real*8,allocatable,save ::b1(:)                            !    三对角矩阵中间量
    real*8,allocatable,save ::c1(:)                            !    三对角矩阵中间量
    real*8,allocatable,save ::c(:)                            !    三对角矩阵下对角线元素
    real*8,allocatable,save ::d(:)                            !    三对角矩阵主对角线元素
    real*8,allocatable,save ::e(:)                            !    三对角矩阵上对角线元素
    real*8,allocatable,save ::b(:)                            !    三对角矩阵方程右端项以及解得的未知数向量

end module parameter1



然后在program 里给参数赋值,



program main 

use parameter1
use imsl


!--------------------------------赋   值---------------------------------------

    e1=0.00001
    e2=0.0001
    n=2600
    m=2600

    do i=1,m
    sigma_a1(i)=8.603111E-03
    sigma_a2(i)=7.853449E-02
    vsigma_f1(i)=6.160544E-03
    vsigma_f2(i)=1.207603E-01
    sigma_tr1(i)=2.368355E-01
    sigma_tr2(i)=9.082422E-01
    sigma_12(i)=1.708253E-02    
    end do
    
end


最后错误提示 ,这到底是怎么回事啊??



--------------------Configuration: 1d_diffusion_may_19 - Win32 Debug--------------------
Compiling Fortran...
E:\1d_diffusion\1d_diffusion_may_19\caculation.f90
E:\1d_diffusion\1d_diffusion_may_19\caculation.f90(10) : Error: The same named entity from different modules and/or program units cannot be referenced.   [E1]
 e1=0.00001
--------^
E:\1d_diffusion\1d_diffusion_may_19\caculation.f90(10) : Error: This name has already been used as an external function name.   [E1]
 e1=0.00001
--------^
E:\1d_diffusion\1d_diffusion_may_19\caculation.f90(68) : Error: The type of the actual argument differs from the type of the dummy argument.   [C]
  call LSLTR (n, c, d, e, b)
-------------------------------^
E:\1d_diffusion\1d_diffusion_may_19\caculation.f90(68) : Error: The type of the actual argument differs from the type of the dummy argument.   [D]
  call LSLTR (n, c, d, e, b)
----------------------------------^
E:\1d_diffusion\1d_diffusion_may_19\caculation.f90(68) : Error: The type of the actual argument differs from the type of the dummy argument.   [E]
  call LSLTR (n, c, d, e, b)
-------------------------------------^
E:\1d_diffusion\1d_diffusion_may_19\caculation.f90(68) : Error: The type of the actual argument differs from the type of the dummy argument.   [B]
  call LSLTR (n, c, d, e, b)
----------------------------------------^
E:\1d_diffusion\1d_diffusion_may_19\caculation.f90(74) : Error: The type of the actual argument differs from the type of the dummy argument.   [C]
  call LSLTR (n, c, d, e, b)
-------------------------------^
E:\1d_diffusion\1d_diffusion_may_19\caculation.f90(74) : Error: The type of the actual argument differs from the type of the dummy argument.   [D]
  call LSLTR (n, c, d, e, b)
----------------------------------^
E:\1d_diffusion\1d_diffusion_may_19\caculation.f90(74) : Error: The type of the actual argument differs from the type of the dummy argument.   [E]
  call LSLTR (n, c, d, e, b)
-------------------------------------^
E:\1d_diffusion\1d_diffusion_may_19\caculation.f90(74) : Error: The type of the actual argument differs from the type of the dummy argument.   [B]
  call LSLTR (n, c, d, e, b)
----------------------------------------^
Error executing df.exe.

1d_diffusion_may_19.exe - 10 error(s), 0 warning(s)

[color=FF0000][/color]

回复列表 (共5个回复)

沙发

程序不完整, 不知道你其他代码做了些什么. 
表面上, 出错提示跟你模块的变量没关系.

板凳


谢谢 ,整个的程序是这样的。




module parameter1


!--------------------------------定   义---------------------------------------

    real k                                                    !    有效增殖系数
    real e1                                                    !    k的收敛判据
    real e2                                                    !    phy的收敛判据
    integer n                                                !    网格数
    integer m                                                !    材料数


    real*8,allocatable,save ::d1(:)                            !    快群扩散系数    
    real*8,allocatable,save ::d2(:)                            !    热群扩散系数
    real*8,allocatable,save ::sigma_a1(:)                    !    快群吸收截面
    real*8,allocatable,save ::sigma_a2(:)                    !    热群吸收截面
    real*8,allocatable,save ::sigma_tr1(:)                    !    快群移出截面
    real*8,allocatable,save ::sigma_tr2(:)                    !    热群移出截面
    real*8,allocatable,save ::vsigma_f1(:)                    !    快群裂变截面
    real*8,allocatable,save ::vsigma_f2(:)                    !    热群裂变截面
    real*8,allocatable,save ::sigma_12(:)                    !    快群散射到热群截面


    real*8,allocatable,save ::phy1(:)                        !    快群中子通量
    real*8,allocatable,save ::phy2(:)                        !    热群中子通量
    real*8,allocatable,save ::dx(:)                            !    网格间距
    real*8,allocatable,save ::a1(:)                            !    三对角矩阵中间量
    real*8,allocatable,save ::b1(:)                            !    三对角矩阵中间量
    real*8,allocatable,save ::c1(:)                            !    三对角矩阵中间量
    real*8,allocatable,save ::c(:)                            !    三对角矩阵下对角线元素
    real*8,allocatable,save ::d(:)                            !    三对角矩阵主对角线元素
    real*8,allocatable,save ::e(:)                            !    三对角矩阵上对角线元素
    real*8,allocatable,save ::b(:)                            !    三对角矩阵方程右端项以及解得的未知数向量


end module parameter1








3 楼


program main 


use parameter1
use imsl


!--------------------------------赋   值---------------------------------------

    e1=0.00001
    e2=0.0001
    n=2600
    m=2600

    do i=1,m
    sigma_a1(i)=8.603111E-03
    sigma_a2(i)=7.853449E-02
    vsigma_f1(i)=6.160544E-03
    vsigma_f2(i)=1.207603E-01
    sigma_tr1(i)=2.368355E-01
    sigma_tr2(i)=9.082422E-01
    sigma_12(i)=1.708253E-02    
    end do


    


    do i=1,n
    dx(i)=0.1
    end do

    do i=1,n
    b1(i)=dx(i)*sigma_tr1(i)
    c1(i)=-2*d1(i)/dx(i)
    b2(i)=dx(i)*sigma_a2(i)
    c2(i)=-2*d2(i)/dx(i)
    end do 

    do i=1,n-1
    a1(i)=-2*d1(i)*d1(i+1)/(d1(i)*dx(i+1)+d1(i+1)*dx(i))
    a2(i)=-2*d2(i)*d2(i+1)/(d2(i)*dx(i+1)+d2(i+1)*dx(i))
    end do 

    k=1
    phy1=1
    phy2=1


        do i=2,n
        c(i)=a1(i-1)
    enddo
        c(1)=0

    do i=1,n-1
        e(i)=a1(i)
    enddo
        e(n)=0

    do i=2,n-1
        d(i)=b1(i)-a1(i)-a1(i-1)
    enddo
        d(1)=b1(1)-a1(1)-c1(1)
        d(n)=ba(n)-a1(n-1)-c1(n)


    do counter=1,300
        do i=1,n
            b(i)=dx(i)*(vsigma_f1(i)*phy1(i)+vsigma_f2(i)*phy2(i))/k
        enddo
        call LSLTR (n, c, d, e, b)
            phy1=b

        do i=1,n
            b(i)=sigma_12(i)*phy1(i)
        enddo
        call LSLTR (n, c, d, e, b)
            phy2=b


        write(*,*)phy2

    enddo

end





4 楼

a2, b2, c2 定义为数组了吗?

5 楼


没有a ,
b,c 都在module 里定义了呀

我来回复

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