Background

The Gorgon Global Magnetospheric model is a magneto-hydrodynamics (MHD) code, originally developed to solve laboratory plasma physics problems and developed by Prof Jeremy Chittenden. It comprises a Fortran simulation engine that  solves the resistive MHD equations on a regular cartesian grid, using finite volume methods, supports the use of MPI and has an established track record of running at scale on local HPC services. 

 Since its original inception, and as part of the research of Prof Jonathan Eastwood group, Gorgon has been adapted to solve space weather problems, from the interaction of the solar wind with the Earths magnetosphere to model Neptune's magnetosphere. It is intended that Gorgon will be used by the Met Office as part of a larger suite of forecasting tools. This requires that Gorgon is sufficiently performant for use in real time forecasting and user friendly for operation by non-developers. 

 On the other hand, Gorgon-Tools is a set of python modules for analysing the output of the Gorgon MHD code, simplifying its post processing and visualisation, and ultimately, facilitating the interpretation of the data. 

Our Contribution

The RSE team collaborated with Dr Mike Heyns to bring Gorgon-Tools up to modern software engineering standards, ensuring its sustainability in use and development as a research software. 

Our contributions started by integrating continuous integration tools and automating testing processes. This included setting up linters, like ruff, and fixing code violations to maintain high code quality. We updated and managed Python dependencies, ensuring compatibility and stability across different environments, using pip-tools to automate dependency updates and maintain a clean codebase. Comprehensive documentation was developed and we also added extensive tests, particularly for running notebooks. We improved the integration of the Fortran modules with Python by using the versatile, cross-platform build system Meson. 

These contributions have significantly enhanced Gorgon-Tools, making it a robust and user-friendly tool for analysing Gorgon MHD outputs.