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!

Computational Fortran books/resources for beginners

  1. Apr 27, 2017 #1
    I have a background of undergraduate physics but I consider myself to be quite weak in programming. I'm aware of the usefulness of computational software/programming software in the sciences, particularly physics. I'd like to ask for recommendations on how to start learning fortran assuming I have little to no knowledge about programming. It's better if for example the book applies it to mathematics or physics problems.

    Also, what is the difference between the fortrans that I see, can anyone give me a brief background on this?
  2. jcsd
  3. Apr 27, 2017 #2


    User Avatar
    Science Advisor
    Gold Member

  4. Apr 27, 2017 #3


    User Avatar

    Staff: Mentor

    There are some good tutorials available on-line. Google "fortran tutorial".

    After that, you can check out Numerical Recipes in Fortran, to learn more about numerical methods.

    As for the different flavors of Fortran, you should know that Fortran has a long history dating back to the time of punch cards. Fortran 77 still uses a fixed column format for program input, in keeping with what one would have to do with a punch card. Except for maintaining legacy code, no-one should be programming like this anymore, so you should learn Fortran 90 (or newer incarnations). The differences between Fortran 90, 95, and later implementations is minimal, and certainly not important for a beginner.
  5. Apr 27, 2017 #4
    Thanks for that resource, but how does Fortran really work? For example in Mathematica, suppose I have a set of DE's and I want to get the solution to those DE's because I want to get the value of a quantity that depends on those solutions. You can solve the system of differential equations using NDSolve, then we can store the solutions to some variable then plug into the corresponding quantities, i.e.

    sol = NDSolve[{y''[t] + y'[t] + y[t] ==0, p' + p == y'[t], y[0]==1, y'[0]==1, p[0]==2}, {y, p}, {t, to, tf}]

    ysol[t] /. sol
    y'[t] /. sol
    p[t] /. sol

    F(y,y',p):= some expression

    then we can plot F.

    I'm trying to search on how to solve DE's in Fortran but all I see are just numerical techniques applied in Fortran. So how is Fortran different from Mathematica in this aspect?
  6. Apr 27, 2017 #5


    User Avatar
    Science Advisor
    Gold Member

    Programming languages like C or Fortran don't understand symbolic formulae like differential equations, and don't know how to simplify expressions, as in ##(x^2 - 1)/(x+1) = x-1##. If you want to use Fortran to tell the computer how to solve a differential equation, you have to reduce the solution process to a sequence of very basic arithmetic operations (summing, multiplication, division). This is how real programming languages differ from something like Mathematica.
  7. Apr 27, 2017 #6
    Thanks for that information!
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted