From f98f93e9f984c579cca650d8a81aaa05adf9092d Mon Sep 17 00:00:00 2001 From: Daniel Vickers Date: Thu, 2 Jul 2026 09:42:04 -0400 Subject: [PATCH 1/2] Added a global domain length to pre-process so that we can normalize by the global length --- src/pre_process/m_global_parameters.fpp | 3 +++ src/pre_process/m_grid.f90 | 6 +++--- src/pre_process/m_start_up.fpp | 6 ++++++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/pre_process/m_global_parameters.fpp b/src/pre_process/m_global_parameters.fpp index 619e31fd11..24a13b4e3a 100644 --- a/src/pre_process/m_global_parameters.fpp +++ b/src/pre_process/m_global_parameters.fpp @@ -38,6 +38,9 @@ module m_global_parameters real(wp), allocatable, dimension(:) :: x_cb, y_cb, z_cb real(wp) :: dx, dy, dz !< Minimum cell-widths in the x-, y- and z-coordinate directions type(bounds_info) :: x_domain, y_domain, z_domain !< Locations of the domain bounds in the x-, y- and z-coordinate directions + !> Global (pre-decomposition) domain bounds, needed by s_generate_serial_grid to stretch the grid using the full domain length + !! rather than a local processor's sub-domain length + type(bounds_info) :: x_domain_glb, y_domain_glb, z_domain_glb ! Simulation Algorithm Parameters ! sys_size, eqn_idx, b_size, tensor_size, chemistry, elasticity, shear_*: in m_global_parameters_common diff --git a/src/pre_process/m_grid.f90 b/src/pre_process/m_grid.f90 index 77cb02cef2..ea81c1f1ec 100644 --- a/src/pre_process/m_grid.f90 +++ b/src/pre_process/m_grid.f90 @@ -49,7 +49,7 @@ impure subroutine s_generate_serial_grid ! Hyperbolic tangent grid stretching if (stretch_x) then - length = abs(x_cb(m) - x_cb(-1)) + length = abs(x_domain_glb%end - x_domain_glb%beg) x_cb = x_cb/length x_a = x_a/length x_b = x_b/length @@ -96,7 +96,7 @@ impure subroutine s_generate_serial_grid ! Hyperbolic tangent grid stretching in y-direction if (stretch_y) then - length = abs(y_cb(n) - y_cb(-1)) + length = abs(y_domain_glb%end - y_domain_glb%beg) y_cb = y_cb/length y_a = y_a/length y_b = y_b/length @@ -130,7 +130,7 @@ impure subroutine s_generate_serial_grid ! Hyperbolic tangent grid stretching in z-direction if (stretch_z) then - length = abs(z_cb(p) - z_cb(-1)) + length = abs(z_domain_glb%end - z_domain_glb%beg) z_cb = z_cb/length z_a = z_a/length z_b = z_b/length diff --git a/src/pre_process/m_start_up.fpp b/src/pre_process/m_start_up.fpp index bec4585e38..c2289ab98e 100644 --- a/src/pre_process/m_start_up.fpp +++ b/src/pre_process/m_start_up.fpp @@ -622,6 +622,12 @@ contains ! Neither procedure has to be carried out if pre-process is in fact not truly executed in parallel. call s_mpi_bcast_user_inputs() call s_initialize_parallel_io() + + ! Save the global domain bounds before decomposition overwrites x/y/z_domain with each processor's local sub-domain bounds + x_domain_glb = x_domain + y_domain_glb = y_domain + z_domain_glb = z_domain + call s_mpi_decompose_computational_domain() end subroutine s_initialize_mpi_domain From d23f6f12b3ab916d5a0262131ecc8728a2a92cd5 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sat, 4 Jul 2026 09:13:10 -0400 Subject: [PATCH 2/2] Empty commit to refresh PR mergeability check