Too many data constants in initialization statement

I found this error mentioned in old posts, but this is still occurring if optional lower bounds are specified in an array declaration.

pgfortran 14.10-0 64-bit target on Apple OS/X -tp sandy bridge

The following fails to compile:

program test

character(8), parameter :: text(2,11:13) = &
    reshape( [character(8) :: "a","b","c","d","e","f"], shape(text))

print *, shape(text) ! prints 2,3
print *, text

end

The code will compile if the array is declared as “text(2,3)” or even “text(2,1:3)”. But if a bound other than “1” is given, it will not compile:

PGF90-S-0067-Too many data constants in initialization statement (init.f90: 3)
  0 inform,   0 warnings,   1 severes, 0 fatal for test

Hi thfanning,

Thanks for the report. We have recreated the error here and added problem report TPR#21305.

  • Mat

TPR 21305 - UF: Too many data constants in initialization statement

has been fixed in the 15.5 release.