Parsing Fortran-77 with proprietary extensions (preprint)

Nuclear power plants generated 68% of France’s electricity in 2021, and Fortran is used for some of the underlying software.

The ESOPE / GEMAT language, developed by the CEA [French Alternative Energies and Atomic Energy Commission], is an extension of FORTRAN 77. ESOPE / GEMAT allows for dynamic memory management (not dynamic allocation, which is performed once for all). (source)

A new arXiv preprint discusses the modernization of Fortran 77 code with ESOPE extensions. Many compilers and tools are considered. Since FORTRAN 77 and FORTRAN IV were both widely used and lacking some important features, there were many languages built upon them.

Parsing Fortran-77 with proprietary extensions

by Younoussa Sow, Larisa Safina, Léandre Brault, Papa Ibou Diouf, Stéphane Ducasse, Nicolas Anquetil

Far from the latest innovations in software development, many organizations still rely on old code written in “obsolete” programming languages. Because this source code is old and proven it often contributes significantly to the continuing success of these organizations. Yet to keep the applications relevant and running in an evolving environment, they sometimes need to be updated or migrated to new languages or new platforms. One difficulty of working with these “veteran languages” is being able to parse the source code to build a representation of it. Parsing can also allow modern software development tools and IDEs to offer better support to these veteran languages. We initiated a project between our group and the Framatome company to help migrate old Fortran-77 with proprietary extensions (called Esope) into more modern Fortran. In this paper, we explain how we parsed the Esope language with a combination of island grammar and regular parser to build an abstract syntax tree of the code.

Nuclear power plants should truly be 100-X% of EU’s electricity now and every year going forward, followed by globally where X is a rather limited amount from other generation methods based on local solutions (hydroelectric, geothermal, solar, etc.). Alas, that may not be the case for a long time …

Let’s make sure to keep this thread about Fortran’s use in the nuclear energy industry, not about the merits and politics of nuclear energy.

3 Likes