fortran format vertical specainig control characters

Hello,
PGI Fortran Reference page 126 (chapeter 5) says that

If the specified unit is a printer then the first character of the record is used to
control the vertical spacing as shown in the following table: …

I tried to use this with ‘+’ and ‘1’ but they dont seem working. It just print a line preceeded by a charcter ‘+’ or ‘1’ insgtead of formfeed or overwriting the line. How do I use this feature? Could you give me a sample code (and compiler flag if needed). I have old code that seems to use this feature, and ideally want to use code without much modification.

What I tried was


% pgf90 -V

pgf90 6.0-8 32-bit target on x86 Linux 
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc.  All Rights Reserved.

% cat test.f90
program test
      write(*,'("+","hello")')
      write(*,'("+","hello")')
      write(*,'("+","hello")')
      print'("+","hello")'
      print'("+","hello")'
      print'("+","hello")'
 100  format("+","hello")
      print 100
      print 100
      print 100
      end program
% pgf90 test.f90
% ./a.out
+hello
+hello
+hello
+hello
+hello
+hello
+hello
+hello
+hello
%

Similar results when I used ‘1’.[/code]

Hi yosuke,

The best way to think of these is as the line feed character where when sent to old line printer, the printer would advance the paper N lines. However, this syntax is only valid for devices that recognize the character, such as a line printer. Other devices, such as stdout, will just print out the character.

  • Mat