Windows gfortran namelist input error

Jerry DeLisle jvdelisle@charter.net
Sun May 15 19:02:00 GMT 2016


On 05/11/2016 03:47 PM, David Drum wrote:
> The following program works fine under Linux but fails under Windows.
>       IMPLICIT REAL*8(A-H,O-Z)
>       DIMENSION SENID(30)
>       NAMELIST /FITH/ SENID
>       DO I=1,30
>          SENID(I) = I
>       ENDDO
>       OPEN(UNIT=7,FILE='TEST.OUT',FORM='FORMATTED',
>      *         STATUS='NEW',ACTION='READWRITE')
>       WRITE(7,NML=FITH)
>       REWIND(7)
>       READ(7,NML=FITH)
>       END
> The error is:
> At line 11 of file xxx.f (unit = 7, file = 'TEST.OUT')
> Fortran runtime error: Cannot match namelist object name 27.0000000000
> I am using GNU Fortran (GCC) 5.3.1 20160402 under Windows. 
> I believe the error is caused because the ^M line terminator (for DOS files) is interpreted as a value separator for namelist input.
> 

I have created bug report.

Bug 71123 - Namelist read failure on Windows

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71123

Regards,

Jerry



More information about the Fortran mailing list