Skip to content

Contributing

Repositories

Questions about using the model are best asked through the SWAT support page.

Reporting a problem

Open an issue with:

  • the SWAT+ version (shown in the banner at start-up and in the executable name);
  • the operating system and, for your own builds, the compiler;
  • a project that shows the problem, as small as possible (one of the refdata datasets with the changes that cause it is ideal);
  • simulation.out and diagnostics.out from the run.

Contributing code

  1. Fork swat-model/swatplus and create a branch from main with a descriptive name (fix-aquifer-init, add-soil-temp-output).
  2. Build and run your change on the reference datasets before opening a pull request. See Build with CMake and Testing.
  3. Open a pull request against main. Describe what the change does and why, which datasets you ran and how their outputs changed, and any change to input or output files.
  4. Answer review comments on the same branch.

Reviewers look for:

  • a clean build with gfortran and the Intel compilers;
  • unchanged outputs for parts of the model the change does not touch;
  • defaults for new parameters that keep existing results when the parameter is not set;
  • input file changes matched by a SWAT+ Editor change or a note on how to update existing projects;
  • code that follows the coding conventions.

Contributing to the documentation

The documentation is a MkDocs site in the swatplus-documentation repository. Each page states the SWAT+ commit it was checked against in its front matter (verified_at_commit), and every statement about model behaviour should come from the source at that commit. Page bodies are written for model users; source file names and variable names go in the collapsed Sources block at the end of each page (??? quote "Sources").

To check a change locally:

pip install -r requirements.txt
mkdocs serve

The site is versioned with mike. Pushing a tag to the documentation repository, named after the SWAT+ version the pages describe (for example 62.0.1), publishes that version and moves the latest alias to it. Earlier versions stay available from the version selector.

Sources