Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fortran programming help

Status
Not open for further replies.

Frankpendegrass

Programmer
Jun 25, 2009
3
GB
Hi.
I have an executable, call it, Pend.exe, that is required to run input files. The trouble is, the input files are about 1000 and they all have different names. How do I write a program in Fortran, that calls the executable, Pend.exe, and successively runs each input file ? Kindly help.

Frank.
 
A few ways of doing this

Method 1
1) Create a file with all your input files
2) Use the system call with each of these files as a parameter.

Method 2
Don't bother with the fortran program: just use a batch/shell script.
 
Presumably, "Pend.exe" accepts the input file name as an input parameter?

Then the best way is to use a OS command to list the files that are intended inputs, save the result of the list into a file, edit the file to add the Pend.exe command before each file name, and convert the resulting file into an executable script. Doing it with a Fortran program will be longer to implement, and the result would be the same.


CBVG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top