Nov 4 – 5, 2025
Virtual
Europe/Zurich timezone
Final timetable has been published! Registration will close this Friday!

Compile-time unit checking in Fortran with genunits

Nov 5, 2025, 5:30 PM
20m
ZOOM (Virtual)

ZOOM

Virtual

Communications (15 + 5 minutes) Sessions

Speaker

Ben Trettel

Description

Automatic checking of the units in Fortran programs has long been proposed to catch bugs. Implementations have often been limited to test problems and not been applied in practice. Consequently, there has not been much practical experience with unit checking in Fortran. In this work, a compile-time unit checking approach has been developed with gennuits. genunits will generate a Fortran module with one derived type per unit. Valid operations between derived types/units are defined, leaving invalid operations undefined. Consequently, a units error will result in a compilation error. Some significant practical limitations of this approach to unit checking have been identified. Run-time performance can be significantly slower without inlining. Compilation can become far slower or even impossible, and genunits has been designed specifically to help mitigate this problem by generating only necessary derived types. Compiler error messages also can be unclear as they were not written with this application in mind. It is hoped that the identified issues can be mitigated in future Fortran language and compiler developments.

Author

Presentation materials

There are no materials yet.