Re: array argument of assumed shape failed



On Mar 17, 6:50 pm, "zuy...@xxxxxxxxx" <zuy...@xxxxxxxxx> wrote:
Hi folks,

I have a subroutine with declarations like this,

SUBROUTINE linklist2d(x,los,rcube,lattice,listbods)
implicit none

real(kind=4),intent(in) :: x(:,:)
character(len=1),intent(in) :: los
real(kind=4),intent(in) :: rcube
integer(kind=4) :: lattice(:,:)
integer(kind=4) :: listbods(:)

in the main program, I just pass the alllocated arrray to the
subroutine,

allocate(xgasr(ngasr),lattice(nlattice,nlattice),listbods(ngasr))
print*,'size test',SIZE(xgasr,DIM=2)
print*,SIZE(listbods)

CALL linklist2d(xgasr,'z',rcube,lattice,listbods)

**********************************************************

The problem is,

the SIZE test in the main program gives the right dimension info, but
the arrays just can not be passed to the subroutine....the error jumps
out
saying nothing useful to me....

Thanks,

Nye.


Is the subroutine declared in an interface block in the
main program?

Bob Corbett
.