title: Are Fortran control characters (carriage control) still implemented in compilers?
body: <p>In the book <a href="https://rads.stackoverflow.com/amzn/click/com/0073191574" rel="noreferrer" rel="nofollow noreferrer">Fortran 95/2003 for Scientists and Engineers</a>, there is much talk given to the importance of recognizing that the first column in a format statement is reserved for control characters. I've also seen control characters referred to as carriage control on the internet.</p>
  
  <p>To avoid confusion, by control characters, I refer to the characters "1, a blank (i.e. \s), 0, and +" as having an effect on the vertical spacing of output when placed in the <b> first </b> column (character) of a FORMAT statement. </p>
  
  <p>Also, see this text-only web page written entirely in fixed-width typeface : <a href="http://www.ibiblio.org/pub/languages/fortran/ch2-14.html" rel="noreferrer">Fortran carriage-control</a> (because nothing screams accuracy and antiquity better than prose in monospaced font). I found this page and others like it to be not quite clear.</p>
  
  <p>According to <a href="https://rads.stackoverflow.com/amzn/click/com/0073191574" rel="noreferrer" rel="nofollow noreferrer">Fortran 95/2003 for Scientists and Engineers</a>, failure to recall that the first column is reserved for carriage control can lead to <i> horrible </i> unintended output. Paraphrasing <a href="http://emmaline1138.wordpress.com/2008/05/26/dave-barry-in-cyberspace/" rel="noreferrer">Dave Barry</a>, type the wrong character, and nuclear missiles get fired at Norway.</p>
  
  <p>However, when I attempt to adhere to this stern warning, I find that gfortran has no idea what I'm talking about.</p>
  
  <p>Allow me to illustrate my point with some example code. I am trying to print out the number Pi:</p>
  
  <pre><code>PROGRAM test_format
  IMPLICIT NONE
  
  REAL :: PI = 2 * ACOS(0.0)
  
  WRITE (*, 100) PI
  WRITE (*, 200) PI
  WRITE (*, 300) PI
  100 FORMAT ('1', "New page: ", F11.9)
  200 FORMAT (' ', "Single Space: ", F11.9)
  300 FORMAT ('0', "Double Space: ", F11.9)
  END PROGRAM test_format
  </code></pre>
  
  <p>This is the output:</p>
  
  <pre><code>1New page: 3.141592741
  Single Space: 3.141592741
  0Double Space: 3.141592741
  </code></pre>
  
  <p>The "1" and "0" are not typos. It appears that gfortran is completely ignoring the control character column.</p>
  
  <p>My question, then, is this:</p>
  
  <p>Are control characters still implemented in standards compliant compilers or is gfortran simply not standards compliant?</p>
  
  <p>For clarity, here is the output of my <code>gfortran -v</code></p>
  
  <p><code>Using built-in specs.
  Target: powerpc-apple-darwin9
  Configured with: ../gcc-4.4.0/configure --prefix=/sw --prefix=/sw/lib/gcc4.4 --mandir=/sw/share/man --infodir=/sw/share/info --enable-languages=c,c++,fortran,objc,java --with-gmp=/sw --with-libiconv-prefix=/sw --with-ppl=/sw --with-cloog=/sw --with-system-zlib --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib --disable-libjava-multilib --build=powerpc-apple-darwin9 --host=powerpc-apple-darwin9 --target=powerpc-apple-darwin9
  Thread model: posix
  gcc version 4.4.0 (GCC)</code></p>