Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

closes #34 . Enable diagnosing variables on inner grid #57

Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions xnemogcm/nemo.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,18 @@ def nemo_preprocess(ds, domcfg, point_type=None):
except IndexError:
# This means that there is no depth dependence of the data (surface data)
z_nme = None
x_nme = "x"
y_nme = "y"
to_rename.update({x_nme: point.x, y_nme: point.y})

# get the name of the dimension along i e.g. x, x_grid_U, x_grid_U_inner etc
x_nme = [i for i in ds.dims.keys() if "x_grid" in i or i=='x']
# get the name of the dimension along j e.g. y, y_grid_U, y_grid_U_inner etc
y_nme = [i for i in ds.dims.keys() if "y_grid" in i or i=='y']

for x in x_nme:
to_rename.update({x: point.x})

for y in y_nme:
to_rename.update({y: point.y})

points = [point.x, point.y]
if z_nme:
to_rename.update({z_nme: point.z})
Expand Down
Loading