- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
All,
I want to open mutiple time step file eg. q005.dat, q015.dat, ..................... q995.dat., and write formattted solution(CFD) data on it. There will be hundreds of them, each for one time steps.
I have been able to open a file and write a time step data on it. How can I extend to several files........?
Any help will be highly appreciated.
Regards,
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Where are you seeing difficulty? Close the file, open the next one,...
Are you asking how to generated multiple file names? e.g.
character(len=9) fname
do nfile=1,995
write(fname,"('q',i3.3)")nfile
open(11,file=fname)
....
close(11)
enddo
Are you asking how to generated multiple file names? e.g.
character(len=9) fname
do nfile=1,995
write(fname,"('q',i3.3)")nfile
open(11,file=fname)
....
close(11)
enddo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tim18,
Thanks! I am almost there; generated the mutiple files with your help.....thanks a lot.
How could Iappend extension '.dat' on files such generated? May this be a silly question, I am asking again as my usual method did not work out here .....and I am new......
Ram
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
write(fname,"('q',i3.3,'.dat')")nfile
or
open(11,file=fname//'.dat')
or
open(11,file=fname//'.dat')
Message Edited by tim18 on 06-17-200604:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Actually, I did mean to include this:
write(fname,"('q',i3.3,'.dat')")nfile
Although many people would do
open(11, file=fname//'.dat')
write(fname,"('q',i3.3,'.dat')")nfile
Although many people would do
open(11, file=fname//'.dat')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tim18,
Thnaks for help. great.
Ram

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page