Skip to content

Commit 8910893

Browse files
sbryngelsonclaude
andcommitted
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 <noreply@anthropic.com>
1 parent 3781b98 commit 8910893

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pre_process/m_grid.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ impure subroutine s_generate_serial_grid
131131
end do
132132

133133
y_cb = y_cb*length
134-
y_cc(0:m) = (y_cb(0:n) + y_cb(-1:n - 1))/2._wp
134+
y_cc(0:n) = (y_cb(0:n) + y_cb(-1:n - 1))/2._wp
135135

136136
dy = minval(y_cb(0:n) - y_cb(-1:n - 1))
137137

@@ -168,7 +168,7 @@ impure subroutine s_generate_serial_grid
168168
end do
169169

170170
z_cb = z_cb*length
171-
z_cc(0:m) = (z_cb(0:p) + z_cb(-1:p - 1))/2._wp
171+
z_cc(0:p) = (z_cb(0:p) + z_cb(-1:p - 1))/2._wp
172172

173173
dz = minval(z_cb(0:p) - z_cb(-1:p - 1))
174174

0 commit comments

Comments
 (0)