CFD Online Logo CFD Online URL
Home > Forums > Main CFD Forum


Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   October 16, 2002, 07:42
Default fortran
Posts: n/a
hi could any one describe for me how can i append two data file.for example in my restart code i want data of restart program dont over right on the last data thanks
  Reply With Quote

Old   October 16, 2002, 10:06
Default Re: fortran
Posts: n/a
This can be compiler dependent but I have generally found the following successful for a number of fortran 77 and 90 compilers:

Suppose you have a file called data.dat which is not empty.

If you simply use open(**,file='data.dat') , where ** is your reference number to the file, and then write to the file all old data will be overwritten.

To overcome this problem modify the open statement to read open(**,file='data.dat',ACCESS='APPEND') where ** is as before. Your old data should now be safe and the new data will follow it.

Hope this works

  Reply With Quote

Old   October 17, 2002, 05:52
Default Re: fortran
Posts: n/a
A caution - in the very beginning you should once open the file (not append access) and close the same. Otherwise you get a huge appended file. Your case is for restart.
  Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fortran Compiler-CFX12.1 Araz CFX 13 March 27, 2017 05:37
Intrinsic Procedure 'ISNAN' in GNU FORTRAN 77 hawk Main CFD Forum 1 April 12, 2005 22:13
visual fortran Monica Main CFD Forum 1 August 28, 2004 20:45
Fortran77 or Fortran 90 Swapnil CFX 2 November 26, 2002 16:16
Why Favoring Fortran over C/C++? Zi-Wei Chiou Main CFD Forum 35 September 26, 2001 09:34

All times are GMT -4. The time now is 09:37.