Skip to content

Commit baa5f91

Browse files
Fixing issue when fieldset.U is a nested field
1 parent 29a9fbb commit baa5f91

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

parcels/particleset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from parcels._compat import MPI
1515
from parcels.application_kernels.advection import AdvectionRK4
1616
from parcels.compilation.codecompiler import GNUCompiler
17-
from parcels.field import NestedField
17+
from parcels.field import Field, NestedField
1818
from parcels.grid import CurvilinearGrid, GridType
1919
from parcels.interaction.interactionkernel import InteractionKernel
2020
from parcels.interaction.neighborsearch import (
@@ -174,7 +174,7 @@ def ArrayClass_init(self, *args, **kwargs):
174174
raise NotImplementedError("If fieldset.time_origin is not a date, time of a particle must be a double")
175175
time = np.array([self.time_origin.reltime(t) if _convert_to_reltime(t) else t for t in time])
176176
assert lon.size == time.size, "time and positions (lon, lat, depth) do not have the same lengths."
177-
if not fieldset.U.allow_time_extrapolation:
177+
if isinstance(fieldset.U, Field) and (not fieldset.U.allow_time_extrapolation):
178178
_warn_particle_times_outside_fieldset_time_bounds(time, fieldset.U.grid.time_full)
179179

180180
if lonlatdepth_dtype is None:

0 commit comments

Comments
 (0)