LLC Grid Read Issue
Closed this issue · 3 comments
I'm trying to read MITgcm output from a slightly different LLC model grid. I am running a Southern Ocean simulation that is on the LLC grid but only south of 50S, and with faces 1, 2, 4 and 5 of the grid concatenated as a single grid. I keep running into the nx*ny is not the same size as expected from a full LLC270 grid. It seems like I would need to change the grid extra metadata, but I am not sure how to do that. Can someone give me advice on how to do that? Thanks! Madeleine
Hi @mkyoungs
I had a similar type of configuration and the solution was to pad faces with zeros/NaN so that they all have the same size otherwise xarray does not like it. The extra metadata options are designed to perform that padding.
Here's an example of the config I used to work with:
https://github.com/raphaeldussin/MITgcm-recipes/blob/master/examples/Plotting_ASTE.ipynb
the docstring of read_mds contains the details of the different (numerous) options. From what you wrote,
you probably have 3 facets (inputs grids) of different size. xmitgcm will split and pad into faces of equal size.
You don't have a plot of the config and a .meta laying around by chance ?
Hi @raphaeldussin, it seems like this is just a curvilinear grid masquerading as an LLC grid. So I was able to read in the data with the 'curvilinear' option selected. This configuration is new to me so I am looking for a config plot. It is still being buggy reading in one of the 2d datasets with a dimension error. ValueError: dimensions ('time', 'j', 'i') must have the same length as the number of data dimensions, ndim=2.
Thanks for the fast response! I will keep you updated. Will try to read in this file another way to see if it is corrupted or something.
@raphaeldussin Thanks for your help! I think I figured it out. The last error seems to be because I was saving the same diagnostic multiple times which lead to empty output.