I have a bizarre error which is shown by the skeleton code below.
Basically, I have a character variable which I have placed with a namelist. I initilaise the string and write the namelist to a file. I rewind the file and read the namelist. It works fine if the length of the character string is 122 but if I put it to 123 (as in the code) it fails with IOSTAT=18 which is 'too many values for NAMELIST variable'.
I am using Intel Fortran XE 22.214.171.124 in VS2010
In the full program the character string will be much longer so I did some trial and error to see what was the critical point and as far as i know, 122 has no significance whatsoever.
I have tried setting CARRIAGECONTROL='NONE' and BLOCKSIZE=123' on the OPEN statement but doesn't make any difference.
Code also works fine with gfortran.
! Program to test namelist read
CHARACTER(LEN=123) :: CString
CHARACTER(LEN=150) :: Message
INTEGER :: Ios
INTEGER :: I
CString(I:I) = 'A'
write(6,*) 'ios ',ios
if(ios /= 0) write(6,*) 'Message: ',Message