advance="no" not portable



This code gives different results on g95 (g95.org) and Compaq Visual
Fortran SE 6.6a. I am looking for some idea of which result is correct
(according to FORTRAN 90/95 standards) or, better yet, an alternative
way of writing it that is more portable.

OPEN (2, FILE='test.txt', ACCESS='SEQUENTIAL')
DO iter1 = 1, 3
WRITE(2,*,ADVANCE="NO") '*'
WRITE(2,*,ADVANCE="NO") '*'
WRITE(2,*,ADVANCE="NO") '*'
WRITE(2,*) ' '
END DO
CLOSE(2)

The line /WRITE(2,*) ' '/ creates one line break in g95 (the intended
result) but produces two line breaks in Compaq. With such different
results between compilers, I am probably doing this in an unusual way.
Is there a more common/portable way to produce line breaks with
non-advancing output so that I can expect all compilers to interpret it
the same way? Or do I need to find a way to produce the whole line of
data in one line of (advance="yes") code?

g95 results:
***
***
***

Compaq results:
***

***

***

.



Relevant Pages

  • Re: g95 versus gfortran
    ... A couple of months ago I have installed g95 on my home PC together with "photran" and msys. ... I have been looking at the web sites of both projects but to me I do not understand this apparent "double" development of GNU fortran compilers. ... Support the GNU GFortran Project: http://gcc.gnu.org/fortran/index.html ...
    (comp.lang.fortran)
  • Re: g95 versus gfortran
    ... A couple of months ago I have installed g95 on my home PC together with "photran" and msys. ... After intalling g95 I have also run into gfortran. ... understand this apparent "double" development of GNU fortran compilers. ... Why are two compilers being developed. ...
    (comp.lang.fortran)
  • Re: Open64 Not Setting World on Fire: Why?
    ... Open64 compiler is a Fortran 95 compiler that works now, ... working on Fortran compilers are all sticking with g95. ... Yes, there are bugs in gfortran, but the gfortran developers are slowly ...
    (comp.lang.fortran)
  • Re: Dinamic String
    ... > Fortran 95, that was eventually incorporated in the Fortran 2003 standard. ... > Almost all compilers nowadays support TR 15581, ... g95 does support TR 15581. ...
    (comp.lang.fortran)
  • Re: Does VB have something that can return just a column of a multi-column array?
    ... The IMSL F90 Library came with the Digital FORTRAN from Compaq. ... For which compiler do you have the IMSL library--MS PowerStation? ...
    (microsoft.public.vb.general.discussion)