Skip to content

Commit 9016b11

Browse files
committed
Bug correction in wrapping in advection
1 parent 790cc10 commit 9016b11

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/py_eddy_tracker/dataset/grid.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2005,7 +2005,7 @@ def advect_rk4(x_g, y_g, u_g, v_g, m_g, x, y, m, nb_step):
20052005
x_ref, y_ref = x_g[0], y_g[0]
20062006
x_step, y_step = x_g[1] - x_ref, y_g[1] - y_ref
20072007
is_circular = abs(x_g[-1] % 360 - (x_g[0] - x_step) % 360) < 1e-5
2008-
nb_x_ = x_g.size - 2
2008+
nb_x_ = x_g.size
20092009
nb_x = nb_x_ if is_circular else 0
20102010
# cache
20112011
i_cache, j_cache = -1000000, -1000000
@@ -2108,7 +2108,7 @@ def advect(x_g, y_g, u_g, v_g, m_g, x, y, m, nb_step):
21082108
x_ref, y_ref = x_g[0], y_g[0]
21092109
x_step, y_step = x_g[1] - x_ref, y_g[1] - y_ref
21102110
is_circular = abs(x_g[-1] % 360 - (x_g[0] - x_step) % 360) < 1e-5
2111-
nb_x_ = x_g.size - 2
2111+
nb_x_ = x_g.size
21122112
nb_x = nb_x_ if is_circular else 0
21132113
# Indices which should be never exist
21142114
i0_old, j0_old = -100000, -100000
@@ -2472,7 +2472,7 @@ def advect_t(x_g, y_g, u_g0, v_g0, m_g0, u_g1, v_g1, m_g1, x, y, m, weigths, hal
24722472
x_ref, y_ref = x_g[0], y_g[0]
24732473
x_step, y_step = x_g[1] - x_ref, y_g[1] - y_ref
24742474
is_circular = abs(x_g[-1] % 360 - (x_g[0] - x_step) % 360) < 1e-5
2475-
nb_x_ = x_g.size - 2
2475+
nb_x_ = x_g.size
24762476
nb_x = nb_x_ if is_circular else 0
24772477
# Indices which should be never exist
24782478
i0_old, j0_old = -100000, -100000
@@ -2598,7 +2598,7 @@ def advect_t_rk4(
25982598
x_ref, y_ref = x_g[0], y_g[0]
25992599
x_step, y_step = x_g[1] - x_ref, y_g[1] - y_ref
26002600
is_circular = abs(x_g[-1] % 360 - (x_g[0] - x_step) % 360) < 1e-5
2601-
nb_x_ = x_g.size - 2
2601+
nb_x_ = x_g.size
26022602
nb_x = nb_x_ if is_circular else 0
26032603
# cache
26042604
i_cache, j_cache = -1000000, -1000000

0 commit comments

Comments
 (0)