One of the biggest challenges in protecting our groundwater is understanding where pollution comes from. The UPWATER project, which focuses on protecting and enhancing groundwater quality, has developed an innovative tool to tackle this issue: the SOUPY code. But what exactly is SOUPY, and how does it help us better manage our water resources? Let’s break it down.
What is SOUPY?
SOUPY (SOurce apportionment in a PYthon environment) is a newly developed code designed to improve the determination of groundwater contamination sources. It builds upon and enhances previous approaches, such as the widely used MIX+EMMA, which, despite its effectiveness, has notable limitations in handling large and complex datasets. Both MIX and SOUPY estimate the contribution of different water sources to groundwater by calculating their mixing percentages. However, MIX is constrained by a limited number of input data (e.g. parameters and observation points). SOUPY overcomes these restrictions by leveraging Python’s advanced computational capabilities, allowing for more flexible, efficient, and scalable analyses. It integrates modern data processing techniques, improving performance and usability while maintaining the robustness of traditional source apportionment models. This makes SOUPY a more powerful and adaptable tool for groundwater studies involving complex hydrochemical datasets. Nevertheless, since source apportionment is estimated based on mixing models, limitations due to hydrochemical processes that change the chemical composition of groundwater, must be evaluated in each particular case.
How does SOUPY work?

SOUPY is a key tool in the source apportionment method, that aims at identifying and quantifying the contributions of different pollution sources. Here’s a simplified version of how the source apportionment method works:
- Conceptual model: A hydrogeological conceptual model representing the key factors influencing the groundwater composition, mainly the recharge sources (so-called endmembers) and hydrochemical processes, is developed. In urban environments common endmembers are: river, urban runoff, sewer filtration, etc.
- Collection of data: Scientists collect and analyse water samples from groundwater (mixed water) and sources (e.g. river, road runoff, waste water leaks) and analyse their chemical composition, or compile data from literature.
- Mixing model: The contribution of each source (endmember) to the groundwater composition is estimated with the SOUPY code.
- Optimization process: SOUPY uses mathematical models to fine-tune the calculations, improving accuracy and reducing uncertainties.
Because SOUPY is built in Python, it can process more data than the previous source apportionment codes EMMA and MIX and adapt to new challenges by integrating additional analytical tools.
How is SOUPY used in UPWATER?
UPWATER is working to improve groundwater quality across 3 European regions, including the Besòs River Delta in Barcelona (Spain) and the Kifisos River in Athens (Greece). SOUPY, as the main tool used in the source apportionment, plays a key role by:
- Helping scientists identify pollution sources more precisely.
- Allowing researchers to track how contaminants move through groundwater systems.
- Providing insights that guide policy decisions and water management strategies.
The results from SOUPY will help local authorities take better actions to protect and restore groundwater quality, by acting on the pollution sources before entering into the aquifers.
Why is SOUPY important?
Groundwater is a crucial resource for drinking water, agriculture, and industrial purposes. The different uses that can be given to this resource depend mainly on its quality or degree of contamination. Understanding where pollution comes from (“source apportionment”) enables prevention of aquifer contamination with management measures, since prevention is always technically and economically more favourable than remediation when the water resource is already contaminated, contributing to a cleaner and safer water future.
The advancement of SOUPY over previous source apportionment codes lies in the fact that it can manage more than 15 chemical parameters, 10 recharge sources and 99 observations points in the calculations. This is crucial when dealing with complex datasets and to get more accurate and realistic results.
By comparing SOUPY and MIX across various models, we have evaluated the consistency, precision, and improvements offered by the new code, confirming its reliability for groundwater source apportionment. SOUPY has been successfully applied within the case studies of the UPWATER project, confirming its utility for more complex source apportionment scenarios. As the UPWATER project progresses, SOUPY will continue to be tested and refined in different locations. This innovative approach marks a significant step forward in the fight against water pollution and will support long-term sustainability in water management.