A view from Ruthe Point on Rotoroa Island, looking southwest over the Hauraki Gulf. Image: RadishSlice, Wikimedia Commons

Modelling water quality in catchment of the Hauraki Gulf

"A welcome aspect was the very patient supportive approach of the consultants in training novice NeSI users to actually learn and use NeSI..."
The below case study shares some of the technical details and outcomes of the scientific and HPC-focused programming support provided to a research project through NeSI’s Consultancy Service.
This service supports projects across a range of domains, with an aim to lift researchers’ productivity, efficiency, and skills in research computing. If you are interested to learn more or apply for Consultancy support, visit our Consultancy Service page.


Research background

NIWA researchers Sandy Elliott and Linh Hoang are modelling the water quantity and quality of freshwater-marine systems. Their goal is to run the catchment model Soil Water Assessment Tool (SWAT) for the Hauraki Gulf catchment. SWAT is an open-source software written in Fortran and actively supported by the USDA Agricultural Research Service at the Blackland Research & Extension Center in Temple, Texas, USA. Currently, models with the detail and size expected for the Hauraki catchment cannot be run and calibrated well on a personal computer, so there is a need for a substantial speed-up, which could be achieved with the NeSI infrastructure. This is an important deliverable for the current NIWA SSIF project on integrated land-water modelling, being funded by the Freshwater Centre.

Project challenges

A calibration run involves executing hundreds of times a code using slightly different input parameters, and checking against observed data. Due to the size of the model setup, high performance computing is required to meet this challenge, yet there are no off-the-shelf open access tools to enable such runs. 

What was done

NeSI Research Software Engineers Alex Pletzer and Chris Scott helped the researchers set up an infrastructure (swatParallel: https://github.com/pletzer/swatParallel) allowing them to submit a large number of embarrassingly parallel jobs. SWAT code was recompiled and tested, the existing R-based code SWATplusR was set up as multiple parallel HPC tasks fed by user-defined parameter sets. The project also involved training novice NeSI users in running models on the HPC infrastructure.

Main outcomes

Calibration of a large catchment model setup using SWAT is now possible, meeting the key need of the modellers, and providing a step-change in the size of model that can be addressed.  A major outcome is that the turnaround time is no longer limited by the number of runs but, instead, by the number of available processors on the mahuika NeSI platform. With swatParallel, the researchers don’t have to wait for a large block of resources to become available, they can see their jobs running as soon as slots become available.


Figure: Modelled flow for different SWAT input parameters.

Figure: Modelled flow for different SWAT input parameters.


Researcher feedback

"The Consultancy Project provided invaluable support to achieve an excellent outcome. The project was done in a structured way, beginning with clear articulation of the project needs and required tasks. Regular meetings ensured that the work remained focussed and relevant, with course-corrections and extensions if needed. The consultants provided workable practical code. A welcome aspect was the very patient supportive approach of the consultants in training novice NeSI users to actually learn and use NeSI and improve their own software practices, such as use of Git, functional testing and setting up environments."
- Sandy Elliott, Principal Scientist - Catchment Processes, NIWA 

Next Case Study

Illustration of an electrocardiogram reading.

Hearts aflutter for pacemaker simulation

"This was my first time using the kind of HPC, so the support team helped a lot. I am very grateful for that."