Skip to content

Commit ebaaa5c

Browse files
Removing _discover_U_and_V from convert.nemo
As it is not needed, now that we require users to provide field names explicitly
1 parent 0f92725 commit ebaaa5c

1 file changed

Lines changed: 1 addition & 11 deletions

File tree

src/parcels/convert.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,6 @@
2323
if typing.TYPE_CHECKING:
2424
import uxarray as ux
2525

26-
_NEMO_CF_STANDARD_NAME_FALLBACKS = {
27-
"UV": [
28-
(
29-
"sea_water_x_velocity",
30-
"sea_water_y_velocity",
31-
),
32-
],
33-
"W": ["upward_sea_water_velocity", "vertical_sea_water_velocity"],
34-
}
35-
3626
_NEMO_DIMENSION_COORD_NAMES = ["x", "y", "time", "x", "x_center", "y", "y_center", "depth", "glamf", "gphif"]
3727

3828
_NEMO_AXIS_VARNAMES = {
@@ -131,6 +121,7 @@ def _ds_rename_using_standard_names(ds: xr.Dataset | ux.UxDataset, name_dict: di
131121
return ds
132122

133123

124+
# TODO is this function still needed, now that we require users to provide field names explicitly?
134125
def _discover_U_and_V(ds: xr.Dataset, cf_standard_names_fallbacks) -> xr.Dataset:
135126
# Assumes that the dataset has U and V data
136127

@@ -219,7 +210,6 @@ def nemo_to_sgrid(*, fields: dict[str, xr.Dataset | xr.DataArray], coords: xr.Da
219210

220211
ds = xr.merge(list(fields.values()) + [coords])
221212
ds = _maybe_rename_variables(ds, _NEMO_VARNAMES_MAPPING)
222-
ds = _discover_U_and_V(ds, _NEMO_CF_STANDARD_NAME_FALLBACKS)
223213
ds = _maybe_create_depth_dim(ds)
224214
ds = _maybe_bring_UV_depths_to_depth(ds)
225215
ds = _drop_unused_dimensions_and_coords(ds, _NEMO_DIMENSION_COORD_NAMES)

0 commit comments

Comments
 (0)