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
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ the latest version of the code, and publish them to `example` when commiting to

## What's new

### not released yet
* Allow additional dimension names occurring when variables on inner grid are diagnosed, e.g. `x_grid_U_inner` or `x_grid_U`.

### v0.4.1 (2023-03-29)
* Allow to open files if time bounds are missing
* Minor bug correction for nemo 3.6
Expand Down
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