I have some strange behaviour - perhaps I miss something. In the example I have an assumed size array. In this case it is a m x n matrix meaning I only have to specify the 1st dimension. However, in the example below I get an Invalid message when I check the size with the debugger.
At the very bottom I have another example where I get the correct message. Am I missing something or is it a problem with the debugger?
[URL=http://imageshack.us/photo/my-images/593/invalid.jpg/]
[/URL]
This code works, i.e. in the debugger i = size(m,1) = 8 is given as the size.
PROGRAM bandmatrizen
IMPLICIT NONE
INTEGER :: n,i
REAL,DIMENSION(:,:),ALLOCATABLE :: m
n = 8
allocate(m(n,n))
call test(m,n)
deallocate(m)
END PROGRAM bandmatrizen
subroutine test(m,n)
implicit none
integer n,i,j
real m(n,*)
i = size(m,1)
return
end
This code does not work, i.e. in the debugger mention Invalid assumed size array.
PROGRAM PROFILE
implicit none
integer nr
parameter(NR=3000)
integer IG(NR,50)
CALL REDUCE(IG, NR)
end
SUBROUTINE REDUCE(IG, NR)
implicit none
integer NR
INTEGER IG(NR,*)
write(*,*) size(IG,1)
RETURN
END