Extracted from pr36192, the following code program three_body real, parameter :: n = 2, d = 2 ! real, dimension(n), parameter :: m = (/ 1.0, 1.0 /) real, dimension(n,d) :: x, v ! real, dimension(n,d) :: x, v, x_n, v_n, x_hq, v_hq end program three_body yields the following errors pr36192_dup.f90:4.18: real, dimension(n,d) :: x, v 1 Error: Expression at (1) must be of INTEGER type pr36192_dup.f90:4.20: real, dimension(n,d) :: x, v 1 Error: Expression at (1) must be of INTEGER type pr36192_dup.f90:4.30: real, dimension(n,d) :: x, v 1 Error: The module or main program array 'v' at (1) must have constant shape pr36192_dup.f90:4.18: real, dimension(n,d) :: x, v 1 Error: Expression at (1) must be of INTEGER type pr36192_dup.f90:4.20: real, dimension(n,d) :: x, v 1 Error: Expression at (1) must be of INTEGER type pr36192_dup.f90:4.27: real, dimension(n,d) :: x, v 1 Error: The module or main program array 'x' at (1) must have constant shape where the messages "Expression at (1) must be of INTEGER type" are emitted twice. If the x_n, v_n, x_hq, v_hq arrays are added, these messages are emitted six times, as if they were delayed until the messages "The module or main program array 'v' at (1) must have constant shape" are emiited. I don't know why the "INTEGER type" error was delayed, but emitting it when it is first encountered should solve the problem. Note that in the patch http://gcc.gnu.org/ml/gcc-patches/2008-09/msg01755.html submitted by Daniel kraft, all the "Expression at (1) must be of INTEGER type" errors were removed, making difficult to locate the primary cause of the errors (n and d declared as real).
I think this one is actually ok. The message is emitted rank-times, once for each non-integer rank, for each variable. Here we get it three times: real, parameter :: n = 2 real, dimension(n) :: x, y, z end Here 4*3 = 12 times: real, parameter :: n = 2 real, dimension(n, n, n, n) :: x, y, z end Here just once: real, parameter :: n = 2 real :: x, y(n), z end Thus, all fine?!
> Thus, all fine?! Now I understand the logic. Thanks for the explanation. Closing as invalid.