PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

fortran format vertical specainig control characters

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
yosuke



Joined: 25 Oct 2004
Posts: 3

PostPosted: Sun Sep 28, 2008 6:47 pm    Post subject: fortran format vertical specainig control characters Reply with quote

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


Code:

% 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]
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6120
Location: The Portland Group Inc.

PostPosted: Mon Sep 29, 2008 9:14 am    Post subject: Reply with quote

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
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group