Closed bguelk closed 1 year ago
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?
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. https://github.com/rcaneill/xnemogcm/blob/72d1ca0da2f338663b4009e12cacf4a5c9c348bd/xnemogcm/nemo.py#L80 If you want me to work on it you would need to give write access.
So you are proposing to replace:
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?
(We should also produce test data for this case. I'll simply try to add u_heattr
and see if this is sufficient)
So you are proposing to replace:
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.
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.