From b95f40c1358599e0b3b9d32b420d6eb03bd77a08 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Fri, 20 Feb 2026 22:18:06 -0500 Subject: [PATCH] Fix grid stretching using wrong array bounds for y_cc and z_cc 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 --- src/pre_process/m_grid.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pre_process/m_grid.f90 b/src/pre_process/m_grid.f90 index 92bf4aa052..6ea71bd592 100644 --- a/src/pre_process/m_grid.f90 +++ b/src/pre_process/m_grid.f90 @@ -131,7 +131,7 @@ impure subroutine s_generate_serial_grid end do y_cb = y_cb*length - y_cc(0:m) = (y_cb(0:n) + y_cb(-1:n - 1))/2._wp + y_cc(0:n) = (y_cb(0:n) + y_cb(-1:n - 1))/2._wp dy = minval(y_cb(0:n) - y_cb(-1:n - 1)) @@ -168,7 +168,7 @@ impure subroutine s_generate_serial_grid end do z_cb = z_cb*length - z_cc(0:m) = (z_cb(0:p) + z_cb(-1:p - 1))/2._wp + z_cc(0:p) = (z_cb(0:p) + z_cb(-1:p - 1))/2._wp dz = minval(z_cb(0:p) - z_cb(-1:p - 1))