These instructions guide AI code reviewers (GitHub Copilot, CodeRabbit, Qodo, Cubic, CodeAnt, etc.) when evaluating pull requests in this repository.
Coding standards, common pitfalls, and contribution guidelines: docs/documentation/contributing.md
GPU macro API reference: docs/documentation/gpuParallelization.md
Formatting and linting are enforced by pre-commit hooks. Focus review effort on correctness, not style.
- Project: MFC (exascale many-physics solver) written in modern Fortran 2008+, preprocessed with Fypp.
- Directory layout:
- Sources in
src/, tests intests/, examples inexamples/, Python toolchain intoolchain/. - Most source files are
.fpp(Fypp templates); CMake transpiles them to.f90.
- Sources in
- Fypp macros are in
src/<subprogram>/include/, where<subprogram>issimulation,common,pre_process, orpost_process. - Only
simulation(plus itscommondependencies) is GPU-accelerated via OpenACC or OpenMP target offload (--gpu accor--gpu mp). GPU code uses backend-agnosticGPU_*Fypp macros (insrc/common/include/parallel_macros.fpp) that dispatch to the correct backend at compile time. - Code must compile with GNU gfortran, NVIDIA nvfortran, Cray ftn, and Intel ifx.
- Precision modes: double (default), single, and mixed (
wp= working precision,stp= storage precision). - Python toolchain requires Python 3.10+ — do not suggest
from __future__imports or other backwards-compatibility shims.
See the Common Pitfalls section of docs/documentation/contributing.md for the full reference. Key review priorities:
- Correctness over style — logic bugs, numerical issues, array bounds (non-unity lower bounds with ghost cells)
- Precision mixing —
stpvswpconversions, no double-precision intrinsics (dsqrt,dble,real(8), etc.) - Memory —
@:ALLOCATE/@:DEALLOCATEpairing, GPU pointer setup (@:ACC_SETUP_VFs/@:ACC_SETUP_SFs) - MPI — halo exchange pack/unpack offsets,
GPU_UPDATEaround MPI calls, buffer sizing - GPU — no raw OpenACC/OpenMP pragmas (use Fypp GPU macros),
private(...)on loop-local variables, nostop/error stopin device code - Physics — pressure formula must match
model_eqns,case_validator.pyconstraints for new parameters - Compiler portability — all four compilers, Fypp macros for GPU and CPU builds
src/common/blast radius — changes affect all three executables
Flag these patterns when reviewing a pull request:
- PR adds a parameter in
toolchain/mfc/params/definitions.pybut does not update thenamelist /user_inputs/insrc/*/m_start_up.fppor declare it insrc/*/m_global_parameters.fpp - PR adds a parameter with cross-parameter constraints but does not add validation in
toolchain/mfc/case_validator.py - PR modifies files in
src/common/but does not mention testing all three targets (pre_process, simulation, post_process) - PR adds
@:ALLOCATEcalls without matching@:DEALLOCATEin the corresponding finalization subroutine - PR renames or moves files referenced in
docs/documentation/contributing.mdordocs/documentation/gpuParallelization.mdwithout updating those docs - PR adds a new
.fppmodule missingimplicit noneor missingprivate/publicdeclarations - PR modifies MPI pack/unpack logic in one sweep direction without updating all directions
- PR adds a new physics feature or model without a corresponding regression test