The diathermohaline stream function method for investigating the water mass transformation of the global ocean circulation (v2026.1)
Abstract. In this work, we present a source code for computing the diathermohaline stream function, enabling the analysis of Water Mass Transformation from gridded ocean data within the thermohaline framework. This implementation extends previous versions by increasing the precision of the projection from geographical to thermohaline space. Using Helmholtz decomposition, the stream function represents the rotational component of thermohaline transformation vectors, while the divergent component defines the tendency potential. We show that the dominant global driver of the tendency potential is the net freshwater imbalance across the ocean boundary. Together, the tendency potential and the diathermohaline stream function provide a powerful yet underutilized method for comparing global Water Mass Transformation across ocean models. We demonstrate the utility of this framework using data from a coupled climate model, hindcast simulations, and an ocean reanalysis product, all based on the NEMO ocean model and spanning multiple spatial resolutions. The implementation is modular and user friendly, facilitating straightforward application to a wide range of oceanographic data sets. The code can also be applied to study water mass transformation using any tracer coordinates and to compute the meridional overturning stream function for generalised coordinates.