@@ -875,7 +875,6 @@ def eval(self, time, z, y, x, particle=None, applyConversion=True):
875875 conversion to the result. Note that we defer to
876876 scipy.interpolate to perform spatial interpolation.
877877 """
878- _ , ti = self ._time_index (time )
879878 if self .gridindexingtype == "croco" and self not in [self .fieldset .H , self .fieldset .Zeta ]:
880879 z = _croco_from_z_to_sigma_scipy (self .fieldset , time , z , y , x , particle = particle )
881880
@@ -1548,20 +1547,28 @@ def eval(self, time, z, y, x, particle=None, applyConversion=True):
15481547 grid = self .U .grid
15491548 tau , ti = self .U ._time_index (time )
15501549 if ti < grid .tdim - 1 and time > grid .time [ti ]:
1550+ t0 = grid .time [ti ]
1551+ t1 = grid .time [ti + 1 ]
15511552 if "3D" in self .vector_type :
15521553 (u0 , v0 , w0 ) = interp [self .U .interp_method ]["3D" ](
1553- ti , z , y , x , time , particle = particle , applyConversion = applyConversion
1554+ ti ,
1555+ z ,
1556+ y ,
1557+ x ,
1558+ t0 ,
1559+ particle = particle ,
1560+ applyConversion = applyConversion , # TODO see if we can directly call time interpolation for W here
15541561 )
15551562 (u1 , v1 , w1 ) = interp [self .U .interp_method ]["3D" ](
1556- ti + 1 , z , y , x , time , particle = particle , applyConversion = applyConversion
1563+ ti + 1 , z , y , x , t1 , particle = particle , applyConversion = applyConversion
15571564 )
15581565 w = w0 * (1 - tau ) + w1 * tau
15591566 else :
15601567 (u0 , v0 ) = interp [self .U .interp_method ]["2D" ](
1561- ti , z , y , x , time , particle = particle , applyConversion = applyConversion
1568+ ti , z , y , x , t0 , particle = particle , applyConversion = applyConversion
15621569 )
15631570 (u1 , v1 ) = interp [self .U .interp_method ]["2D" ](
1564- ti + 1 , z , y , x , time , particle = particle , applyConversion = applyConversion
1571+ ti + 1 , z , y , x , t1 , particle = particle , applyConversion = applyConversion
15651572 )
15661573 u = u0 * (1 - tau ) + u1 * tau
15671574 v = v0 * (1 - tau ) + v1 * tau
0 commit comments