Why are Climate models written in programming languages from 1950?

The Global Forecasting System (GFS) is written at least partially in Fortran, and it looks like relatively clean modern Fortran.

Example Source: https://www.nco.ncep.noaa.gov/pmb/codes/nwprod/gfs.v16.0.8/sorc/global_chgres.fd/nstio_module.f90

Of course, browsing through the source, there is also definitely some really old stuff in other files as well.

Overall Source: Index of /pmb/codes/nwprod/gfs.v16.0.8

Sadly, these links will be broken in the future, as they appear to delete old versions as new ones come out. Just realized my bookmarks to v16.0.7 were broken.

NOAA upgrades Global Forecast System to get more weather data
By Tom Temin
Federal News Network
March 31, 2021 10:20 am
9 min read

Tom Temin: Tell us the model that we’re talking about? Because I think NOAA has several weather models. Which one are we talking about here?

Dr. Vijay Tallapragada: Yeah, what we are talking about is the flagship American model. The colloquial name of the Global Forecast System. This is the mother of all models that weather service operates because it impacts almost every other modeling system that NOAA operates for various applications. So this is kind of a major upgrade that we do every two or three years. And the Global Forecast System, the GFS version 16, is the latest incarnation of that cycle of upgrades.

Tom Temin: And a model is a piece of software, correct? Tell us more about the size of it, what language it’s programmed in, and how it all exists.

Dr. Vijay Tallapragada: So these are the physical process in the atmospheric system coded into computer software, which is largely built upon Fortran 95. This is probably the only industry that still uses Fortran as a programming language. Although we added more object oriented programming into Fortran. And these cords are kind of 100,000-200,000 lines of codes. They run on powerful supercomputers, and they are integrated forward in time to predict what happens next. And in order to do that, you need to have initial conditions. That means what is at present happening in the world. And in order to do that, we collect all the data that we can, either from satellites, that remote sensing that send us billions of data points. We also have conventional data like the radio signs of balloons, the surface weather stations, the drop sounds from aircraft, and all aircraft data, and some commercial data. So they all are processed to create a model compatible initial conditions, or we call it analysis. Analysis is kind of a representation of the truth. And using that analysis as a starting point, the software that we wrote, the Global Forecast System software, forwards these data sets into time. And that is resulted in a forecast. And we call it loosely a forecast, but it is a guidance, the model provides guidance, it doesn’t give you a forecast. So the model provides products that can be interpreted to make a forecast. And the model is integrated out to 16 days, four times a day. So the model is updated every six hours predicting the weather across the globe 16 days out every time.

NOAA is on GitHub.

1 Like

Finally, Fortran is not the only standardized language: C language is also standardized, and Cobol, etc. I don’t know if it is only perennial languages which are standardized or if there is also young languages…

C# seems to be one (relatively young) language that has international standards.

But looking at this history table in the Wikipedia page,

it seems apparent that standardization takes a long time to catch up with the latest release available (e.g. C# 9.0).

1 Like

F’2008 introduced DO CONCURRENT as a serial construct(!) and pointer-valued functions as variables (still buggy or unimplemented in most compilers).

I feel it not very good that a parallel(-like?) syntax like FORALL and DO CONCURRENT are not working in a parallel way, because (as far as I understand) various array features in Fortran are designed with parallel execution in mind (e.g. whole-array operation). Although OpenMP gives threading, Fortran itself does not provide threading capability (except for vendor-specific extensions). I think this is in contrast to other languages that have native threading supports.

RE pointer-valued functions, I tried this several times, but still not successful (if I remember correctly…)

any design issues discovered by the first implementations won’t be correctable because the problems will have been already baked into the document.

I’m wondering if this is also the case for other languages with international standards (e.g. C++)? I remember having seen sentences like “the behavior of blah blah was changed from X to Y in xxx (because of ZZZ issues)”, e.g. in cppreference.com (though I do not remember which page exactly…). I understand that backward compatibility is important, but it seems to have strong pros & cons.

2 Likes

Interesting, C# uses a mixed solution: classical versioning, plus standardization once in a while.

Some commercial companies highly regard Fortran
VORtech

2 Likes

At the Fortran Wiki there is a section

Fortran Advocacy and Language Comparisons (reverse chronological order)

2 Likes