tags:

views:

483

answers:

8

Hi, all,

Several of my university teachers use Fortran. New Fortran specifications and extensions (like HPF) appear. Fortran even takes 26th place in the TIOBE ranking list. I've got interested in this fact and it raised several questions:

  1. Do you use any version of Fortran today (or recently)?
  2. In what activity or project and why?
  3. What is it good for today and why is it to be preferred over younger alternatives?
+2  A: 

Have a look here for some profound pro-Fortran arguments seen from the scientific computing point of view.

h0b0
+5  A: 

You bet. Nothing faster than fortran for math work. And C <-> fortran is pretty easy these days. And when you get a carefully crafted fortran code, who wants to rewrite it in another language with all the inherent risks that you'll get it wrong?

xcramps
I would say the argument these days is more the vast libraries of existing Fortran code and the language features designed for working with matrices rather than its inherent speed. C/C++ should be just as fast and writing CUDA code can be orders of magnitude faster than Fortran.
Eric
But using CUDA for highly-parallel C code, while efficient, is not available to everyone due to CUDA's hardware requirements. Fortran can be used by those without said requirements. (Of course, there are other massively-parallel systems that can be used besides that of CUDA, so my previous point isn't all that big of a deal.)
JAB
C fortran calling conventions can be tricky. On windows and linux, everything is passed by reference. On windows (with the Intel Fortran version of AMD's ACML), I had to add a by-value parameter for each string being passed. On linux, you have to add an underscore to the name.
Juan
xcramps
@Eric- BS (aka bullshit). Try it on a real-world problem, and post your comparative code. Bet you fucked up somewhere. CUDA is a bad joke. Sounds good on paper, though. And it impresses simpleton managers (of which there are lots).
xcramps
+10  A: 

Fortran is widely used in the Astronomy and HPC communities. See for example this parallel star formation code. Another example of a major Fortran code is the UK MET Office Unified Model, which is millions of lines of Fortran overlaid with Perl and Korn shell (yummy!). There is a lot of existing expertise in using Fortran for numerical simulation work. The other reason it continues to be used is the huge amount of legacy code that exists. Many of these simulation codes are built up over years through the efforts of successive generations of grad students.

From a technical perspective, Fortran is extremely fast and has excellent support for array operations, which is very handy for crunching large volumes of numbers.

ire_and_curses
How large was the MET Office Unified Model when it was first created?
JAB
Of all the words I can think of to describe the UM code, yummy certainly isn't one of them.
Tim Whitcomb
@Cat Megex: Unfortunately I couldn't easily find a number, but you might be interested in this page describing the history and evolution of the code: http://badc.nerc.ac.uk/data/um/umhist.html
ire_and_curses
+6  A: 

I work in numerical weather prediction, so essentially all our new and old code is in Fortran - all of the models I can think of use it, and we make heavy, heavy use of high-performance computing resources. As ire_and_curses mentioned, the support for array operations is a powerful reason why we do this - there's also a large amount of legacy code that we use for things like observation processing and quality control.

There is also excellent support for parallel programming (e.g. MPI and OpenMP), which makes it popular for running on large supercomputers. There are also many libraries that have evolved over many years to provide incredibly fast common operations (e.g. BLAS and LAPACK) or solver routines (e.g. ODRPACK).

Tim Whitcomb
+1  A: 

My field, experimental nuclear and particle physics has moved in the last 15 years from a set of fortran based tools (CERNLIB and geant3) to a set of c++ based tools (ROOT and genat4).

But not because c++ is faster, because it makes complicated structures easier to write and maintain. Our data often have complicated inter-relationships which we express using pointers and type-trees. This was much harder to do in the old fortran77 code (and the move to replace the tools started before the newer fortrans were stable or well known).


It s also worth noting that people who have never done heavy number crunching might not understand how many uniform, deeply nested computations go into that kind of work. Even after decades of Moore's law were are still talking about hours, days or weeks on the biggest machines around (the problems just keep getting better). These codes typically have different characteristics from anything you'd write to run on you personal machine.

dmckee
+2  A: 

My father in-law uses it for ground water modelling. They do huge grid based processing to workout how different water wells effect each other, and therefore if new well should get local-body consent.

It's a field where the code is all Fortran, so it's still all Fortran

Simeon Pilgrim
A: 

I'm a traffic engineer and we use network traffic modelling software which is FORTRAN based (SATURN).

TBH I don't think these days it's due to FORTRAN being more inherently suitable, it's more to do with the legacy of the (supposedly) tried-and-tested software which has become a defacto industry standard. The software is effectively still running cards...

Smalltown2000
+3  A: 

I used C/C++ for years to do scientific computing, in particular solving integral equations for the structures of dense fluids. When I changed to Fortran, life got much easier. This is not because of a problem with C, but because there are so many good numerical libraries for Fortran, and so much code already available. Fortran is designed specifically for numerical computing, and I find it easier to teach Fortran to research students. I am ready to believe that in principle C is just as fast, and better or more elegant in many ways, but I can get the job done faster in Fortran.

gusgw