replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Understanding this syntax
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 

Understanding this syntax

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



Joined: 08 Apr 2011
Posts: 155

PostPosted: Mon Jun 03, 2013 10:54 am    Post subject: Understanding this syntax Reply with quote

Please can anyone advise what does the syntax mean?

Code:
read(unit=line,fmt="(I8,3E16.0)") node,xcoor,ycoor,zcoor


What does fmt=="(I8,3E16.0)") signify?
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2615
Location: Sydney

PostPosted: Tue Jun 04, 2013 1:35 am    Post subject: Reply with quote

Code:
read(unit=line,fmt="(I8,3E16.0)") node,xcoor,ycoor,zcoor

This is an "internal" read from a character variable "line", rather than from an external file.
Line should be declared as something like: CHARACTER LINE*100
fmt="(I8,3E16.0)" defines the format statement for reading the 4 variables, being an integer in 8 characters and 3 reals of 16 characters.
With FTN95, and probably most other compilers, you can use a comma to terminate each field, so that the following would be read correctly.
101,2., 3.,5.

"node,xcoor,ycoor,zcoor" is the variable list for the read, being in this case a node number and coordinates.

I note there is no IOSTAT= option. When reading, this should be included to manage and errors when interpreting the information in LINE. You should consider including IOSTAT=ii, and test if (II/=0) ... to recover in the event of an error in the input data.

Typically, LINE would have been previously read from the data file and then tested to see what sort of information it is, typically being a data line, termination line, comment line or a command line for the start of a new data element.

This READ statement expects all information to be in the first 56 characters of LINE. There is no allowance for the input information to be over two "lines", as might be the case if "fmt=*"
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