1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Fortran alternative to Matlab 'system' command

  1. Jun 8, 2012 #1

    I have been trying to run a linux executable (written in fortran77) into my another code (also in fortran77). In Matlab, I did it with "system('./<filename>')". But I am not able to do it in fortran script as './' is not simply working for me.

    I will really appreciate if anyone could tell me what alternative command I can use to execute an executable file into fortran code. A quick response will be extremely helpful and highly appreacited.

    Thanks in advance.

  2. jcsd
  3. Jun 9, 2012 #2


    User Avatar

    Staff: Mentor

    The command (if there is one in your Fortran) may not be "system()" but I have no idea of other possibilities. The "./" prefix is nothing to do with the language; it's a shortcut in Unix that says the executable is located in the current directory. So if the executable is not located in what the op sys will see as the current directory, you should specify the full pathname instead, e.g., '/mnt/hd1/usr/mushi/bin/filename'.
  4. Jun 11, 2012 #3
    Scroll down this


    to see real random number generator Fortran programs written in Fortran 77 and Fortran 90.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook