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

Changed name of dimensions in NEMO4.2 output #34

Closed
bguelk opened this issue Dec 6, 2022 · 5 comments · Fixed by #57
Closed

Changed name of dimensions in NEMO4.2 output #34

bguelk opened this issue Dec 6, 2022 · 5 comments · Fixed by #57

Comments

@bguelk
Copy link

bguelk commented Dec 6, 2022

The names of the x and y dimension in the output files from NEMO4.2 have partly changed, e.g. in grid_T.nc (x,y) are now (x_grid_T, y_grid_T). Same applies to output in grid_U.nc and grid_V.nc. Further, a second x and y dimension (x_grid_T_inner, y_grid_T_inner) appears for some fields.

@rcaneill
Copy link
Owner

rcaneill commented Dec 8, 2022

I did a try with the tests/CANAL configuration and NEMO 4.2.0, and I don't get the (x_grid_T, y_grid_T) dimensions (it outputs x and y dimensions, as in NEMO 4.0.0)
Do you have any non default .xml configuration file?

@vopikamm
Copy link

vopikamm commented Jul 28, 2023

I could reproduce this issue when diagnosing e.g. u_heattr. So I guess this issue would always occur when choosing diagnostics with:

<field id= ...     grid_ref="grid_..._inner" />

This could be solved in a similar fashion as for the vertical dimension.

z_nme = [i for i in ds.dims.keys() if "depth" in i][0]

If you want me to work on it you would need to give write access.

@rcaneill
Copy link
Owner

rcaneill commented Jul 31, 2023

So you are proposing to replace:

x_nme = "x"
y_nme = "y"
to_rename.update({x_nme: point.x, y_nme: point.y})

by something like?

    x_nme = [i for i in ds.dims.keys() if "x" in i]
    y_nme = [i for i in ds.dims.keys() if "y" in i]
    to_rename.update({x: point.x for x in x_nme}).update({y: point.y for y in y_nme})

This would probably work. The easiest is that @vopikamm you fork xnemogcm, create a new branch on your fork, make the change, and afterward open a pull request. Is it fine for you?

@rcaneill
Copy link
Owner

(We should also produce test data for this case. I'll simply try to add u_heattr and see if this is sufficient)

@vopikamm
Copy link

So you are proposing to replace:

x_nme = "x"
y_nme = "y"
to_rename.update({x_nme: point.x, y_nme: point.y})

by something like?

    x_nme = [i for i in ds.dims.keys() if "x" in i]
    y_nme = [i for i in ds.dims.keys() if "y" in i]
    to_rename.update({x: point.x for x in x_nme}).update({y: point.y for y in y_nme})

This would probably work. The easiest is that @vopikamm you fork xnemogcm, create a new branch on your fork, make the change, and afterward open a pull request. Is it fine for you?

One issue I see with this is that it would rename any dimension with an x/y in it (like axis_nbounds). We should also add the _inner dimensions in arakawa_points.py. T.b.h I think this is more an inconsistency in writing netCDF files from the NEMO side: dimension names depending on dimension names of other variables... But I think its quicker to write a small workaround here. I can do it this afternoon.

rcaneill added a commit that referenced this issue Jul 31, 2023
…les-on-inner-grid

closes #34 . Enable diagnosing variables on inner grid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants