Live data from Hacker News

Why are most climate models in Fortran?

partee.io

41–50 of 136 posts

Re: Why are most climate models in Fortran?

#41

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?

I __think__ Fortran just never gave you this particular footgun. No aliasing of pointers allowed from the getgo. It was never an issue. Somebody let me know if that is wrong.

I read Complex numbers came in FORTRAN IV, so mid 60’s.

I never used anything older than FORTRAN 77, and it certainly had complex numbers, and also ways for the “inventive” programmer to make use of pointer like functionality. You could e.g. pass functions to functions, if you were so inclined.

Re: Why are most climate models in Fortran?

#42
post #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.

C++ sees a fair amount of use and has some mature libraries written in it like the trilinos collection alongside being able to use existing C libraries. I think for other languages the limiting factor is the maturity of their linear algebra libraries and if someone has written bindings to use MPI

Re: Why are most climate models in Fortran?

#43

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?

Switching to any sort of commercial grid or cloud computing setup would be rather complicated by the fact that climate models are critically dependent on the fast, low-latency interconnects (e.g., infiniband) of a proper HPC system to achieve good performance at scale. This is usually coordinated with hand-written message passing via MPI directly in the relevant top-level Fortran (or C/++) program.

There are some other (i.e, “embarrassingly parallel”) scientific computing problems where a higher-latency distributed setup would be fine, but in climate models, as in any finite-element model, each grid cell needs to be able to “talk to” its neighbors at each timestep, leading to quite a lot of inter-process communication.

Re: Why are most climate models in Fortran?

#44
Fortran is hot at the moment :-) See "Resurrecting Fortran" (blog post by Ondřej Čertík https://news.ycombinator.com/item?id=26445438 https://ondrejcertik.com/blog/2021/03/resurrecting-fortran/ ) about the promising Fortran "standard lib" and the Fortran community in general (see the related website https://fortran-lang.org/ ). The story here is interesting but lacks a bit about this wider context.

Re: Why are most climate models in Fortran?

#45
post #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.

C++ is widely used for High Energy Physics. The ROOT framework [0], developed at CERN, is mostly C++.

I'd be tempted to say that Rust could be used as well, but the equivalent of MPI and OpenMP for Rust is still not as fast as in C++/C/Fortran.[2] That's easy to understand: there are decades of investment in MPI/OpenMP for C/C++/Fortran, and Rust is not there yet.

Also, in some cases where high throughput is needed, languages with garbage collector are not suited. In this scenario, deterministic execution time and deterministic latency are very important. Not directly related to HPC, but Discord migrated from Go to Rust for this reason[2].

[0] https://root.cern/

[1] https://github.com/trsupradeep/15618-project

[2] https://blog.discord.com/why-discord-is-switching-from-go-to...

Re: Why are most climate models in Fortran?

#46

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?

Difficult to run true HPC software like this as a 'grid'. High speed, low latency communication (with MPI) is required.

Re: Why are most climate models in Fortran?

#48

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 i…

[deleted]

Re: Why are most climate models in Fortran?

#49
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

>it's spelled Fortran, not FORTRAN. By using the latter you signal that your experience on the topic is from 30 years ago.

Excellent idea to help filter out those having the lesser number of decades experience.

Re: Why are most climate models in Fortran?

#50

Earlier quoted context omitted.

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 la…

I guess the downvotes and this reply indicate I was unclear or wrong, but I can't tell how. I guess suggesting that the rest of us can learn from Fortran is disrespectful to it, which means I'm not interested.
Post reply on HN