preserf is a Python preprocessor that expands !$SER directives in Fortran
source into explicit serialization calls.
The repository contains two main pieces:
src/preserf/: the preprocessor engine and CLI.src/preserf-fortran/: Fortran helper modules that provide the runtime API targeted by generated code.
- Parses
!$SERdirectives using a two-pass analysis/generation model. - Injects the required
USEimports and guarded serialization blocks. - Expands directives such as
INIT,SAVEPOINT,DATA,REGISTER, and related forms into Fortran API calls. - Supports CLI processing of single files or directory trees.
pixi run test-py: run the fast Python test suite.pixi run test-all: run the Python suite, the native Fortran ctest suite, and every example.pixi run lint: run static checks.pixi run fmt: apply formatting.pixi run verify: run the full verification gate (fmt-check + lint + typecheck + Python tests + Fortran build/ctest).
- Project architecture overview: docs/architecture.md
- Directive grammar and expansion contract: docs/references/directives_specification.md
- Storage model mapping: docs/references/storage_mapping.md
- Fortran runtime helpers and compatibility details: src/preserf-fortran/README.md
- Testing strategy: docs/testing.md
- Code style guide: docs/style.md
- Architecture decision records: docs/adr/README.md