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 

SALFORD UNFORMATTED INPUT/OUTPUT

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
saturn



Joined: 22 Apr 2008
Posts: 12

PostPosted: Mon Jun 14, 2010 12:20 pm    Post subject: SALFORD UNFORMATTED INPUT/OUTPUT Reply with quote

SALFORD FORTRAN "UNFORMATTED" data output is different from the industry standard, which makes it difficult to process such data from other compilers such as Intel , PGI, and Microsoft FORTRAN all of which use the same format. Has anyone done any low-level work to output/input SALFORD "unformatted" data that is compatible with Intel/PGI/Microsoft FORTRAN?
Back to top
View user's profile Send private message
JohnHorspool



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

PostPosted: Mon Jun 14, 2010 2:39 pm    Post subject: Reply with quote

Yes, I have written routines to read and write binary STL files.
To do this I use OPENRW@ , WRITEF@ , READF@ and CLOSEF@

I have had no trouble reading binary STL files produced by CAD systems.

Regards,
John
Back to top
View user's profile Send private message Visit poster's website
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Tue Jun 15, 2010 2:15 am    Post subject: Reply with quote

Have you tried FORM='UNFORMATTED', ACCESS='TRANSPARENT' or ACCESS='DIRECT' ?
You may have better luck with these structures which do not include the record length. The other compilers may support these structures also.
It all depends on how complex your I/O list is.

The other option is to use a text format. With present cpu speeds, the big time user is how big is the transfer file, rather than binary vs text I/O.
You may be able to speed up the I/O dump, by simply excluding zeros or identifying multiple values in a text structure: such as "i:j value" where I and j are ranges of subscripts, or "i:n value" where i is the subscript and n is the count. The basic entry would be "i value". You will need to experiment with "value" to minimise the size while providing sufficient precision. All this could be enclosed in a single subroutine to export or import arrays. This assumes you have access to the code for the other compilers.
The other big advantage is that the text file can be more easily inspected or changed.

John
Back to top
View user's profile Send private message
saturn



Joined: 22 Apr 2008
Posts: 12

PostPosted: Tue Jun 15, 2010 10:11 am    Post subject: Reply with quote

We adopted the text format path temporarily but want to maintain the binary format. I will try ACCESS='TRANSPARENT'/'DIRECT' options as well as OPENRW@/WRITEF@/READF@/CLOSEF@.
Back to top
View user's profile Send private message
IanLambley



Joined: 17 Dec 2006
Posts: 490
Location: Sunderland

PostPosted: Thu Jun 17, 2010 12:22 pm    Post subject: Reply with quote

I've written a couple of short programs to convert from one format to the other, see if these work.
They assume the following:

1. FTN95 record less than 255 bytes
<rec_len 1 btye> <record> <rec_len 1 btye>

2. FTN95 record greater or equal to 255 bytes
<FFhex 1 byte> <rec_len 4 btyes> <record> <rec_len 4 btyes> <FFhex 1 byte>

3. Other compilers
<rec_len 4 btyes> <record> <rec_len 4 btyes>

Programs located at:
www.norsoftdev.com/silverfrost/convert_unformatted.zip

They are not very neat and are jsut examples. Probably limited to records less than 65526 bytes, but increase the dimensions if there are problems, or use ALLOCATE etc.

Regards
Ian
Back to top
View user's profile Send private message Send e-mail
saturn



Joined: 22 Apr 2008
Posts: 12

PostPosted: Thu Jun 17, 2010 12:47 pm    Post subject: Reply with quote

Ian, thanks a lot for this, I will adapt to requirements.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General 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