Skip to content

Commit b4a3862

Browse files
committed
small-radius guard
1 parent f0f640c commit b4a3862

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/pre_process/m_icpp_patches.fpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,11 @@ contains
10641064
do j = 0, n
10651065
do i = 0, m
10661066
r = sqrt((x_cc(i) - x_centroid)**2 + (y_cc(j) - y_centroid)**2)
1067-
theta = atan2(y_cc(j) - y_centroid, x_cc(i) - x_centroid)
1067+
if (r < small_radius) then
1068+
theta = 0._wp
1069+
else
1070+
theta = atan2(y_cc(j) - y_centroid, x_cc(i) - x_centroid)
1071+
end if
10681072
sum_series = 0._wp
10691073
do nn = 1, max_2d_fourier_modes
10701074
sum_series = sum_series + patch_icpp(patch_id)%fourier_cos(nn)*cos(real(nn, wp)*theta) &

0 commit comments

Comments
 (0)