Compiling SWAT+ with NetCDF and OpenMP
SWAT+ built from source at our production tag with gfortran, NetCDF and OpenMP, then one model run at one and at eight threads and its outputs compared.
1:37 · captions on by default
Transcript
Our compile page's steps, with gfortran as the compiler. First, clone our SWAT+ fork. Check out ship/v1.0-51.5, the tag our production engine is built from. Configure with gfortran and two switches: NetCDF output and OpenMP. Production builds with Intel's ifx. The build, sped up. The binary's name carries the tag, the compiler and the system. The run lines call ./swatplus, so the binary goes into the model's folder under that name. In print.prt, cdfout is the third value under the csvout header. Its y turns NetCDF output on. One of our own models, one simulated year, at one thread: the page's mode 1.
Then at eight threads, routing kept serial: mode 2. Both runs exit with code 0; the note is gfortran listing floating-point flags. diff sets aside simulation.out, which carries the clock, the end marker success.fin, and the NetCDF file. It prints nothing. Of the 136 files compared, the runs wrote 10, one of them empty in both. Each matches byte for byte. The NetCDF channel output matches byte for byte, and value for value: 0 differ. A gfortran build of our production tag, one model at one and at eight threads: the outputs match, apart from the clock.
Credits
The pictures replay a terminal session recorded on SWATGenX's own server on 2026-11-09; each character in the terminal session comes from the recording. The build is sped up and labelled on screen, and the cut holds frames still for the captions. The model is one of SWATGenX's own, with no customer data. SWAT+ model by USDA-ARS and Texas A&M AgriLife Research; engine source under LGPL-2.1. Narration: synthetic voice.
