Is it possible to call shell commands from a Fortran program?

  • Context: Fortran 
  • Thread starter Thread starter yo6781
  • Start date Start date
  • Tags Tags
    Fortran Shell
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 6K views
yo6781
Messages
1
Reaction score
0
Hello!

I'm new here and I was wondering if anyone could help me.

I've a program in fortran which I want to combine with Matlab, both working in Ubunt 7.10 but I don't want to use mex-functions or MATLAB engine functions because it could cause damage to the fortran program I'm using. I was wondering if it would be possible to do it with a calling to the shell. Does anybody know if it is possible and how could I do it??

Thank you
 
Physics news on Phys.org
If you are using the gfortran compiler there is a subroutine called "system" http://gcc.gnu.org/onlinedocs/gfortran/SYSTEM.html" . But be aware about that this makes your code compiler dependent, so if it is possible you should avoid to use it.
 
Last edited by a moderator: