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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does Fortran have the ability to run another process?

Status
Not open for further replies.

lauale

Programmer
Oct 10, 2017
3
DE
Hello everybody,
We have a Fortran program that we want upgrade using a opensource program which is write in c.
The c program is a command line tool and is in the public domain. To computes the program, the usage is:

ProgramName <inputfile> <outputfile>

My question is if I can run it from my fortran code.

Thanks
 
Do not use system(). It is not in the Fortran standard and is non-portable. There is a new intrinsic subroutine in Fortran standard 2008, execute_command_line() that you can use to call external command-line applications. For more info, see the textbook, "Modern Fortran Explained" by Metcalf et al 2011.
 
A lot depends on the resources your new process takes. Sometimes you will find that the program executes correctly from the cmd line but not from a program.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top