Skip to content

Write vel(2) to 2D probe files and drop the per-step print - #1844

Open
sbryngelson wants to merge 1 commit into
masterfrom
fix/2d-probe-output
Open

Write vel(2) to 2D probe files and drop the per-step print#1844
sbryngelson wants to merge 1 commit into
masterfrom
fix/2d-probe-output

Conversation

@sbryngelson

Copy link
Copy Markdown
Member

Fixes #1841.

For a plain 2D case (no bubbles, no hypoelasticity), s_write_probe_files wrote only (time, rho, vel(1), pres) — the second velocity component was dropped — and it also printed a line to stdout on every time step for every probe:

write (i + 30, '(6X,F12.6,F24.8,F24.8,F24.8)') nondim_time, rho, vel(1), pres
print *, 'time =', nondim_time, 'rho =', rho, 'pres =', pres

The 3D branch writes all three components and the 2D bubble and hypoelastic branches both write vel(2), so this looks like the plain-2D branch being incomplete rather than intentional. The print floods the log of any long run: one line per probe per step.

The fypp guard matches the neighbouring branches, since vel(2) does not exist under 1D case optimization.

Heads up for reviewers: this changes the 2D probe file from four columns to five, so any 2D probe golden files need regenerating. I have not run a 2D probe case with this patch — I hit the missing component while post-processing and fixed it, but my later 2D runs used no probes and my 3D runs take a different branch. Worth a quick check before merge.

./mfc.sh precheck passes.

https://claude.ai/code/session_01HMJ7cycfo7kTFSFq5yhHLG

For a plain 2D case (no bubbles, no hypoelasticity) `s_write_probe_files` wrote only
(time, rho, vel(1), pres), silently dropping the second velocity component, and also
`print`ed a line to stdout on every time step for every probe.

The 3D branch writes all three velocity components, and the 2D bubble and hypoelastic
branches write vel(2), so this was the plain-2D branch being incomplete rather than a
deliberate choice. The stray `print` floods the job log of any long run.

Note this changes the 2D probe file from four columns to five, so 2D probe golden files
need regenerating.

Fixes #1841

Claude-Session: https://claude.ai/code/session_01HMJ7cycfo7kTFSFq5yhHLG
Copilot AI lite review requested due to automatic review settings September 11, 2026 14:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pull request overview

This PR fixes incomplete probe output for plain 2D simulations by writing the second velocity component (vel(2)) to probe files and removing a per-step print that floods stdout/logs.

Changes:

  • Update the plain-2D probe output to include vel(2) (expanding output from 4 to 5 columns).
  • Remove per-probe, per-timestep stdout logging from s_write_probe_files.
  • Add a fypp guard to avoid referencing vel(2) under 1D case optimization.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +1593 to +1595
#:if not MFC_CASE_OPTIMIZATION or num_dims > 1
write (i + 30, '(6X,F12.6,F24.8,F24.8,F24.8,F24.8)') nondim_time, rho, vel(1), vel(2), pres
#:endif
@github-actions

Copy link
Copy Markdown

Claude Code Review

Head SHA: aa71e84

Files changed:

  • 1
  • src/simulation/m_data_output.fpp

Findings:

  • src/simulation/m_data_output.fpp (runtime-info else branch, ~line 1593): the new write is wrapped in #:if not MFC_CASE_OPTIMIZATION or num_dims > 1 with no num_dims == 1 fallback, so under --case-optimization with num_dims == 1 this entire write/output statement is compiled away — the file previously always wrote a line here (nondim_time, rho, vel(1), pres), and now nothing is written at all for 1D case-optimized builds. This also creates a case-optimization-dependent behavior divergence: a non-case-optimized build with num_dims == 1 still hits this line (since not MFC_CASE_OPTIMIZATION is true) and writes vel(2) for a 1D run, while a case-optimized num_dims == 1 build silently drops the write entirely — the same physical case produces different diagnostic output (or none) purely based on the case-optimization compile flag. The fix should preserve the original 4-field write (vel(1) only) for num_dims == 1 and only use the new 5-field vel(1), vel(2) write when num_dims > 1, rather than eliding the branch outright.

@github-actions

Copy link
Copy Markdown

Lines of Code

File Lines Diff
src/simulation/m_data_output.fpp 1368 +1
Directory Lines Diff
simulation 28038 +1
total 46263 +1

@codecov

codecov Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 61.26%. Comparing base (33ad77a) to head (aa71e84).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
src/simulation/m_data_output.fpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1844      +/-   ##
==========================================
- Coverage   62.75%   61.26%   -1.49%     
==========================================
  Files          84       84              
  Lines       22045    22329     +284     
  Branches     3238     3265      +27     
==========================================
- Hits        13834    13680     -154     
- Misses       5981     6206     +225     
- Partials     2230     2443     +213     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2D probe output omits vel(2) and prints to stdout every step (s_write_probe_files)

2 participants