Skip to content

Commit 26b90d0

Browse files
authored
Merge pull request #368 from OceanParcels/fix_allow_time_extrapolation
Fix allow time extrapolation
2 parents 8305362 + 07163d5 commit 26b90d0

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

parcels/field.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,10 @@ def __init__(self, name, data, lon=None, lat=None, depth=None, time=None, grid=N
201201
raise ValueError("Unsupported mesh type. Choose either: 'spherical' or 'flat'")
202202
self.interp_method = interp_method
203203
self.fieldset = None
204-
if allow_time_extrapolation is None:
205-
self.allow_time_extrapolation = True if time is None else False
204+
if self.name in ['cosU', 'sinU', 'cosV', 'sinV']:
205+
self.allow_time_extrapolation = True
206+
elif allow_time_extrapolation is None:
207+
self.allow_time_extrapolation = True if len(self.grid.time) == 1 else False
206208
else:
207209
self.allow_time_extrapolation = allow_time_extrapolation
208210

0 commit comments

Comments
 (0)