Skip to content

QL: allow prescribed perturbation mode without field file#121

Open
krystophny wants to merge 4 commits into
mainfrom
feat/ql-qflux-mode-input
Open

QL: allow prescribed perturbation mode without field file#121
krystophny wants to merge 4 commits into
mainfrom
feat/ql-qflux-mode-input

Conversation

@krystophny

@krystophny krystophny commented Jul 7, 2026

Copy link
Copy Markdown
Member

This branch is stacked on #124 and remains open against main. PR #120 is already merged.

Summary

  • add isw_m_phi_input and m_phi_input to ntv_input
  • allow file-less non-axisymmetric input with a prescribed toroidal mode
  • reject a file-less solve when no physical source is configured
  • skip perturbation-file symlinks when no file is requested
  • document and test the input path

The #118 drive is the next stack layer. Its #122 child relaxes the no-source guard only when a nonzero helical source exists. No branch is authorized to merge before the programme-wide gate.

Verification

Test fails on main

With only the regression applied:

$ cmake --build --preset default --target test_ntv_perturbation_input
Error: Symbol ‘isw_m_phi_input’ referenced at (1) not found in module ‘ntv_mod’
Error: Symbol ‘m_phi_input’ referenced at (1) not found in module ‘ntv_mod’
Error: Symbol ‘has_perturbation_file’ referenced at (1) not found in module ‘ntv_mod’
ninja: build stopped: subcommand failed.

Test passes after fix

$ fo
Static: OK
Build: OK
Tests: OK
Lint: OK
All stages passed

$ make test
100% tests passed, 0 tests failed out of 6

$ ctest --test-dir build -R "^ntv_perturbation_input_test$" --output-on-failure
1/1 Test #...: ntv_perturbation_input_test ... Passed

$ git diff --check
<no output>

All 16 external-data regressions remain registered under regression;external-data; this branch does not mark that separate gate passed.

@krystophny

Copy link
Copy Markdown
Member Author

The in_file_pert='none' source-only path this PR adds lets an NA qflux run (isw_qflux_NA=1) proceed with no source configured (no field, drive off). The resulting zero source is the Arnoldi seed, so arnoldi normalizes 0/0 -> NaN and zhseqr fails at every step (~8 min spin, no qflux output). Scoped guard + red-then-green test: #122. Keep arnoldi_mod.f90 untouched; guard the assembled source (a valid none + drive-on run on #119 must still pass).

@krystophny krystophny force-pushed the feat/ql-qflux-mode-input branch from 3a34e37 to 1e7f42f Compare July 11, 2026 08:39
isw_qflux_NA=1 with in_file_pert='none' assembles an identically zero
non-axisymmetric source. That zero vector is the Arnoldi seed, so its
normalization divides by zero (0/0 -> NaN) and zhseqr then fails to
converge at every step, spinning without qflux output. Reject the
configuration in check() with a clear message instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant