I got a compiler error when trying to initialize an array with the following form:
real*8, dimension(25,11), parameter :: p=&
(/ 4.8610170D+00, 2.4603311D+00, 4.2003577D+01, 1.1525126D-02,&
The size of the comma-separated list is 275 elements (matching the dimension).
For this code I got the error: “Shape of initializer does not match the shape of p”
This code compiles under Intel Fortran.
I changed to:
real*8, dimension(25,11) :: p
data p/ << the same comma separated list of data >> /
and this worked.
Can someone explain why the PGI compiler won’t allow the ‘parameter’ syntax but it does allow the ‘data’ syntax?