I have created a formatted output file using FTN95, and can read the file perfectly in Plato, Excel, and WordPad, but it looks completely garbled in NotePad. If I create the same file using a different compiler the problem does not occur.
I am perfectly happy to make the output file available if somebody could let me know how to do so. Unfortunately, providing some complete sample code for the output to reproduce the problem would be difficult, but it works something like the following:
WRITE (UNIT=iout,FMT='(A)',ADVANCE='no') TRIM(c)
DO j=1,m
WRITE (cout,FMT=*) r(j)
WRITE (UNIT=iout,FMT='(2A)',ADVANCE='no') c,TRIM(ADJUSTL(cout))
END DO
WRITE (UNIT=iout,FMT='(A)',ADVANCE='yes')
ij=0
DO i=1,n
WRITE (cout,FMT=*) s(i)
WRITE (UNIT=iout,FMT='(A)',ADVANCE='no') TRIM(ADJUSTL(cout))
DO j=1,m
ij=ij+1
WRITE (cout,FMT=*) v(ij)
WRITE (UNIT=iout,FMT='(2A)',ADVANCE='no') cdelim,TRIM(ADJUSTL(cout))
END DO
WRITE (UNIT=iout,FMT='(A)',ADVANCE='yes')
END DO
The code above is part of a subroutine, and c is is passed as a CHARACTER(LEN=*) argument, m and n as INTEGER, and r,s and v as REAL arrays. The subroutine and is called more than once when generating the output file. The problem occurs only sometimes, apparently depending on the value of c. If I abort the program part way through printing the file the partial file looks ok until the second call to the routine when line 6 above is invoked.