Hello, I have a question is about the behavior of the SIZE intrinsic on an array after it is passed to a subroutine. In my experience, it looks like the dimensions of the array are being lost. Here’s my test program:
PROGRAM test REAL :: array (101, 101) CALL mambo (array, 101, 101) END PROGRAM SUBROUTINE mambo (array,x,y) INTEGER :: x, y REAL :: array(x,y) print *, SIZE (array) END SUBROUTINE mambo
When executed, I would expect the SIZE(array) to be printed as (101*101) or (10201)… but I seem to be getting garbage results. Am I doing something wrong here?
I’m using 6.1/i686/Linux.
pgf90 -Mfreeform test.F