Sunday, September 7, 2008

Which Command would you use to run a Fortran code?

Fortran is a programming language, which means you write a program in Fortran, and COMPILE it to an EXECUTABLE program. The compiler you use differs depending on which operating system platform you intend to run the program on. If you wish to run the program on a PC using Windows XP, you must first compile it using a specific Fortran-compiler for Windows XP. The result after compiling will be an executable file (with the file-ending .exe). To find a suitable compiler, check out, for instance.

To compile it, you need a Fortan compiler suitable for both your operating system as well as the version of Fortran the code was written for.

There is a free Fortran Compiler for Fortran77 from the GNU Project:

For Windows:
For Unix:

Given that you know it is Fortran Code, we can assume that you do not have a compiled one, but just raw Frotran Source code.

The above is correct assuming your question is "Given the Fortran source code, how do I run it?" However if your question is "Given the Fortran executable (ProgName.exe) how do I run it?", the answer is that you run it like any other program. You either: 1 - Double-click on the file name OR 2 - Open a DOS window, go to the directory where the file is and type in the filename with or without the extension .exe OR 3 - You can select Start and Run and type in the filename.

Like any "compilable" language it can be used to build an exe or a dll. But a dll MUST be called by another program to run, you can only run a .exe directly.

No comments: