Abstract
Large Language Models (LLMs) are increasingly being leveraged for generatingand translating scientific computer codes by both domain-experts and non-domainexperts. Fortran has served as one of the go to programming languages in legacyhigh-performance computing (HPC) for scientific discoveries. Despite growingadoption, LLM-based code translation of legacy code-bases has not beenthoroughly assessed or quantified for its usability. Here, we studied theapplicability of LLM-based translation of Fortran to C++ as a step towardsbuilding an agentic-workflow using open-weight LLMs on two differentcomputational platforms. We statistically quantified the compilation accuracyof the translated C++ codes, measured the similarity of the LLM translated codeto the human translated C++ code, and statistically quantified the outputsimilarity of the Fortran to C++ translation.