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

Newb Success! Gfortran & G77 in Vista. Step by Step Tutorial.

  1. Jul 30, 2009 #1
    Now that I have a suitable Fortran compiler I wonder what would be a good IDE. Anyway here is what I did:

    I am new to programming and command prompt usage. Here is the tutorial I used, then an added step that was necessary not covered in the link:


    (1). I downloaded/installed Gfortran and G77, setup PATHS, following instructions in link. Then I copied and pasted the following Hello World program in into the notepad text editor that comes with Vista:

    The indentation is 6 spaces.

    WRITE(UNIT=*, FMT=*) 'Hello World'


    (2). Saved the notepad doc as test.f and then in command prompt from the folder I saved it in typed ' gfortran test.f '.
    It created a .exe file called 'a' in same folder.

    (3). In prompt I typed ' gfortran test.f -o test.exe '
    Then entered and then ran it by merely typing ' test '.

    This is what it looked like in prompt:

    > gfortran test.f
    > gfortran test.f -o test.exe
    > test
    Hello World

    So now that I have a working Fortran compiler what I would like to know is what would be the best IDE, figuring in the fact that I am a total novice.
  2. jcsd
  3. Aug 4, 2009 #2
    There is no free integrated development environment (IDE) for FORTRAN. You should switch a more modern code like C++ and use the Visual Studio C++ Express edition to teach yourself a modern language.
  4. Aug 5, 2009 #3
    I'm listening. I am open to advise on this. So you are saying that Fortran's relevance is waining, and sees less relavance among the next generation of science programmers?
  5. Aug 6, 2009 #4
    Yes FORTRAN is dated however, it is still used due to legacy in programs, but C/C++ is the language you should spend time learning. C/C++ are used all the time in the scientific community and they can be used outside of the scientific community just as well. Try that with FORTRAN. Trust me, I spend weeks of my life writing older (circa 1974 - 1982) FORTRAN code over again (with many new features) in C/C++.

    You can download the IDE from Microsoft for fee. It is Visual Studio 2008 C++ Express. Don't worry about not having MFC capability you can do a lot with this version.
  6. Aug 7, 2009 #5
    Can I use Visual C++ to programin C?
  7. Aug 7, 2009 #6
    Last edited by a moderator: Apr 24, 2017
  8. Aug 8, 2009 #7
    Thanks for taking the time to answer me. I really am doing this stuff by myself. In fact, I started another thread elaborating more broadly on my situation.
    Last edited by a moderator: Apr 24, 2017
  9. Aug 8, 2009 #8
    Good, never stop learning. I have been teaching myself programming and general relativity for years. Sometimes the progress is slow, especially on the general relativity track but I never give up. When it comes to programming in todays' environment it can be difficult to know if you have selected the right path. Basically, what type of programs do you wish to write? Trying to write windows form programs (which are the ones you are familiar with that allow you point and click) that involve a GUI (graphical user interface) can be extremely difficult and time consuming for the most basic of programs. Now if you want to write console applications where the user manualy enters in data when prompted by the program and the output is nothing more than a number or a set of numbers, it can be much easier. Some of the programs I write that solve Ordinary Differential Equations (ODE) have to run out of the compilier and there is no user interface other than to see the results on the output screen.
    What are you interested in writing? Let me know I will help you out.

Share this great discussion with others via Reddit, Google+, Twitter, or Facebook