Fortran Run External File.exe Through Fortran 90 - Answered

  • Thread starter Thread starter andredoc
  • Start date Start date
  • Tags Tags
    Fortran
AI Thread Summary
To run an external executable file in Fortran 90, the `call system("commandline")` function can be utilized. This allows the Fortran program to execute a command line instruction, effectively running the external file. While this method is generally supported, its availability may vary depending on the specific compiler used. For capturing output from the external program, it is recommended to redirect the output to a file and then read that file within the Fortran code. The discussion confirms that using the `call system` command successfully resolved the issue for the user.
andredoc
Messages
5
Reaction score
0
Hi! I'm a MSc student and for the development of my dissertation I need to implement a simple fortran 90 program. I'm aware of the basic features of this language but I can't seem to find how to run an executable file (an external file) through fortran. My question is, how can I make the fortran code to run an external "file.exe"?

It's a basic question, but I haven't found an answer so far.

Thanks

Best regards

André
 
Technology news on Phys.org
Something like:
call system("commandline")

ps. Haven't used this myself recently - don't know if it is standard in all compilers.
I also haven;t used it to read data back from the system call - you might be better writing the output of the call to a file and readign the file from fortran.
 
Last edited:
Mgb_phys, with the call system comand my program is working, thanks!
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...

Similar threads

Replies
8
Views
4K
Replies
4
Views
2K
Replies
5
Views
5K
Replies
8
Views
4K
Replies
8
Views
2K
Replies
3
Views
4K
Back
Top