Reputation: 477
I have the following code :
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)
when i go to compile link i get indicating pt is a problem
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
any ideas on how to fix this or properly call a subroutine while passing an array
Upvotes: 1
Views: 1061
Reputation: 29244
This is how you declare an array argument:
parameter (maxprt=25)
dimension pt(maxprt)
call test(pt)
and somewhere else
subroutine test(a)
dimension a(25)
end subroutine
Upvotes: 1