You can contribute without implementing a new EOS. A clarified unit, a runnable example, a regression test, or an explanation of a contract that is currently only implied by the source are all useful contributions. For a first change, reproduce one existing example, identify one confusing or incorrect behavior, and keep the fix focused. Discuss a new model or a public interface change with maintainers before investing in its implementation.
This page covers how to contribute: which layer a change belongs to, how to build and test it, and how to write documentation that teaches. The developer handbook covers the codebase itself — the repository map, the Fortran contracts, the numerical algorithms, the language interfaces, and the detailed build and test procedures. Read that handbook for where things live and how the tooling is configured; read this page for what a good contribution looks like.
| Goal | Start here |
|---|---|
| Learn how a calculation is set up | example/basics/ and doc/page/usage/ |
| Add a thermodynamic equation | src/models/ and the new-model guides |
| Understand derivative checks | src/consistency/ and the existing model tests |
| Fix equilibrium behavior | Reduce the state first, then inspect src/equilibria/ and related tests |
| Improve user instructions | doc/page/, which becomes the FORD user guide |
| Explain a public routine’s contract | Documentation comments beside its declaration in src/ |
Read the actual interface and a current caller together. In particular, do not infer whether a binding is a function or a subroutine from its name: the hyperdual and Tapenade energy interfaces differ, and the Tapenade routines are subroutines with a strict argument order. Configuring an existing model is almost always preferable to introducing an unnecessary new type.
The architecture page maps each of these layers to the files that implement it.
Establish a working baseline first. An unchanged build and an unchanged example that runs tell you whether a later failure is yours.
From the repository root, a GNU-toolchain loop consistent with the CI
configuration in .github/workflows/CI.yml is:
fpm build --profile release --flag "-g -ffree-line-length-0" --compiler gfortran --c-compiler gcc
fpm run --example basics --profile release --flag "-g -ffree-line-length-0" --compiler gfortran --c-compiler gcc
fpm test --profile release --flag "-g -ffree-line-length-0" --compiler gfortran --c-compiler gcc
Run these sequentially, never as competing builds of the same tree. The
basics target is registered explicitly in fpm.toml; automatic example
discovery is disabled, so a file dropped into example/extra/ is not a
runnable target until it is registered. Compiler flags above are
GNU-specific, not a portable interface requirement.
Useful first diagnoses: a missing module during the first build usually means an earlier dependency or compiler failure, so read the first error rather than the last. Undefined BLAS or LAPACK symbols point at library installation and linking, not at thermodynamic algebra. Report compiler versions, flags, and the first failing command when asking for help.
The workflow page documents the dependencies, the separate Python build, the documentation build, and the pitfalls that cost time. The testing page shows how the tests are structured and how to add a standalone regression program.
Do not only demonstrate that a flash converges. For a model, check energy units and extensivity, derivatives against numerical differences, each optional output requested on its own, and the thermodynamic identities before testing any equilibrium calculation. Use physically meaningful states away from singularities first, and explain the tolerance you assert: compare quantities that carry the same units, and say whether the threshold is absolute or relative.
A regression test should fail for the original defect. If it passes both before and after your change, it is not testing the change. The testing handbook gives the standalone-program pattern and the tolerance rules used by the existing suite.
The Fortran documentation is generated by FORD. ford.md selects src/ for
API extraction, doc/page/ for guide pages, doc/media/ for assets, and
doc/ford_site/ for generated output. Edit the source Markdown and the
source comments, never the generated HTML. Preserve page names and anchors
where possible; the existing analtical.md spelling, for instance, is part of
the link structure of the guide.
With FORD and its rendering prerequisites installed (the documentation workflow installs Graphviz, Pandoc, and the Python packages), build from the repository root:
ford ford.md
Then open the generated page and read it. A zero exit status does not mean the
page is correct: check cross-references, mathematics, code blocks, tables,
navigation, and images, and read the generation warnings. An unresolved
[[symbol]] link is not repaired by ordinary Markdown rendering. Do not build
the documentation while another process is writing the same output tree.
The Python API has a separate Sphinx workflow driven by
.github/workflows/docs.yml; it is not rebuilt by FORD alone.
Use this sequence for a new guide or a substantial example:
Keep API comments and guide prose complementary. The API reference gives the exact arguments, ranks, optionality, and units of a routine; the guide explains why a reader would call it and how to interpret the answer. Describe why a numerical safeguard exists, not merely that the code contains one.
When a page needs to point at the implementation, link to the source path and to the developer handbook rather than repeating the codebase tour. A page should answer one reader’s question well.
New and modified declarations use one variable per line, so that each quantity can carry its own unit or physical meaning:
use yaeos, only: pr
implicit none
real(pr), intent(in) :: n(:) !! Component mole amounts [mol]
real(pr), intent(in) :: V !! Total volume [L], not molar volume
real(pr), intent(in) :: T !! Temperature [K]
real(pr), intent(out) :: P !! Pressure [bar]
real(pr) :: tol !! Absolute comparison tolerance [bar]
This is a declaration fragment inside a procedure, not a standalone program.
Do not group these as real(pr) :: n(2), V, T, P or integer :: i, j. The
style guide states the rule and its rationale.
For contribution policy and issue-reporting guidance, read the repository’s CONTRIBUTING.md. For a guided tour of the implementation, continue with the developer handbook.