Skip to content

Commit 3f83752

Browse files
Merge branch 'master' into plotting_2dhist
2 parents 855b0d3 + 26b90d0 commit 3f83752

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)