Live data from Hacker News

Why are most climate models in Fortran?

partee.io

21–30 of 136 posts

Re: Why are most climate models in Fortran?

#21

1. There are thousands of scientific subroutines written in Fortran that are stable and well tested - in fact, there are well established formal libraries of them that go back over 60 years. The researchers know and trust them. 2. Despite the sneers and derision that Fortran has been subjected to from non-Fortran programmers over recent decades, Fortran is an excellent language to do intensive scientific and mathemat…

Tested in the sense of test suites and formal proofs? That would be valuable to other disciplines using other tools. But this article isn't about fundamental algorithms being correctly-implemented in an endowment of legacy code, it's about defending a siloed language choice, which seems like an antiquated concern to me. I applaud anyone using a tool that works for them, but if it's good, then its users have accomplis…

"But this article isn't about fundamental algorithms being correctly-implemented in an endowment of legacy code, it's about defending a siloed language choice, which seems like an antiquated concern to me."

1. The first comment I would make is that the headline premise is wrong or at least deliberately misleading. Let's start with a correction. I would very much doubt that climate models are written in programming languages from 1950s. The Fortran code of the 1950s was not that much like the Fortran code that I learned in the late 1960s, and that late 1960s code bears little resemblance with modern Fortran code of today. Furthermore, the Fortran standard is certainly not dead, it is being continually updated: http://fortranwiki.org/fortran/show/Standards.

2. When I made comment about libraries going back 60 or so years, this would imply that libraries written in Fortran II ca 1956 or so would pose a problem today. I would suggest that it is not so because the process of updating libraries is formal and strict, thus an updated Fortran II subroutine would work perfectly well with today's modern Fortran. This 'upgrade' process is not like converting code from say Pascal to C or whatever, for here we are still within the confines of the Fortran framework and that that conversion process is well understood, straightforward and procedural.

3. This isn’t my idea, nor am I defending something that I learned decades ago and don't want to give up. Frankly, I do little Fortran programming these days so it's essentially irrelevant to me. The point I made and that I make again is that there is a sophisticated scientific computing environment in existence and it is used by thousands of current researchers and scientists around the world. Scientists would not use antiquated software on cutting edge science if it did not work. The fact is modern Fortran is a modern programming language that delivers the goods par excellence—likely much better than any other language, especially so given its long and mature infrastructure. For example, here are the first two reference I came across on the net, there are thousands more just like this:

https://arxiv.org/abs/hep-ph/0612134

https://www.sciencedirect.com/science/article/abs/pii/S00104...

4. Now let's look at the current situation—'modern' software. To begin, you should read this 27-year old Scientific American article titled 'Software's Chronic Crisis' from September 1994:

https://www.researchgate.net/publication/247573088_Software'...

I would contend that this article is just as relevant today as it was 27 years ago if not more so. In summary it says.

• Programmers work more like undisciplined artists than processional engineers (this problem remains unresolved).

• Essentially programming is not true engineering (since the time of the article, computer science has progressed somewhat but on the ground we still have multitude of unresolved problems).

• If programming is to be likened to engineering then it is in a highly unevolved state somewhat akin to the chemical industry ca 1800. Its practical function or operation is a mismatch with the everyday world or we wouldn't have the proliferation of problems that we currently have.

When, these days, one examines the situation with literally hundreds of different computer languages in existence, it is clear that there isn't enough human time and effort to rationalise them all and develop a coherent set of tools, in essence almost everything around us is only half done. We stand in the midst of an unholy Tower of Babel and it's an unmitigated mess (I could spend hours telling you what's wrong but you'll know that already).

The crux of the problem is that programmers spend much time and resources learning one or more computer languages and that it's dead easy to poke fun at mature languages such as Fortran as being old fashioned and out of date. The fact is they either do not adequately understand them or the reasons why they are used, or it is both.

The fact is it is this very maturity of Fortran that makes it so valuable to scientist and engineers. Those who are not conversant with or do not program in Fortran have simply not understood the reasons for its success.

Scientists and engineers have found the most reliable, stable and best fit available and that is to use a modern version of Fortran—simply because its reliable and it works.

This article only shows authors lack of understanding of the problem.

Oh, BTW, let me add that I have no contention with theoretical computer science models. It's just the divide between theoretical computer science and what happens in practice is as wide as it ever was.

Re: Why are most climate models in Fortran?

#22

Engineers are horrified to learn that mathematical modeling is done in a language created in the 50s, but aren't bothered by the fact that the dominant computer interaction model used in the field right now dates back to pre-WW2 teleprinters. Someone is lacking in self- and historic awareness. What practical problems does Fortran cause when used for numerical computing?

Somebody should warn them about avoiding accidentally using Pythagoras theorem, that was introduced 2500 years ago.

Re: Why are most climate models in Fortran?

#23

I work at one of the labs mentioned and get paid for running not only the climate models but mesoscale models as well, which are also written in Fortran. The premise of the article is that Fortran, 70 years later is still an appropriate tool to use for crunching numbers which it absolutely is but it neglects one major problem. Like the COBOL issue that was all the rage 20 years ago, it is difficult to hire younger ge…

My understanding is that they're mostly fortran programs linked together with unix scripts which are run on HPCs - could the models run in a more distributed way like high quality grid computing setup? Lastly, what's the best way to find and learn more about the models?

Re: Why are most climate models in Fortran?

#24

Engineers are horrified to learn that mathematical modeling is done in a language created in the 50s, but aren't bothered by the fact that the dominant computer interaction model used in the field right now dates back to pre-WW2 teleprinters. Someone is lacking in self- and historic awareness. What practical problems does Fortran cause when used for numerical computing?

Somebody should warn them about avoiding accidentally using Pythagoras theorem, that was introduced 2500 years ago.

Funny

Re: Why are most climate models in Fortran?

#25
post #5

Not only "climate models"... a large chunk of scipy is just a thin Python layer over decades-old Fortran code. That many physicists chose to use the real thing instead of the fisher-price interface speaks in favor of them.

Actually, as a user of the fisher-price interface, I'm glad that it can bind to C and FORTRAN libraries, so my numerics are based on the highest quality code.

Re: Why are most climate models in Fortran?

#26
post #17

Hint for commenters: Since Fortran 90, it's spelled Fortran, not FORTRAN. By using the latter you signal that your experience on the topic is from 30 years ago. https://en.wikipedia.org/wiki/Fortran#Fortran_90

But Fortran is case insensitive, so it should be no problem if you spell it Fortran or FORTRAN or fORtRaN.

Re: Why are most climate models in Fortran?

#27
I'm not familiar at all with the world of high performance scientific computing. Are C++, Rust, Nim, Zig, & co. even remotely considered as potential candidates in the future, or is it really only C and Fortran with no expectation to see much changes? Just curious.

Re: Why are most climate models in Fortran?

#28

Engineers are horrified to learn that mathematical modeling is done in a language created in the 50s, but aren't bothered by the fact that the dominant computer interaction model used in the field right now dates back to pre-WW2 teleprinters. Someone is lacking in self- and historic awareness. What practical problems does Fortran cause when used for numerical computing?

Somebody should warn them about avoiding accidentally using Pythagoras theorem, that was introduced 2500 years ago.

Unlike computer software, mathematical theorems don't suffer from bit rot.

Re: Why are most climate models in Fortran?

#29

Engineers are horrified to learn that mathematical modeling is done in a language created in the 50s, but aren't bothered by the fact that the dominant computer interaction model used in the field right now dates back to pre-WW2 teleprinters. Someone is lacking in self- and historic awareness. What practical problems does Fortran cause when used for numerical computing?

Or that the languages they use to express more important things that computer programs all date back much longer than that.

Re: Why are most climate models in Fortran?

#30
post #28

Earlier quoted context omitted.

Somebody should warn them about avoiding accidentally using Pythagoras theorem, that was introduced 2500 years ago.

Unlike computer software, mathematical theorems don't suffer from bit rot.

Neither do languages, especially formal ones.
Post reply on HN