Kia ora/Hello,
I’ve spent rather too long modernising SLATEC to free-form Fortran 2018 with proper module structure. It builds with CMake and fpm (woohoo!).
The original had about 8,300 GOTOs. It now has 27. The remaining ones are in MINPACK and they looked at me funny, so I left them for now. Everything else has been converted to state machines, DO/EXIT loops, or BLOCK constructs depending on what the original control flow was trying to do.
Arithmetic IFs are gone, INTENT attributes are in, and the whole thing is organised into modules (special_functions, linear, diff_integ, interpolation, and so on).
COMMON blocks in SLAP still need converting to module variables, and some EXTERNAL declarations want proper procedure interfaces. Contributions welcome if anyone fancies it but I’ll continue working on this too.
For numerical verification I tested against Abramowitz & Stegun and NIST DLMF reference values. I also ran a subset of routines on an emulated IBM System/360 via Hercules/TK4- using the original FORTRAN G (1966) and H (1969) compilers. SLATEC was finished in 1993, but it was written conservatively enough that compilers predating it by 27 years still compile the code cleanly. The results match (which is amazing!). That’s 60 years of backwards compatibility in action.
Credit goes to Mehdi Chinoune and Jacob Williams (to name a few). I built on top both of their wonderful work, this would’ve been so much harder to do if it wasn’t for them.
Repo: GitHub - Zaneham/SLATEC
IBM/360 toolchain: GitHub - Zaneham/Fortran360
Hope you all enjoy your holidays and have a happy new year.