Skip to content

Source reference

The authoritative API reference for the SWAT+ Fortran source is generated by FORD and published at:

https://swat-model.github.io/swatplus

That site contains:

  • Every module, derived type, subroutine, and function declared in swatplus/src/.
  • Call and caller graphs.
  • Source-listing pages for each .f90 file.
  • The leading comment block of every routine, indexed and searchable.

FORD reads the Fortran source directly. Whatever is in the source is reflected on the site; the docs do not duplicate this information.

How it is built

The FORD configuration lives in ford.md in the root of the SWAT+ source repository. Excerpt:

project: SWAT+
output_dir: /drive/c/repositories/swatplus/build/doc
src_dir: src
version: <git describe>
graph: true
coloured_edges: true

ford.md.in is the template; CMake substitutes the version from git describe and writes the resolved ford.md. The build command is:

ford ford.md

The resulting HTML tree is published from the gh-pages branch by a GitHub Action.

When to use FORD vs this site

  • Use swatplus.com for the input file formats, output file formats, theory, calibration workflow, and how to run the model.
  • Use the FORD site when you need to know what a specific subroutine does, what types a routine reads and writes, or where in the call tree a given variable is touched. It is the right place to start before modifying SWAT+ source.