Computational Fortran books/resources for beginners

  • Thread starter Thread starter Whitehole
  • Start date Start date
  • Tags Tags
    Beginners Fortran
Click For Summary
Fortran is a valuable programming language for scientific computing, particularly in physics, and beginners are encouraged to start with Fortran 90 or newer versions due to their modern features. Resources such as online tutorials and "Numerical Recipes in Fortran" can help in learning both the language and numerical methods. Unlike Mathematica, which can handle symbolic computations, Fortran requires users to express solutions to differential equations through basic arithmetic operations. The historical context of Fortran, including its evolution from punch cards and the differences between versions like Fortran 77 and 90, is important for understanding its current applications. Overall, mastering Fortran can significantly enhance computational skills in scientific disciplines.
Whitehole
Messages
128
Reaction score
4
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?
 
Physics news on Phys.org
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.
 
  • Like
Likes scottdave
DrClaude said:
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.
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?
 
Whitehole said:
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?

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.
 
hilbert2 said:
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.
Thanks for that information!
 
i am self learning physics. have you ever worked your way backwards again after finishing most undergrad courses? i have textbooks for junior/senior physics courses in classical mechanics, electrodynamics, thermal physics, quantum mechanics, and mathematical methods for self learning. i have the Halliday Resnick sophomore book. working backwards, i checked out Conceptual Physics 11th edition by Hewitt and found this book very helpful. What i liked most was how stimulating the pictures...

Similar threads

  • · Replies 9 ·
Replies
9
Views
10K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 30 ·
2
Replies
30
Views
6K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K