FLIT: A Generic Fortran Library based on Interfaces and Templates

This is a new project I came across, by Kai Gao of LANL, documented here.

We develop a generic Fortran library, FLIT (Fortran Library based on Interfaces and Templates), to provide a number of useful functionalities for computational geophysics and beyond. These functionalities include several single/multi-dimensional array manipulation functions/subroutines, flexible parameter reading from textual file or command line arguments, signal and image filtering and processing, integral transforms, interpolation, statistical functions, and so on. These functionalities are not intrinsically available in the current Fortran standard. The most notable feature of FLIT is that we provide user-friendly interfaces for similar functionalities with different data types, attempting to demonstrate the possibility of accelerating scientific application development using modern Fortran. The package can be used as a robust Fortran library for developing sophisticated scientific applications in the fields of computational physics, computational and applied geophysics, signal and image processing, and so on.

The work was supported by Los Alamos National Laboratory (LANL) Laboratory Directory Research and Development (LDRD) project 20240322ER.

Currently, FLIT only supports Intel’s compiler suite (ifort, icx, icpx, and mpiifort) on Linux platform. We tested FLIT with ifort 2021.10, icx 2023.2, icpx 2023.2; compilers of higher versions should work. At this moment, we do not have a clear timeline to make it fully compatible with GNU’s compiler suite due to a number of nontrivial differences in these two compiler suites.

3 Likes

A lot of the generic facilities supported by FLIT may find value in Fortran stdlib and become generally valuable for Fortran users.

3 Likes

Fortran is LANL’s guilty pleasure.

7 Likes

LANL has several people working on automated translation of Fortran to C++ using LLMs:

Enhancing Code Translation in Language Models with Few-Shot Learning via Retrieval-Augmented Generation
by Manish Bhattarai et al.

Extensive experiments on diverse datasets with open LLM models such as Starcoder, Llama3-70B Instruct, CodeLlama-34B Instruct, Granite-34B Code Instruct, and Mixtral-8x22B, as well as commercial LLM models like GPT-3.5 Turbo and GPT-4o, demonstrate our approach’s superiority over traditional zero-shot methods, especially in translating between Fortran and CPP.

If the existence of such tools lets scientists and engineers program in Fortran while getting the IT department off their backs, they may reduce an obstacle to using Fortran. This could be wishful thinking.

1 Like