Fix grid stretching using wrong array bounds for y_cc and z_cc#1179
Fix grid stretching using wrong array bounds for y_cc and z_cc#1179sbryngelson wants to merge 1 commit intoMFlowCode:masterfrom
Conversation
|
CodeAnt AI is reviewing your PR. Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Nitpicks 🔍
|
|
CodeAnt AI finished reviewing your PR. |
There was a problem hiding this comment.
Pull request overview
Fixes incorrect array section bounds used when computing cell-center coordinates (y_cc, z_cc) during grid stretching, which corrupted coordinates for anisotropic grids.
Changes:
- Use
n(y dimension) instead ofmwhen assigningy_cc(0:...). - Use
p(z dimension) instead ofmwhen assigningz_cc(0:...).
y_cc(0:m) and z_cc(0:m) use the x-dimension size m instead of the y-dimension n and z-dimension p respectively. Corrupts cell-center coordinates when grid stretching is enabled and m != n or m != p. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
8910893 to
b95f40c
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1179 +/- ##
=======================================
Coverage 44.05% 44.05%
=======================================
Files 70 70
Lines 20498 20498
Branches 1990 1990
=======================================
Hits 9030 9030
Misses 10329 10329
Partials 1139 1139 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
Severity: CRITICAL — corrupts y/z cell-center coordinates when grid stretching is active.
File:
src/pre_process/m_grid.f90, lines 134 and 171After applying grid stretching, the cell-center arrays are computed with the wrong left-hand side bounds:
y_cc(0:m)andz_cc(0:m)use the x-dimension sizeminstead of the y-dimensionnand z-dimensionp.Before
After
Why this went undetected
When
m == n == p(equal resolution in all directions), the wrong index produces the same result. The bug only manifests with anisotropic grids and stretching enabled.Test plan
🤖 Generated with Claude Code
Fixes #1200