Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Calling shell in fortran

  1. Jun 12, 2009 #1

    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
  2. jcsd
  3. Jul 13, 2009 #2
    If you are using the gfortran compiler there is a subroutine called "system" http://gcc.gnu.org/onlinedocs/gfortran/SYSTEM.html" [Broken]. 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: May 4, 2017
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook