PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

variable format expression

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



Joined: 22 Feb 2005
Posts: 1

PostPosted: Tue Feb 22, 2005 6:06 am    Post subject: variable format expression Reply with quote

Is there an equivalent expression in PGHPF for variable format expression as it is used in Compaq Visual Fortran, e.g.
Code:
10 Format (<i> Ed.w)

where i is an integer variable.
I do know that pgf77 knows this syntax, too...
Thanks for your help!!!
Back to top
View user's profile
mkcolg



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

PostPosted: Tue Feb 22, 2005 12:05 pm    Post subject: Reply with quote

Hi Reto,

It's a bit embarssing that we support the runtime edit decriptor extension in pgf77 but not pgf90 or pghpf. I'm not sure of the reasons but I'll bring it up with our senior compiler architect and see if we can added it to a future release.

For now however, you'll need use a do loop and non-advancing IO to make this work.

Example:
Code:
     PROGRAM test
     REAL X(4)
     DO I=1,4
          X(I) = (0.25 / I )
     END DO
     DO I=1,4
           WRITE(*,10,ADVANCE='NO'), X(I)
     END DO
     WRITE(*,*) ' '
  10 FORMAT(E16.8)
     END


Obviously, not as elegant but will work for this simple case. Another idea would be to write a F77 IO library which contains subroutines that use the runtime edit descriptor. This might be overkill for a simple case, but for more complex runtime edit descriptors this might be the way to go. Of course, I have not tried this myself, but it seems like a resonable solution.

Hope it helps,
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