Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
4d9aeb8
remove dead code: bubble/QBMM, probe/integral I/O, unused indices and…
sbryngelson Apr 2, 2026
6fe68c1
remove IC perturbation infrastructure, fluid_pp%G, and 2D Fourier patch
sbryngelson Apr 2, 2026
87be218
remove github
sbryngelson Apr 2, 2026
96e5e25
apply Fortran formatter
sbryngelson Apr 2, 2026
6df3af2
rename mfc to figr throughout codebase
sbryngelson Apr 2, 2026
6669b92
remove --no-mpi option: MPI is always required
sbryngelson Apr 2, 2026
06f5770
remove dead code: bubble/chemistry leftovers, unused helpers and cons…
sbryngelson Apr 2, 2026
bd70f1c
add packer module for test golden-file comparison
sbryngelson Apr 2, 2026
397813f
clean
sbryngelson Apr 2, 2026
018d51d
clean
sbryngelson Apr 2, 2026
9357c50
remove spelling, lint, precheck commands and pre-commit hook
sbryngelson Apr 2, 2026
49820cc
remove dead code: weno_Re_flux, null_weights, GRCBC fields, unused MP…
sbryngelson Apr 2, 2026
2d8b5fd
remove dead CI scripts, configs, and fix MFC branding in toolchain
sbryngelson Apr 2, 2026
1225963
remove dead WENO/MUSCL/TENO scheme flags and unused FD divergence
sbryngelson Apr 2, 2026
3551b9d
fix packer module: rename pack.py to packer.py to match import path
sbryngelson Apr 2, 2026
5d26f93
remove dead WENO/MUSCL/TENO flags, fix Phoenix template MPI launch
sbryngelson Apr 2, 2026
59ba3ce
fix test cases: use upstream MFC Sod shock tube configuration
sbryngelson Apr 2, 2026
ff437be
fix CI: remove --mpi flag from workflow, drop gcov and fastmath options
sbryngelson Apr 2, 2026
fc4c206
fix CI: restore env: block for PRECISION variable
sbryngelson Apr 2, 2026
416ed1e
remove doxygen, dead WENO/MUSCL/TENO vars, cf_val, FD divergence
sbryngelson Apr 2, 2026
6b886bc
fix CI: free disk before NVHPC docker pull, use long-lived container
sbryngelson Apr 2, 2026
1b16aa2
rename mfc to figr throughout codebase (final sweep)
sbryngelson Apr 2, 2026
fce1007
rename MFC_ preprocessor defines to FIGR_
sbryngelson Apr 2, 2026
ca53048
fix packer: read .dat files as text, not binary
sbryngelson Apr 2, 2026
60e4b98
Merge branch 'main' into remove-dead-code
sbryngelson Apr 2, 2026
2c0b7ae
condense code: remove always-true conditionals and dead branches
sbryngelson Apr 2, 2026
a9fd6ad
remove dead constants and stale variables
sbryngelson Apr 2, 2026
f1a5ae3
fix GPU build: remove empty GPU_UPDATE() left from shear_stress removal
sbryngelson Apr 3, 2026
e963da7
fix modules: rename MFC_CUDA_CC to FIGR_CUDA_CC
sbryngelson Apr 3, 2026
5f4b634
rename remaining MFC references to FIGR/Figr
sbryngelson Apr 3, 2026
e2076cf
fix GPU build: add num_vels to GPU_DECLARE, rename remaining mfc refs
sbryngelson Apr 3, 2026
fb32636
clean
sbryngelson Apr 3, 2026
a0d1d49
clean toolchain: remove dead bubble/lagrange code and stale tolerance…
sbryngelson Apr 4, 2026
48e7cc6
port IGR User Guide features from MFlowCode/MFC#1346
sbryngelson Apr 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions .claude/rules/common-pitfalls.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,20 @@
- Fypp macros must expand correctly for both GPU and CPU builds

## Test System
- Tests are generated **programmatically** in `toolchain/mfc/test/cases.py`, not standalone files
- Tests are generated **programmatically** in `toolchain/figr/test/cases.py`, not standalone files
- Each test is a parameter modification on top of `BASE_CFG` defaults
- Test UUID = CRC32 hash of the test's trace string; `./mfc.sh test -l` lists all
- Test UUID = CRC32 hash of the test's trace string; `./figr.sh test -l` lists all
- To add a test: modify `cases.py` using `CaseGeneratorStack` push/pop pattern
- Golden files: `tests/<UUID>/golden.txt` — tolerance-based comparison, not exact match
- If your change intentionally modifies output, regenerate golden files:
`./mfc.sh test --generate --only <affected_tests> -j 8`
`./figr.sh test --generate --only <affected_tests> -j 8`
- Do not regenerate ALL golden files unless you understand every output change

## PR Checklist
Before submitting a PR:
- [ ] `./mfc.sh format -j 8` (auto-format)
- [ ] `./mfc.sh precheck -j 8` (5 CI lint checks)
- [ ] `./mfc.sh build -j 8` (compiles)
- [ ] `./mfc.sh test --only <relevant> -j 8` (tests pass)
- [ ] `./figr.sh format -j 8` (auto-format)
- [ ] `./figr.sh build -j 8` (compiles)
- [ ] `./figr.sh test --only <relevant> -j 8` (tests pass)
- [ ] If adding parameters: all 4 locations updated
- [ ] If modifying `src/common/`: all three targets tested
- [ ] If changing output: golden files regenerated for affected tests
Expand Down
6 changes: 3 additions & 3 deletions .claude/rules/fortran-conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ Every Fortran module follows this pattern:

## Forbidden Patterns

All checks below are enforced by `python3 toolchain/mfc/lint_source.py`
(runs via `./mfc.sh precheck` and CI). See that file for the full list.
All checks below are enforced by `python3 toolchain/figr/lint_source.py`
(runs via `./figr.sh precheck` and CI). See that file for the full list.

Fortran/Fypp source (`src/`):
- `dsqrt`, `dexp`, `dlog`, `dble`, `dabs`, `dcos`, `dsin`, `dtan`, etc. → use generic intrinsics
Expand Down Expand Up @@ -53,7 +53,7 @@ Enforced by convention/code review (not automated):
## Error Checking Macros (from macros.fpp)
- `@:PROHIBIT(condition, message)` — Runtime constraint check; aborts with file/line info
- `@:ASSERT(predicate, message)` — Invariant assertion; aborts if predicate is false
- `@:LOG(expr)` — Debug logging, active only in `MFC_DEBUG` builds
- `@:LOG(expr)` — Debug logging, active only in `FIGR_DEBUG` builds
- Fortran-side runtime validation also exists in `m_checker*.fpp` files using `@:PROHIBIT`

## Precision Types
Expand Down
34 changes: 17 additions & 17 deletions .claude/rules/gpu-and-mpi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@

Only `src/simulation/` is GPU-accelerated. Pre/post_process run on CPU only.

MFC uses a **backend-agnostic GPU abstraction** via Fypp macros. The same source code
figr uses a **backend-agnostic GPU abstraction** via Fypp macros. The same source code
compiles to either OpenACC or OpenMP target offload depending on the build flag:

- `./mfc.sh build --gpu acc` → OpenACC backend (NVIDIA nvfortran, Cray ftn)
- `./mfc.sh build --gpu mp` → OpenMP target offload backend (Cray ftn, AMD flang)
- `./mfc.sh build` (no --gpu) → CPU-only, GPU macros expand to plain Fortran
- `./figr.sh build --gpu acc` → OpenACC backend (NVIDIA nvfortran, Cray ftn)
- `./figr.sh build --gpu mp` → OpenMP target offload backend (Cray ftn, AMD flang)
- `./figr.sh build` (no --gpu) → CPU-only, GPU macros expand to plain Fortran

### Macro Layers (in src/common/include/)
- `parallel_macros.fpp` — **Use these.** Generic `GPU_*` macros that dispatch to the
correct backend based on `MFC_OpenACC` / `MFC_OpenMP` compile definitions.
correct backend based on `FIGR_OpenACC` / `FIGR_OpenMP` compile definitions.
- `acc_macros.fpp` — OpenACC-specific `ACC_*` implementations (do not call directly)
- `omp_macros.fpp` — OpenMP target offload `OMP_*` implementations (do not call directly)
- OMP macros generate **compiler-specific** directives: NVIDIA uses `target teams loop`,
Expand Down Expand Up @@ -88,24 +88,24 @@ AMD flang is additionally supported for GPU builds but not in the CI matrix.

## Preprocessor Defines (`#ifdef` / `#ifndef`)

Raw `#ifdef` / `#ifndef` preprocessor guards are **normal and expected** in MFC.
Raw `#ifdef` / `#ifndef` preprocessor guards are **normal and expected** in figr.
They are NOT the same as raw `!$acc`/`!$omp` pragmas (which are forbidden).

Use `#ifdef` for feature, target, compiler, and library gating:

### Feature gating
- `MFC_MPI` — MPI-enabled build (`--mpi` flag, default ON)
- `MFC_OpenACC` — OpenACC GPU backend (`--gpu acc`)
- `MFC_OpenMP` — OpenMP target offload backend (`--gpu mp`)
- `MFC_GPU` — Any GPU build (either OpenACC or OpenMP)
- `MFC_DEBUG` — Debug build (`--debug`)
- `MFC_SINGLE_PRECISION` — Single-precision mode (`--single`)
- `MFC_MIXED_PRECISION` — Mixed-precision mode (`--mixed`)
- `FIGR_MPI` — MPI (always enabled, no `--no-mpi` option)
- `FIGR_OpenACC` — OpenACC GPU backend (`--gpu acc`)
- `FIGR_OpenMP` — OpenMP target offload backend (`--gpu mp`)
- `FIGR_GPU` — Any GPU build (either OpenACC or OpenMP)
- `FIGR_DEBUG` — Debug build (`--debug`)
- `FIGR_SINGLE_PRECISION` — Single-precision mode (`--single`)
- `FIGR_MIXED_PRECISION` — Mixed-precision mode (`--mixed`)

### Target gating (for code in `src/common/` shared across executables)
- `MFC_PRE_PROCESS` — Only in pre_process builds
- `MFC_SIMULATION` — Only in simulation builds
- `MFC_POST_PROCESS` — Only in post_process builds
- `FIGR_PRE_PROCESS` — Only in pre_process builds
- `FIGR_SIMULATION` — Only in simulation builds
- `FIGR_POST_PROCESS` — Only in post_process builds

### Compiler gating (for compiler-specific workarounds)
- `_CRAYFTN` — Cray Fortran compiler
Expand All @@ -115,7 +115,7 @@ Use `#ifdef` for feature, target, compiler, and library gating:
- `FRONTIER_UNIFIED` — Frontier HPC unified memory

### Library-specific code
- FFTW (`m_fftw.fpp`) uses heavy `#ifdef` gating for `MFC_GPU` and `__PGI`
- FFTW (`m_fftw.fpp`) uses heavy `#ifdef` gating for `FIGR_GPU` and `__PGI`
- CUDA Fortran (`cudafor` module) is gated behind `__NVCOMPILER_GPU_UNIFIED_MEM`
- SILO/HDF5 interfaces may have conditional paths

Expand Down
20 changes: 10 additions & 10 deletions .claude/rules/parameter-system.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# Parameter System

## Overview
MFC has ~3,400 simulation parameters defined in Python and read by Fortran via namelist files.
figr has ~3,400 simulation parameters defined in Python and read by Fortran via namelist files.

## Parameter Flow: Python → Fortran

1. **Definition**: `toolchain/mfc/params/definitions.py` — source of truth
1. **Definition**: `toolchain/figr/params/definitions.py` — source of truth
- Parameters are indexed families: `patch_icpp(i)%attr`, `fluid_pp(i)%attr`, etc.
- Each has type, default, constraints, and tags

2. **Validation** (two layers):
- `toolchain/mfc/case.py` / `toolchain/mfc/params/registry.py` — JSON schema validation
- `toolchain/figr/case.py` / `toolchain/figr/params/registry.py` — JSON schema validation
via fastjsonschema (type checking, defaults)
- `toolchain/mfc/case_validator.py` — Physics constraint checking
- `toolchain/figr/case_validator.py` — Physics constraint checking
(e.g., volume fractions sum to 1, dependency validation)

3. **Input Generation**: `toolchain/mfc/run/input.py`
3. **Input Generation**: `toolchain/figr/run/input.py`
- Python case dict → Fortran namelist `.inp` file
- Format: `&user_inputs` ... `&end/`

Expand All @@ -28,21 +28,21 @@ MFC has ~3,400 simulation parameters defined in Python and read by Fortran via n
YOU MUST update the first 3 locations. Missing any causes silent failures or compile errors.
Location 4 is required only if the parameter has physics constraints.

1. **`toolchain/mfc/params/definitions.py`**: Add parameter with type, default, constraints
1. **`toolchain/figr/params/definitions.py`**: Add parameter with type, default, constraints
2. **`src/*/m_global_parameters.fpp`**: Declare the Fortran variable in the relevant
target(s). If the param is used by simulation only, add it there. If shared, add to
all three targets' m_global_parameters.fpp.
3. **`src/*/m_start_up.fpp`**: Add to the Fortran `namelist` declaration in the relevant
target(s).
4. **`toolchain/mfc/case_validator.py`**: Add validation rules if the parameter has
4. **`toolchain/figr/case_validator.py`**: Add validation rules if the parameter has
physics constraints. Include `PHYSICS_DOCS` entry with title, category, explanation.

## Case Files
- Case files are Python scripts (`.py`) that define a dict of parameters
- Validated with `./mfc.sh validate case.py`
- Validated with `./figr.sh validate case.py`
- Examples in `examples/` directory
- Create new cases with `./mfc.sh new <name>`
- Search parameters with `./mfc.sh params <query>`
- Create new cases with `./figr.sh new <name>`
- Search parameters with `./figr.sh params <query>`

## Fortran-Side Runtime Validation
Each target has `m_checker*.fpp` files (e.g., `src/simulation/m_checker.fpp`,
Expand Down
9 changes: 0 additions & 9 deletions .devcontainer/devcontainer.json

This file was deleted.

2 changes: 1 addition & 1 deletion .ffmt.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# MFC Fortran formatting configuration
# figr Fortran formatting configuration
# These are the defaults — this file makes them explicit.

indent-width = 4
Expand Down
14 changes: 4 additions & 10 deletions .fortlsrc
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
],
"pp_suffixes": [".fpp"],
"pp_defs": {
"MFC": 1,
"MFC_SINGLE_PRECISION": 1,
"MFC_OPENACC": 1,
"MFC_MPI": 1
"figr": 1,
"FIGR_SINGLE_PRECISION": 1,
"FIGR_OPENACC": 1,
"FIGR_MPI": 1
},
"lowercase_intrinsics": true,
"debug_log": false,
Expand All @@ -50,12 +50,7 @@
],
"implicit_external_mods": [
"mpi",
"m_thermochem",
"m_variables_conversion",
"hipfort",
"hipfort_check",
"hipfort_hipfft",
"cutensorex",
"silo_f9x",
"m_model"
],
Expand All @@ -74,7 +69,6 @@
"src/pre_process/m_checker.fpp",
"src/pre_process/include/2dHardcodedIC.fpp",
"src/pre_process/include/3dHardcodedIC.fpp",
"src/simulation/m_qbmm.fpp",
"src/common/m_variables_conversion.fpp",
"src/simulation/m_global_parameters.fpp",
"**/m_nvtx*",
Expand Down
30 changes: 0 additions & 30 deletions .githooks/pre-commit

This file was deleted.

79 changes: 0 additions & 79 deletions .github/.dockerignore

This file was deleted.

15 changes: 0 additions & 15 deletions .github/CODEOWNERS

This file was deleted.

Loading
Loading