Skip to content

Commit e25a2a2

Browse files
Fixing mypi error
1 parent 439f8a3 commit e25a2a2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

parcels/_interpolation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,8 @@ def _linear_3d(ctx: InterpolationContext3D) -> float:
282282
data_3d = ctx.data[ctx.ti + 1, :, :, :]
283283
fz0_t1, fz1_t1 = _get_3d_f0_f1(eta=ctx.eta, xsi=ctx.xsi, data=data_3d, zi=ctx.zi, yi=ctx.yi, xi=ctx.xi)
284284
fz0 = (1 - ctx.tau) * fz0 + ctx.tau * fz0_t1
285-
fz1 = (1 - ctx.tau) * fz1 + ctx.tau * fz1_t1
285+
if fz1_t1 is not None and fz1 is not None:
286+
fz1 = (1 - ctx.tau) * fz1 + ctx.tau * fz1_t1
286287

287288
return _z_layer_interp(zeta=ctx.zeta, f0=fz0, f1=fz1, zi=ctx.zi, zdim=zdim, gridindexingtype=ctx.gridindexingtype)
288289

0 commit comments

Comments
 (0)