Live data from Hacker News

Why are most climate models in Fortran?

partee.io

31–40 of 136 posts

Re: Why are most climate models in Fortran?

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

Interesting... iOS will autocorrect to “FORTRAN”

Re: Why are most climate models in Fortran?

#32
post #15

Why doing the examples in Fortran 90 in 2021 blog post, when 2018 is the most recent standard revison?

I'm not an expert in Fortran, but my understanding is that Fortran 90 is basically the equivalent of C++11--it added a slew of major features (such as free format code and array notation) that makes it a pretty different language from pre-90 code. Even if newer language revisions add some more useful features, it's the core set from Fortran 90 that's worth differentiating, much as I might describe modern C++ code as C++11 even if the project requires C++14 or C++17.

Re: Why are most climate models in Fortran?

#33
post #15

Why doing the examples in Fortran 90 in 2021 blog post, when 2018 is the most recent standard revison?

I don't think it would look different. There is a big difference between Fortran 77 and Fortran 90, but less between Fortran 90 and Fortran 2018, at least for this example.

Re: Why are most climate models in Fortran?

#34

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?

> 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)

There is support for CUDA in Fortran. In fact, Nvidia purchased one of the main Fortran compiler vendors (PGI) and is open sourcing their compiler as flang.

CUDA is the predominant GPU programming model in the HPC space. There are open standards, but they are nowhere nearly as widely used.

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

Fundamentally, supercomputers use the same processors and GPUs that you find in consumer hardware. The differences tend to lie in A) the sheer quantity of hardware used (think millions of cores for Top 10 systems), B) high bandwidth, low latency interconnects and C) some market segmentation by hardware vendors (e.g. Nvidia deliberately limits the double-float performance of consumer hardware)

Re: Why are most climate models in Fortran?

#35

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?

[deleted]

Re: Why are most climate models in Fortran?

#36
post #15

Why doing the examples in Fortran 90 in 2021 blog post, when 2018 is the most recent standard revison?

I'm not an expert in Fortran, but my understanding is that Fortran 90 is basically the equivalent of C++11--it added a slew of major features (such as free format code and array notation) that makes it a pretty different language from pre-90 code. Even if newer language revisions add some more useful features, it's the core set from Fortran 90 that's worth differentiating, much as I might describe modern C++ code as…

This is absolutely correct - Fortran standards after 90/95 have mostly added extra features, rather than fundamental changes to how people write Fortran. Fortran 2003 added OO support, but I don’t believe that has seen widespread adoption.

Re: Why are most climate models in Fortran?

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

I'm also a very happy user of the dumbed-down interfaces. But I find it strange when my fellow users are surprised or even horrified at the fact that some people still write and maintain Fortran and C code. Hell the Python interpreter they use is written in C! But apparently if you write in C you are some sort of old man yelling at clouds.

Re: Why are most climate models in Fortran?

#38
C and C++ are definitely the competitors to Fortran; not Chapel or Python. In the life sciences, large amounts of Fortran code has been rewritten in C/C++. But they have orders of magnitude more funding than climate science and teams of professional programmers to maintain the code.

Fortran is a domain-specific language for scientists, and excels at array arithmetic (for graph-based problems though, maybe look elsewhere). Even badly-written code can run reasonably fast, which is not the same for C/C++. There is also the decades of concerted hardware and compiler optimizations that make Fortran hard to beat on HPC systems.

It's not as readable as Python, but it's more readable than C/C++ written by a professional programmer.

Re: Why are most climate models in Fortran?

#39
post #36

Earlier quoted context omitted.

I'm not an expert in Fortran, but my understanding is that Fortran 90 is basically the equivalent of C++11--it added a slew of major features (such as free format code and array notation) that makes it a pretty different language from pre-90 code. Even if newer language revisions add some more useful features, it's the core set from Fortran 90 that's worth differentiating, much as I might describe modern C++ code as…

This is absolutely correct - Fortran standards after 90/95 have mostly added extra features, rather than fundamental changes to how people write Fortran. Fortran 2003 added OO support, but I don’t believe that has seen widespread adoption.

Fortran 2003 also added BIND(C) and ISO_C_BINDING, which are massively useful in standardizing the C interop.

Re: Why are most climate models in Fortran?

#40
TFA would seem more reliable if it didn't have such a needlessly obscurantist Fortran-python code comparison. Nothing about the two languages calls for different base case logic! That is, in order to prevent confusion, the "Python3" code should have been this:

  def fibonacci(n):
    if n 
Post reply on HN