Skip to content

Commit a2620a6

Browse files
Ensure (ux)fieldset has both UV and UVW for datasets with U, V, and W
1 parent 7e9b7da commit a2620a6

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

src/parcels/_core/fieldset.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,9 @@ def from_ugrid_conventions(cls, ds: ux.UxDataset, mesh: str = "spherical"):
200200
fields["UVW"] = VectorField(
201201
"UVW", fields["U"], fields["V"], fields["W"], vector_interp_method=Ux_Velocity
202202
)
203+
fields["UV"] = VectorField(
204+
"UV", fields["U"], fields["V"], vector_interp_method=Ux_Velocity
205+
)
203206
else:
204207
fields["UV"] = VectorField("UV", fields["U"], fields["V"], vector_interp_method=Ux_Velocity)
205208

tests/test_fieldset.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ def test_fieldset_from_fesom2():
239239
fieldset = FieldSet.from_ugrid_conventions(ds)
240240
assert "U" in fieldset.fields
241241
assert "V" in fieldset.fields
242+
assert "UV" in fieldset.fields
242243
assert "UVW" in fieldset.fields
243244

244245

0 commit comments

Comments
 (0)