CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

fortran

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 16, 2002, 08:42
Default fortran
  #1
moh
Guest
 
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, 11:06
Default Re: fortran
  #2
Rob
Guest
 
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

Rob
  Reply With Quote

Old   October 17, 2002, 06:52
Default Re: fortran
  #3
newcomer
Guest
 
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

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
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 06:37
Intrinsic Procedure 'ISNAN' in GNU FORTRAN 77 hawk Main CFD Forum 1 April 12, 2005 23:13
visual fortran Monica Main CFD Forum 1 August 28, 2004 21: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 10:34


All times are GMT -4. The time now is 06:08.