Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Coffee question: Who uses fortran?

Status
Not open for further replies.

GerritGroot

Technical User
Nov 3, 2006
291
ES
Hi,

During the coffee, someone asked me why I program in fortran, as I'm the only one in the whole company who's using fortran.

I answered that in my discipline (aerodynamics) fortran is the most used language and that, as far as I know, people in physics also still use it.

Later on, I started asking myself whether my answer is true... (..after having given it :) )
What do you say? What do ye use fortran for?

Gerrit
 
GerritGroot said:
as I'm the only one in the whole company who's using fortran.
I'm curious: and what programming languages are using your colleagues?
 
I use Fortran for fun - makes a change from C/C++/C#/Java and it is nicer than Ada/Pascal and different from php and VB/VBScript.

I also maintain programs written in Fortran and all the other languages mentioned. I'm not the only one using Fortran: quite a few people in my company use it. Most of them use F77: occasionally, you might see F90/F95. They haven't migrated to 2003 yet.
 
Many legacy codes written in FORTRAN exist and must be maintained. In the past, FORTRAN was used for almost all subjects.

My main domain is nuclear reactor accident simulation, which covers for instance neutronics, thermics, mechanics, chemistry (equilibrium and kinetics), thermal-hydraulics, aerosol behavior, fusion of materials, debris bed and molten pool studies, lava/concrete interaction, hydrogen explosions, fires... All the integrated codes in that domain are written in FORTRAN like MAAP, MELCOR or ASTEC, even if these complicated codes often contain parts written in other languages like C or JAVA.

Most codes about quantum chemistry are also written in FORTRAN. Ditto for climate simulation.

Large finite element mechanical codes are also written in FORTRAN because these projects have started during seventies (look into NASTRAN for instance developed for NASA and used by most countries in the aeronautics and space area).

But the part of new FORTRAN codes has reduced strongly. Many scientific codes written in C or C++ have been developed during nineties because FORTRAN-77, without dynamic memory management, was outdated.

From my point of view, if C is clearly better than FORTRAN-77, I consider that FORTRAN-95 is better than C : cleaner, more robust, with better checking and more powerful when implementing mathematical algorithms (vectorized language and array indexes starting at any position). Anyway, I continue to program in C too but for very specific things.

I find C++ too complicated and not well suited for the mind of scientists who are not computer science experts. A physicist or a chemist is able to modify a FORTRAN code to implement a particular model. Such task is much more complicated in a C++ code : if the logic of FORTRAN and C are similar and easy to understand, the one of C++ is totally different.

As object oriented languages, JAVA or C# are much simpler to learn than C++.

The last norm FORTRAN-2008 designed for // computing seems very promising even if OpenMP is easier to introduce in existing codes. I don't think that the GPU programming will be successful, even if FORTRAN for CUDA is already available : it is too difficult and too expensive to adapt an existing large code to that technology which will be perhaps replaced by a better one in a near future.



François Jacq
 
I learned and used Fortran 77 in 90's during my study of numerical mathematics. We used it mostly for FEM.
In that time we were not very happy to use Fortran, because we rather programmed in "better" languages like Pascal and C/C++.
Also, I can remember that in 90's many of the core numerical packages was rewritten from Fortran 77 to C/C++.

Later I used for computation only Matlab and CAS like Mathematica, Maple and MuPAD.

Now I'm using Fortran only for fun in this Forum and I wonder how "the better language" Pascal died and "the legacy" Fortran is still alive.
 
Pascal was created as a teaching language and sort of worked its way into industry with quite a few departures from the original design. It now survives as Delphi. I find it too much like Algol 60 and very cumbersome to use. If you do one statement per line, Nick Wirth's compiler (in data structures + algorithms = programs) will cover 30 pages instead of just 5! The successors Modula2 and Oberon never really took off.

Unlike Pascal, Fortran is really neat when it comes to initializing data.

There are also very few languages that have built in parallel processing syntax. The only other ones I've used are Algol 68 and Occam.
 
My colleagues either don't program (i.e. using macros and that shit) either use Visual Basic or C++.

I conclude that my first guess was not that far from reality, it's mainly used by people with problems in physics (like FJacq) or other heavy number crunching in engineering, like FEM or aerodynamics. I agree with Jacq that most other languages are "not well suited for the mind of scientists who are not computer science experts". This is actually my main reason for using fortran.

I'm happily surprised by the ones who use it for fun (like Mikrom and XWB). For being "just" fun users, you seem to know quite lot about Fortran (looking at the answering history).

What also amazes me is the frequency by which new versions are released. First there was fortran 66 or something, then 77, then a long time nothing and suddenly, F90, F95, F2003 and now I read about F2008. Too many versions may kill the language.

Thanks for the feedback!

 
Actually there was also a big gap between FIII and FIV (aka F66). FIII appeared in 1958.

It takes a long time for standards committes to agree on what they want, especially when the syntax changes radically. I was on the BCS SIG for Fortran for a few years but they were going in all directions. Took them a long time to agree a way forward. There were all sorts of syntax proposed for parallel processing and all sorts of language extensions.

When they get to the computer sciency bits, most people don't bother. I think that is why F77 is still very popular. Many people just use F90 as free format F77. They don't bother with modules etc.
 
I use Fortran 90 for the development of an in-house chemical process simulator at my company. I got to choose the programming language, and I picked Fortran because I used it (for its speed) in some of my postgrad research so I was already somewhat acquainted with it, and I -- again -- need the speed for number-crunching. C would probably compare quite favourably, but as I say, I was already somewhat familiar with F90+, so I picked it to minimise time wasted on learning a new language.

--------------------------------------
Background: Chemical engineer, familiar mostly with MATLAB, but now branching out into real programming.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top