PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

Variable Format

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



Joined: 02 Nov 2006
Posts: 20

PostPosted: Wed Feb 27, 2013 10:50 am    Post subject: Variable Format Reply with quote

Hi all,
I transferred intel fortran code form windows to Unix and cleaned up most of the syntax issues and one issue I am not able to fix it. This is related to variable format. In Intel, i can do the following

Write(NFSnp,"(4x,'I',1x,<im>i10)") (nom(i), i = 1, im)

But in Unix PG fortran (version 9.), I get "illegal character in format string" error. I am not sure if this is taken care of in new version of pg fortran for unix. If it is, then I have to move the code to a unix machine where I have latest version of Fortran.

Please let me know your thought on this issue.

Thanks
Venkat
Back to top
View user's profile
Kolluru



Joined: 02 Nov 2006
Posts: 20

PostPosted: Wed Feb 27, 2013 5:25 pm    Post subject: Variable Format Reply with quote

Hi all,
After review of userguide, I found out that variable format specification is available only for pgf77. This is a very useful method and I am not sure why this was removed in pgf90. I have tons of code that need rewriting of all the formats.

Please let me know if there is any other method is available.

Thanks
Venkat
Back to top
View user's profile
mkcolg



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

PostPosted: Thu Feb 28, 2013 10:25 am    Post subject: Reply with quote

Hi Venkat,

Variable formats is a Fortran77 extension which we implemented in pgf77. It was discouraged as an extension to F90 primarily because of the availability of internal I/O and the additions of '0-width' edit descriptors such as I0 (that's I followed by the digit zero).

In the example, the variable format can be constructed using internal I/O:

Quote:
!! Write(NFSnp,"(4x,'I',1x,<im>i10)") (nom(i), i = 1, im)
character*40 ch
write(ch,99)im
99 format("(4x,'I',1x,",I0,"i10)")
Write(NFSnp,fmt=ch) (nom(i), i = 1, im)


- 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