This guide details the coding standards, restart file specifications, testing frameworks, and integration guidelines for core developers maintaining or extending the solver.
real) or native double-precision (double precision).rk (real precision control parameter) from mod_precision and append _rk to numeric literals:
fortran
use mod_precision, only : rk
real(rk) :: temperature, density
temperature = 300.0_rkimplicit none at the top of every module and subroutine.Use private as the default module state, and explicitly declare public for variables, types, and subroutines exported in module interfaces:
```fortran
module mod_example
use mod_precision, only : rk
implicit none
private
public :: example_subroutine, example_type_t ! Module contents... end module mod_example ```
A common developer challenge is resuming a simulation using a restart file that has different species configurations (for example, booting up a 21-species reacting simulation from a 6-species cold mixing run).
The restart loader (mod_restart.f90) implements the Sub-selection Mismatch Rule:
* The Condition: The loader permits restarts when file_nspecies < params%nspecies.
* The Mapping: It maps overlapping indices up to file_nspecies from the file:
fortran
species%Y(1:min(file_nspecies, params%nspecies), :) = &
tmp_matrix(1:min(file_nspecies, params%nspecies), :)
* Zero-Initialization: The remaining intermediate species (indices file_nspecies + 1 to params%nspecies) are zero-initialized:
fortran
species%Y(file_nspecies+1:params%nspecies, :) = 0.0_rk
Since the newly introduced intermediate species are exactly , the simplex sum sum() remains mathematically , preventing mass conservation checks from crashing during startup.
Before committing code changes or merging branches:
bash
make CHEMISTRY_BACKEND=cantera
make CHEMISTRY_BACKEND=pelephysics CHEMISTRY_MODEL=drm19bash
./lowmach_react_hex cases/counterflow_reacting/case_nonreacting.nml
Audit diagnostics.csv to ensure total mass and energy conservation sum defects are bounded below .