24小时热门版块排行榜    

查看: 840  |  回复: 1

575406210

银虫 (初入文坛)

[求助] 【求助】数组维数 实参和虚参不一致的问题已有1人参与

Error        2         error #6633: The type of the actual argument differs from the type of the dummy argument.   [A]        C:\Users\zyl\Desktop\LASS3.FOR        96       
Error        3         error #6633: The type of the actual argument differs from the type of the dummy argument.   [A]        C:\Users\zyl\Desktop\LASS3.FOR        96       
Error        4         error #6633: The type of the actual argument differs from the type of the dummy argument.   [A]        C:\Users\zyl\Desktop\LASS3.FOR        96       
Error        5         error #6633: The type of the actual argument differs from the type of the dummy argument.   [A]        C:\Users\zyl\Desktop\LASS3.FOR        96       
Error        6         error #6633: The type of the actual argument differs from the type of the dummy argument.   [A]        C:\Users\zyl\Desktop\LASS3.FOR        96       
       
CALL REED (A(N1),A(N2),A(N3),A(N4),A(N5),A(KK1),A(KK2),A(KK3),    错误定位到这一行
     *  NLAYER,NMAT,NUMNP,A(K1),NCYCL,NDI)                              


      SUBROUTINE REED (DEPTH,NEL,MATYP,EMATL,BACC,JPLTM,JPLTSS,         
     *  JSETS,NLAYER,NMAT,NUMNP,ACC,NCYCL,NDI)                        
      DIMENSION DEPTH(NLAYER),NEL(NLAYER),MATYP(NLAYER),EMATL(35,NMAT),
     *  BACC(NCYCL,NDI),ACC(2,1),TITLE(18),JPLTM(1),JPLTSS(1),JSETS(1)
很明显,错误是因为有的数组是二维有的是一维,但是call reed  里面全用实参A(),不区分一维二维导致错误。
我该怎么改呢?
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

浔荆

木虫 (正式写手)

【答案】应助回帖

★ ★ ★ ★ ★
感谢参与,应助指数 +1
575406210: 金币+5, ★★★很有帮助, 谢谢你了,说的挺好,我试试管不管用 2015-06-11 17:18:33
你这个子程序要实现什么功能?
如果只需要将数组的某一维数据来实现该功能,那就参数传递时只传递该维度的数据,如

call REED(A(:,1)......)

如果二维数组的其他数据也在子程序中涉及到了,那就说明你的子程序写错了,没有考虑二维情形。
2楼2015-06-11 12:53:11
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 575406210 的主题更新
信息提示
请填处理意见