Run External File.exe Through Fortran 90 - Answered

  • Fortran
  • Thread starter andredoc
  • Start date
  • Tags
    Fortran
In summary, the person is a MSc student and needs to implement a fortran 90 program for their dissertation but is struggling to run an external file through fortran. They received advice to use the call system command, which worked for them.
  • #1
andredoc
5
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
  • #2
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:
  • #3
Mgb_phys, with the call system comand my program is working, thanks!
 

1. How do I run an external file.exe through Fortran 90?

To run an external file.exe through Fortran 90, you will need to use the CALL SYSTEM command. This command allows you to execute external programs or commands from within your Fortran program. You will need to provide the location and name of the file.exe as well as any necessary input arguments.

2. Can I pass variables to the external file.exe using Fortran 90?

Yes, you can pass variables to the external file.exe using Fortran 90. You can use the CALL SYSTEM command to pass arguments to the file.exe. These arguments can be defined as variables in your Fortran program and then passed as part of the command to run the external file.

3. What are the advantages of running an external file.exe through Fortran 90?

Running an external file.exe through Fortran 90 allows you to incorporate external programs and commands into your Fortran program. This can be useful for tasks such as data processing or running simulations. It also allows for more flexibility and automation in your Fortran program.

4. Can I run multiple external file.exe's through Fortran 90?

Yes, you can run multiple external file.exe's through Fortran 90. You can use the CALL SYSTEM command multiple times within your Fortran program to execute different file.exe's. You can also pass different arguments to each file.exe if needed.

5. Are there any limitations to running external file.exe's through Fortran 90?

One limitation of running external file.exe's through Fortran 90 is that it may not be compatible with all operating systems. Additionally, the file.exe must be a standalone executable and cannot require any user input during its execution. It is also important to ensure that the output of the file.exe is compatible with Fortran 90 data types.

Similar threads

  • Programming and Computer Science
Replies
8
Views
2K
  • Programming and Computer Science
Replies
16
Views
1K
  • Programming and Computer Science
Replies
5
Views
4K
  • Programming and Computer Science
Replies
4
Views
1K
  • Programming and Computer Science
Replies
8
Views
3K
  • Programming and Computer Science
Replies
8
Views
1K
  • Programming and Computer Science
Replies
12
Views
1K
  • Programming and Computer Science
Replies
22
Views
921
  • Programming and Computer Science
Replies
5
Views
2K
  • Programming and Computer Science
Replies
5
Views
1K
Back
Top