Live data from Hacker News

Why are most climate models in Fortran?

partee.io

11–20 of 136 posts

Re: Why are most climate models in Fortran?

#11
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.

Gonum wraps the same code, from what i could tell fortran seem to have a neat way to handle more specialised number systems like dual numbers and hyperbolic numbers.

Re: Why are most climate models in Fortran?

#12
post #11
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.

Gonum wraps the same code, from what i could tell fortran seem to have a neat way to handle more specialised number systems like dual numbers and hyperbolic numbers.

You can do operator overloading in fortran to add a new number type, don't remember the details but I wrote a quaternion library once.

Re: Why are most climate models in Fortran?

#13
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 generation programmers that want to and are excited to develop in Fortran.

Re: Why are most climate models in Fortran?

#14
High performance scientific computing is very much still a FORTRAN, C, and C++ game. And of those, FORTRAN has some compelling advantages in terms of first-class built-in support for multidimensional arrays, and quite excellent compilers. And, as others have noted, until the `restrict` keyword in C99, there were optimizations in FORTRAN that were not even possible in C.

I mostly used C for my (small-scale) HPC work in grad school because it’s what I knew best, but at several points I wished I had learned Fortran instead.

Probably one of the only “higher level” languages that’s ever been used for serious petascale scientific computing is Julia (first with Celeste on the astro side, possibly soon with CliMA for climate modeling), which not coincidentally follows similar array indexing conventions as FORTRAN. And while that’s what I mostly use now, I don’t see Fortran going away any time soon.

If anything, with cool new projects like LFortran [1] making it possible to use Fortran more interactively, it’s probably quite a good time to learn modern Fortran!

[1] https://lfortran.org/

Re: Why are most climate models in Fortran?

#18

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…

It took until C99 for C to have complex numbers and `restrict`. Those are two features FORTRAN has had for a much longer time, right?

And like in everything C, unlike Fortran, there is no way for the compiler to validate if restrict is being used properly.

Use it wrong, break the compiler assumptions and the bug hunting fun starts.

Re: Why are most climate models in Fortran?

#19

How is Fortran coming along with GPUs? (last I looked it was being done with proprietary compiler language extensions, but that was a while ago) Are modern supercomputers faster than a cluster of consumer-grade GPU cards?

> Are modern supercomputers faster than a cluster of consumer-grade GPU cards?

On the top500 list, #1 does 400,000 TFlop/s, #500 does 1000 TFlop/s. How much would the kind of GPU cluster you're thinking of do?

https://www.top500.org/lists/top500/2020/11/

Re: Why are most climate models in Fortran?

#20
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?

Post reply on HN