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

read a list of files using fortran 77

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

Reply
 
LinkBack Thread Tools Display Modes
Old   December 9, 2012, 21:47
Default read a list of files using fortran 77
  #1
New Member
 
Join Date: Dec 2012
Posts: 3
Rep Power: 4
sp_song is on a distinguished road
Hello,

I have a question on how to read a list of data files using fortran 77:

For example, I have 200 files:

data.0100.inp
data.0101.inp
data.0102.inp
.....
data.0299.inp

I don't know how to handle the characters 01** in fortran 77. Could you please comment on this?

Thanks a lot!

Steve
sp_song is offline   Reply With Quote

Old   December 10, 2012, 10:09
Default
  #2
Senior Member
 
Rami Ben-Zvi
Join Date: Mar 2009
Posts: 148
Rep Power: 8
Rami is on a distinguished road
Quote:
Originally Posted by sp_song View Post
Hello,

I have a question on how to read a list of data files using fortran 77:

For example, I have 200 files:

data.0100.inp
data.0101.inp
data.0102.inp
.....
data.0299.inp

I don't know how to handle the characters 01** in fortran 77. Could you please comment on this?

Thanks a lot!

Steve
Hello steeve,

Try the following:

...
character*13 fn
...
do i = 100, 299
write(fn, 'a6, i3, a4', 'data.0', i, '.inp')
open(lunit, fn, ...)
...
enddo
...
Rami is offline   Reply With Quote

Reply

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
GPU Linear Solvers for OpenFOAM gocarts OpenFOAM Announcements from Other Sources 35 March 1, 2012 21:41
"parabolicVelocity" in OpenFoam 2.1.0 ? sawyer86 OpenFOAM Running, Solving & CFD 21 February 7, 2012 12:44
Comparison between C/C++ and Fortran? rick Main CFD Forum 45 September 6, 2011 00:52
critical error during installation of openfoam Fabio88 OpenFOAM Installation 21 June 2, 2010 03:01
Phase locked average in run time panara OpenFOAM 2 February 20, 2008 15:37


All times are GMT -4. The time now is 19:48.