我有以下代码:
parameter (maxprt=25)
dimension pt(maxprt)
impt = maxprt
call rdprob(delt,denr,denw,ders,des,ecapr,ecapw,ein,erb0,erock,ext,iflim,ifmax,ifseg,ilim,ilpt,impt,iout,irlim,ismax,itstep,maxrk,pt,qexto,qfrac,qin,qnxt,qtot,rockr,rockv,t0,te0,tend,ter0,tstart,vol,xin,xs,ir1)
subroutine rdprob(delt,denr,denw,ders,des,ecapr,ecapw,ein,erb0,erock,ext,iflim,ifmax,ifseg,ilim,ilpt,impt,iout,irlim,ismox,itstep,maxrk,pt(25),qexto,qfrac,qin,qnxt,qtot,rockr,rockv,t0,te0,tend,ter0,tstart,vol,xin,xs,ir1)
当我去编译链接时我得到指示pt是个问题
borehole.for: In program `MAIN__':
borehole.for:111:
call rdprob(delt,denr,denw,ders,des,ecapr,ecapw,ein,erb0,erock,ext,iflim,ifmax,ifseg,ilim,ilpt,impt,iout,irlim,ismax,itstep,maxrk,pt
^
Expression at (^) has incorrect data type or rank for its context
有关如何修复此问题或在传递数组时正确调用子例程的任何想法
答案 0 :(得分:0)
这是声明数组参数的方式:
parameter (maxprt=25)
dimension pt(maxprt)
call test(pt)
和其他地方
subroutine test(a)
dimension a(25)
end subroutine