Re: The concept of a record
- From: Klaus Wacker <wacker@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 30 Jan 2008 18:30:18 +0000 (UTC)
qsc <qingshan.chen@xxxxxxxxx> wrote:
I found it hard to understand the concept of a record in Fortran I/O.
Here are some of the questions I have about it.
The answers to your questions depend on whether you have formatted or
unformatted I/O.
1. one record is equivalent to one line?
In formatted I/O, yes. In un formatted I/O the concept of a line
doesn't exist.
2. Each read, write or print statement deal transfer one record?
In unformatted I/O, yes (unless you use "advance=no", then you only
get part of a record). In formatted I/O, one I/O statement can deal
with several records. E.g., a "/" format item starts a new record. If
you run off of the end of the format string and you have still items
left in the I/O list, a new record will be started.
3. What if in one write statement I want output several values? Will
they be treated as one record, or splitted into several? For example:
write(12) U(:)
Notice that I want binary output, and the array U have many
components. So now, will U be written in one record, or many?
One record.
Will the
output be on one line, or many?
There is no line, write(12) U(:) is unformatted I/O. You may be
confusing this with write(12,*) U(:). This is formatted, list-directed
I/O. Here, the compiler or run time system is free to produce several
records or lines. It will usually do so if the line gets too long
otherwise.
Thanks in advance!
--
Klaus Wacker klaus.wacker@xxxxxxx
Experimentelle Physik V http://www.physik.uni-dortmund.de/~wacker
Universitaet Dortmund Tel.: +49 231 755 3587
D-44221 Dortmund Fax: +49 231 755 4547
.
- Follow-Ups:
- Re: The concept of a record
- From: glen herrmannsfeldt
- Re: The concept of a record
- From: qsc
- Re: The concept of a record
- References:
- The concept of a record
- From: qsc
- The concept of a record
- Prev by Date: Re: The concept of a record
- Next by Date: Re: Code as documentation
- Previous by thread: Re: The concept of a record
- Next by thread: Re: The concept of a record
- Index(es):
Relevant Pages
|
|