refactor: consolidate grid, stretch, and body force params into derived types#1432
Open
sbryngelson wants to merge 12 commits into
Open
refactor: consolidate grid, stretch, and body force params into derived types#1432sbryngelson wants to merge 12 commits into
sbryngelson wants to merge 12 commits into
Conversation
Contributor
ⓘ You've reached your Qodo monthly free-tier limit. Reviews pause until next month — upgrade your plan to continue now, or link your paid account if you already have one. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1432 +/- ##
==========================================
- Coverage 64.95% 64.94% -0.02%
==========================================
Files 72 72
Lines 18879 18875 -4
Branches 1571 1572 +1
==========================================
- Hits 12263 12258 -5
Misses 5640 5640
- Partials 976 977 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Replace flat allocatable arrays x_cb/y_cb/z_cb, x_cc/y_cc/z_cc,
and dx/dy/dz with a derived type having .cb, .cc, and .spacing
components. All three executables (pre_process, simulation,
post_process) updated across 47 files.
Key design decisions:
- pre_process keeps scalar dx/dy/dz as minimum cell-width scalars;
only x_cb and x_cc are folded into x%cb and x%cc
- OpenMP GPU target uses whole-struct declare target (x, y, z) since
component-level declare target is invalid; OpenACC uses component-level
- 2dHardcodedIC.fpp wraps dx*dy in #ifdef MFC_PRE_PROCESS for the
scalar vs per-cell context difference
Special variable collisions fixed:
- m_chemistry.fpp: local integer x/y/z -> cx/cy/cz
- m_weno.fpp: local real y(1:4) scratch -> ys
- m_viscous.fpp: local real dx(1:3) scratch -> ds
- m_ibm.fpp: local scalar dx/dy/dz -> dx_loc/dy_loc/dz_loc
- m_cbc.fpp: Fypp template d${XYZ}$ -> ${XYZ}$%spacing
Implements items 7 and 5 from issue #1427: - x_a/x_b/y_a/y_b/z_a/z_b -> type(bounds_info) :: x_stretch, y_stretch, z_stretch - bf_x/bf_y/bf_z + k_x/w_x/p_x/g_x (and y/z) -> type(body_force_axis) :: bf_x, bf_y, bf_z
882206f to
3f9f382
Compare
15f3a64 to
eb90ba8
Compare
Remove module-level dx, dy, dz scalars from pre_process m_global_parameters. Add min_spacing field to the grid_axis derived type so each axis carries its own minimum cell width. Update all call sites in m_grid, m_start_up, m_icpp_patches, m_mpi_common, and 2dHardcodedIC.
After reading grid data from files, compute and store min_spacing on each axis in both serial and parallel paths. Matches the pre_process pattern so min_spacing is consistent across all three executables.
Group the three directional boundary condition variables (bc_x, bc_y, bc_z of type bc_dir_t) into a single bc_xyz_info struct accessed as bc%x, bc%y, bc%z. Updates all Fortran source, Fypp macros, Python toolchain, example cases, and documentation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
x_cc,x_cb,x_cb_sand y/z equivalents) intotype(grid_axis) :: x, y, zx_a/x_b,y_a/y_b,z_a/z_b) intotype(bounds_info) :: x_stretch, y_stretch, z_stretchbf_x/k_x/w_x/p_x/g_xand y/z) intotype(body_force_axis) :: bf_x, bf_y, bf_ztoolchain/mfc/case.pyto usex%cc(i)after grid_axis refactorImplements items 1, 5, and 7 from issue #1427.
Test plan
./mfc.sh precheckpasses (all 6 checks)