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
.



Relevant Pages

  • Re: problem in interface
    ... I'd guess that something is wrong with the subroutine call. ... it is too big a mess. ... With a separate interface body like you have, the relevant declarations ... That you are having trouble with it is no surprise; ...
    (comp.lang.fortran)
  • Re: Module to trap undefined subroutines at compile time
    ... mistakes in subroutine names, which even 'use strict' doesn't pick up ... sub declarations, if declarations, etc...), that very bad style IMHO. ... I get that Carp produces messages in the context of the invoking ... I did it the way it is following 'no strict' which turns of various ...
    (comp.lang.perl.modules)
  • Re: question about negative indices in fortran 77
    ... > declared arrays together somehow. ... > subroutine statement up to the first executable statement ... in the common block they're declared like ... order to sanitize the program I should change the declarations in the ...
    (comp.lang.fortran)
  • Re: Fortran based MEX w/ COMMON/SAVE
    ... SUBROUTINE AAA ... DOUBLEPRECISION V5, ... ... C END OF MY DECLARATIONS ... data in Fortran section of the code. ...
    (comp.soft-sys.matlab)
  • Re: Fortran based MEX w/ COMMON/SAVE
    ... > SUBROUTINE AAA ... SOME 200 LINES OF DECLARATIONS ... You may also want to try compiling with g95 and avoiding gnumex all ...
    (comp.soft-sys.matlab)