3

I have just got a job, starting in a months time which requires me to use fortran.

I have brought a couple of books, but they seem to lack any questions or problems and that is how i learn best.

I would like to know if you could recommend and books or websites that offer problems that i could practise with.

Thanks

genesis
  • 50,477
  • 20
  • 96
  • 125
SimpleSimon
  • 360
  • 3
  • 9
  • Did you search StackOverflow for similar questions? There seem to be several dealing with this general topic already. – Cephron Apr 28 '11 at 18:40
  • 13
    So how did you get a job programming in fortran when you don't know fortran? – PurplePilot Apr 28 '11 at 18:44
  • 3
    Can you program in more than 1 procedural language already? If so another is unlikley to take you more than a few days to get to grips with; none of the language concepts should come as a suprise to you. – Pete Stensønes Apr 28 '11 at 19:22
  • Ditto Pete Stensønes's comment. The main differences between Fortran and C based languages are that Fortran (a) has a much more verbose syntax, which can be annoying, (b) everything starts at 1, not zero, and (c) its array handling is wickedly awesome. The rest is details. Having said that, I'll dig up some book references and post them later today. – Jonathan Dursi Apr 28 '11 at 19:50
  • 2
    @PurplePilot - I'm guessing he hasn't got a job as a programmer, but a "job which requires him to use fortran". That's the beauty of the thing; it's simple enough that many non professional programmers (classical engineers) use it extensively. – Rook Apr 28 '11 at 21:55
  • Its an internship as a programmer. I have learned C and java to an ok standard. After a bit more searching, i have found projecteuler.net to look quite useful. Cheers for the pointers, much appreciated. – SimpleSimon Apr 28 '11 at 23:37
  • 1
    `That's the beauty of the thing; it's simple enough that many non professional programmers (classical engineers) use it extensively`. And the main source of disgusting and unreliable code. – Stefano Borini Dec 28 '11 at 23:41

4 Answers4

15

I can recommend several, depending on your previous programming in general knowledge and Fortran specific knowledge.

For an absolute beginner (and don't take this in a negative context; it just means you're starting anew, and unlike someone who has a habit of some bad Fortran77 practices, you'll start with a clean mindset) I would definitely go with Chapman's Fortran 95/2003 for Scientists & Engineers. It is an excellent learning book, and although it has some drawbacks they're not important at this stage. It also has a plethora of examples useful in real life. It also emphasises good modern Fortran concepts and ideas (Fortran 90 and newer).

After it, or maybe instead of it, if you're looking for more of a reference book one cannot recommend enough one of the following:
- Metcalf, Reid and Cohen's Fortran 95/2003 Explained (btw, a new edition covering the latest Fortran standard is coming up in a few days) - a classical reference book. Some swear by it instead of Chapman's.
- The Fortran 2003 Handbook: The Complete Syntax, Features and Procedures by several authors; a standard reference book, dealing with the finer aspects of the language. Not important at this stage but just so you know it's there.

Apart from these, which I like to call "the big three", there are numerous tutorials, scriptas and handbooks all over the web (free) and on Amazon. Some links were given in here as well, so I won't repeat those. Also, your compiler is bound to have a good reference manual I don't know about the free g* ones, but all commercial ones do.)

Apart from that, you know you can always ask any question that comes to your mind in here, and on comp.lang.fortran (usenet group; google for a "Usenet client" or "newsclient" and check it out.). Some very(!) knowledgeable people lurk in there.

Community
  • 1
  • 1
Rook
  • 60,248
  • 49
  • 165
  • 242
  • Cheers, I really appreciate the advice. – SimpleSimon Apr 28 '11 at 23:48
  • Why isn't there an "official" fortran reference like what we have in the other languages? – Pacerier Aug 30 '13 at 12:29
  • @Pacerier - Sorry for not noticing your comment earlier. Unfortunatelly, due to other obligations, I'm not active here anymore as much as I would like to be. But, could you clarify, what do you mean under "official reference"? Foe example, what would be the "official reference" for C++ or Python? Stroustrup / van Rossum perhaps? In that case, there is actually - fortran has a Standard (latest is from 2008) which all vendors are obligated to implement. Implementation is vendor-wise, but all have – Rook May 10 '16 at 13:47
  • to adhere to the Standard which in a nutshell says that "all programs must produce the same results regardless of platform (platform = compiler + platform on which it is running, e.g. Intel x86 or PowerPC or ...)". This is a different approach from nowadays more often used, implementation-development which is an approach that follows how the specific vendors made stuff, and then "official" comes from that. In fortran approach vendors usually follow the standard in the years after, but at least one can plan with what is to come, which is important for software – Rook May 10 '16 at 13:47
  • which is developed for a lifetime of ... a longer time period. But the Standard isn't a very good text for beginners. It is more of a reference type of text so I refrain from recommending it. – Rook May 10 '16 at 13:48
3

If you haven't already, install Linux and gcc on a home computer and begin to play with FORTRAN or Fortran. The command prompt syntax is gfortran filename.f which produces an executable file named a.out.

As for hints of what to experiment with, use previous answers to Stack Overflow questions, from simple to not-so-simple:

Community
  • 1
  • 1
wallyk
  • 56,922
  • 16
  • 83
  • 148
3

Back in the day, I had the book "Structured Fortran 77 for Engineers and Scientists". There are updated versions of this book that cover the newer Fortran standards.

likso
  • 3,370
  • 3
  • 17
  • 18
  • Amazon has it in stock http://www.amazon.com/Structured-Fortran-77-Engineers-Scientists/dp/0471364061/ref=sr_1_1?ie=UTF8&qid=1304044327&sr=8-1 from $118 new to $24 used. – wallyk Apr 29 '11 at 02:33
  • Ack, no! I would **never** encourage the learning of `FORTRAN 77` (i.e. the 1977 language standardization) by anyone who does not _explicitly_ need to maintain compatibility with legacy environment. Or to paraphrase glibly, _F77 is evil, and should avoid whenever possible and left in the annals of computing history where it belongs._ It's not `FORTRAN H` but still. – mctylr Aug 13 '12 at 18:40
1

My Vote goes for the classic McCracken Book

http://www.amazon.com/Guide-Fortran-Programming-Daniel-McCracken/dp/0471582816

Neuomancer
  • 11
  • 1
  • An excellent book, although a little outdated by today's standards. The author (rest his soul; died a few weeks ago) was a gifted writer and teacher. – Rook Sep 22 '11 at 16:06