Home > Archive > Fortran > December 2005 > How to use REWIND COMMAND of FORTRAN77 in FORTRAN 90
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
How to use REWIND COMMAND of FORTRAN77 in FORTRAN 90
|
|
| vinnie 2005-11-28, 3:57 am |
| hey all,
I am using a program to findout the average stresses in a finite
element model.Here i am using REWIND command at the end to read the
nodal connectivity of a element.As i have like 1000 elements i have to
rewind the process to the beginning to read each element's nodal
connectivity every time.
Plz let me know how to do this.
Thank u
Vinnu Arige.
| |
| David Flower 2005-11-28, 3:57 am |
|
vinnie wrote:
> hey all,
> I am using a program to findout the average stresses in a finite
> element model.Here i am using REWIND command at the end to read the
> nodal connectivity of a element.As i have like 1000 elements i have to
> rewind the process to the beginning to read each element's nodal
> connectivity every time.
>
> Plz let me know how to do this.
> Thank u
> Vinnu Arige.
REWIND 42
or
REWIND ( UNIT=42 )
positions the (sequential ) file on unit 42 at the start, but I assumed
you got that far..
That being said, I am surprised that you need to do it. Can you not
store the data in memory when you read the file, and copy them each
time they are required to be reset
Dave Flower
| |
| glen herrmannsfeldt 2005-11-28, 7:01 pm |
| vinnie wrote:
> hey all,
> I am using a program to findout the average stresses in a finite
> element model.Here i am using REWIND command at the end to read the
> nodal connectivity of a element.As i have like 1000 elements i have to
> rewind the process to the beginning to read each element's nodal
> connectivity every time.
As far as I know, there are two uses for REWIND.
One is to reread a file, which would usually only be the case when it
was too big to fit into memory, or at least was possibly too big.
The other is to write a file and then reread it, often used for
temporary (intermediate) data, again when it won't fit into memory.
-- glen
| |
| Andy Spragg 2005-12-13, 4:13 am |
| On 28 Nov 2005 09:08:20 -0800, "jon" <jon_d_r@msn.com> wrote:
>Another use would be to read the input file with a one-line buffer;
>parse the data in the buffer and count whatever the program to count;
>allocate array space based on the count(s); REWIND; and read the data
>into the allocated arrays. (Unless, of course, you require the user to
>supply "control cards" at the beginning of the data "deck" ;^)
Curses, you beat me to it. In fact that was one of the first things I
did differently when I started to "migrate" to FORTRAN 9x, and is a
good illustration of how the use of REWIND might differ from FORTRAN
77. I'm talking about pragmatics not semantics obviously.
|
|
|
|
|