forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem with FORMAT statement

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
Anonymous
Guest





PostPosted: Thu Jul 13, 2006 4:53 am    Post subject: Problem with FORMAT statement Reply with quote

Hi,

I have been given a code, written in Frotran 90, that cannot be compiled by Salford Plato because of the following line:

format(<nbr_param>a13)

where 'nbr_param' is the number of repetitions and the size of an array that is a priori not known.
I tried different combinations such as:

format(nbr_param,a13)
format(<nbr_param>,a13) ...

but I cannot find any formatting that works! Does anyone have any idea what symbols or formatting I should use to make this work?
Thanks

Stephane
Back to top
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Thu Jul 13, 2006 5:13 am    Post subject: Problem with FORMAT statement Reply with quote

Stephane

Here is a simple example to give you the idea of what to do.
The example needs tidying up.

character(16) fmt,a(4)
n=4
a = "Testing"
WRITE(fmt,"(a,i1,a)") "(",n,"a13)"
OPEN(10,FILE="output.txt")
WRITE(10,fmt) (a(i),i=1,n)
CLOSE(10)
end
Back to top
View user's profile Send private message AIM Address
JohnHorspool



Joined: 26 Sep 2005
Posts: 270
Location: Gloucestershire UK

PostPosted: Thu Jul 13, 2006 8:26 am    Post subject: Problem with FORMAT statement Reply with quote

Stephane

The statement you have is not part of the fortran standard, it is a compiler specific extension, thus Salford is not obliged to support it.

I last saw your particular example when writing programs for a VAX mainframe using the VMS operating system, many years ago. I intentionally avoided using the VAX fortran extensions, so when I came to migrate to unix and then eventually to PC's, I had very little trouble in doing so. Others were far less fortunate, in producing flashy programs on the VAX they had created source code that was not portable. I wouldn't be surprised if you find more problems along the same lines!

Good luck!
_________________
John Horspool
Roshaz Software Ltd.
Gloucestershire
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
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 © 2001, 2005 phpBB Group