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 had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...

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