-
Notifications
You must be signed in to change notification settings - Fork 67
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
U,V are not always the zonal and meridional components of velocity #204
Comments
Hey @antonimmo! Welcome to the wonderful world of the LLC grid! Yes, it is a bit nonintuitive at first, hopefully I can help. The LLC grid "faces" or "tiles" are oriented as shown in the first diagram on this page. (Note that the ECCO and LLC community uses the term "tile" for the same thing face means in xmitgcm). Basically, the U and V components on the model's native LLC grid point in the x and y directions local to the face they are on. If you look at face 10 as you have plotted, it is rotated in such a way the U (or UVEL, UVELMASS, or really any "eastward" model component) is pointing Southward, and V (or VVEL, VVELMASS, etc) points Eastward (as you have pointed out). For certain latitudes, the grid is a regular Lat/Lon projection, and so the uvel and vvel components can be obtained by simply rotating the vectors accordingly. I think that this can be accomplished by grabbing the 'latlon' version with llcreader, using the However, if you want anything that goes poleward of 57N or 70S then the orientation of each grid cell is not trivial, and requires the Finally, if you are interested in simply viewing the velocity fields, that is probably enough. But, if you are interested in computing transport quantities, such as MHT, then you will not want to use that function (i.e. interpolate) first because of numerical errors. You can see a little tutorial for using the package to compute Atlantic MHT here, as well as some examples in the previous link. Ok as if this wasn't long enough... I have to make the disclaimer that the package I'm talking about has been designed and mostly used by folks working with LLC90. There is no reason why it shouldn't work with LLC4320 (although it will be much slower!), but if you do use it and run into problems I'm happy to help, just raise an issue over there. Finally, the pip version of that package is ... out of date ... so please clone it from github for now (sorry)... and if you want to read more about the LLC grid see Section 2 of https://doi.org/10.5194/gmd-8-3071-2015. |
Thanks, @timothyas for your thorough answer! Yes, I've also learnt about LLC tiles from that exact diagram. I had already rotated the data with Also, it would be great if llcreader could read the grid as well, so that lon, lat and vertical levels could be promoted to Dataset coordinates. I'm currently addressing that issue my own way, by downloading the grid (except for So, just to close this... Should the description of the variables ( Also, does the same apply for other vector fields such as |
Oh, I almost missed it... It seems to me that using Also, does the same apply for Thanks again! |
Hey @antonimmo, I'll try to respond where I can...
I could not agree more... That's what we're working on with #197, which should be available soon. We're simply waiting to see if we can make more grid variables available on the ECCO Portal, hopefully a permanent place.
Perhaps I'm misinterpreting this, so let me know if so. If you're referring to that fact that you don't have to perform any rotations for those fields, it is because they are scalar quantities at a single point rather than a vector field. Because U and V have a direction associated with them, the values themselves require any rotation associated with that face or tile. However, something like temperature or depth is defined by a quantity at a given location, so no rotation is needed. See for instance the SST and depth plots shown here in the xgcm docs. With these fields, once the "view" of the data is rotated (i.e. by rotating the tile), nothing else needs to change. This isn't the case with vector valued quantities (or even the grid spacings, e.g. dxC, dyC). Hopefully that helps...
Yeah I think this could be more clear, but I have to say I'm not sure of the best way to broadcast that info. Maybe it could be appended by llcreader itself to say something like "Velocity in local X direction" for U, or something like that?
Actually, I'm not sure if it matters whether you call for "faces" and then subset the data with
Yes it does, if you only need a single or a subset of the vertical levels then definitely specify that in your call to |
I've learnt a lot in the last 12 hours, so thanks, @timothyas! Although I have many more questions, they are unrelated to this issue, so maybe later. But one thing bugs me...
Is there a way to get a graphic representation of such graph? I mean, like in Tensorflow. Perhaps it could get some users a better way to understand, and thus optimize, the graph for what they need. Now, regarding this issue:
To be clear, there are 2 kind of rotations that could be performed. The first one that applies to all fields (including positions and grid spacings dx, dy, etc.), in my case I use
which implies that XG/XC are not the longitude, nor YG/YC the latitude, from which I infer that also DXc/DXg are not the grid spacings in the X (zonal) direction, and similarly DYc/DYg are not the grid spaings in the Y (meridional) direction. But I'm reading the grid with
Well, that's what I was suggesting at the beginning, because saying "meridional" and "zonal" isn't accurate ~50% of the globe when we call for |
The central design principle in xmitgcm is to pass the MITgcm output through to the user in a way that is faithful to MITgcm's internals, as simply as possible. We don't want to introduce new assumptions or conventions, since these then become our responsibility to maintain. They also become an additional source of confusion and error. The These are the official descriptions assigned to those diagnostics by MITgcm. xmitgcm does not want to get into the business of editing those descriptions. Your points about these names being confusing for curvilinear grids (and especially for the LLC grid) are quite valid. However, they need to be taken up in the main MITgcm issue tracker. Once the names are changed there, we would be happy to change them here. Many of your other questions about geometry can be resolved by carefully reading the MITgcm documentation on the horizontal grid discretization: https://mitgcm.readthedocs.io/en/latest/algorithm/horiz-grid.html#curvilinear-coordinates Or, when that fails, the source code itself:
|
Just jumping in here to say that we have an issue open at the moment about this - MITgcm/MITgcm#248 It would be great if you jumped over there and left a comment. |
I'm glad this is helpful @antonimmo! I can tell you this issue gave myself and many others confusion - you're not alone! I just want to add one more thing to your quote of the ECCOv4 documentation that you mentioned:
This wording in the documentation is perhaps confusing. The "local x and y direction" is referring to the x and y axis on the plot shown below, not XC/YC or XG/YG. In xmitgcm terms, these "local x/y directions" are the Note for instance how latitude (YC) changes with the i and j variables differently on different tiles... Finally, note that the distances dxC/G and dyC/G are different in this regard, and are the distances between the (and thanks @rabernat & @edoddridge!) |
@rabernat I will take a look at the documentation links you provided. Also the graphviz thing is exactly how I imagined it. There's a lot more to learn, so thanks! @edoddridge @timothyas So it seems I'm not alone in this! So, summing up, we could close this issue when MITgcm/MITgcm#248 is resolved. |
I understand this might be inherited from LLC faces, but I didn't expect it as the description of the variables is a bit misleading.
This works well on faces 0-6, but for faces 6-12 it seems U is actually the "local X" component of the velocity, while V is the "local Y" component (local = tile axis). So it means that V is the zonal component (positive = eastward), while -U is the meridional component (positive = northward).
For instance, for face 10:
Figure 1 (U)
![image](https://user-images.githubusercontent.com/6156024/83244992-fea87880-a154-11ea-8734-b92ca53d5172.png)
Figure 2 (V)
![image](https://user-images.githubusercontent.com/6156024/83245035-0ec05800-a155-11ea-8528-df654e28e519.png)
As the colorbars take the description of the variables (long_name), one would think (as I did) that U and V are the zonal and meridional components of the velocity, respectively; but by simple inspection of the loop current, it is clear that this is not the case,
I found it by calculating both the vorticity and divergence for regions within faces 1, 2, 10 and 11. For 1 and 2, it worked as expected; whereas, for faces 10 and 11, divergence looked like vorticity and vice-versa; so I made the transformation I already mentioned, and I managed to fix it.
I assume this comes from the ECCO data portal itself, in which case renaming the variable descriptions would suffice. Otherwise, is there a way to fix it, or am I missing something?
Thanks!
The text was updated successfully, but these errors were encountered: