Repository navigation
Check Geostrophic_Velocities_from_Sea_Level.ipynb - #707
Conversation
|
Check out this pull request onΒ See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
|
View / edit / reply to this conversation on ReviewNB anton-seaice commented on 2026-07-16T02:00:18Z Have you tested this with MOM6 ?
I guess you also need to get the right combination of
instead of
it looks like julia-neme commented on 2026-07-20T02:49:38Z True! I can replace with And regarding the right combination, since discovering that I can use .derivative() you don't need to think about combining interp and diff, so I might change the script to use that.
(see comment below) anton-seaice commented on 2026-07-20T03:27:41Z I think using
julia-neme commented on 2026-07-27T00:22:14Z Ok, so now I've included more information on how to adapt to mom6 ! Also changed to using .derivative() |
|
View / edit / reply to this conversation on ReviewNB anton-seaice commented on 2026-07-16T02:00:20Z Why id boundary = 'extend' ?
I think boundary = None might work julia-neme commented on 2026-07-27T00:21:43Z I am not aware of this condition, I only know extend (that just copies the nearest value) or fill (fills with something of your choice). I've actually changed it to fill with nans. |
|
View / edit / reply to this conversation on ReviewNB anton-seaice commented on 2026-07-19T23:31:51Z can these two lines be combined ?
these are just merged below anyway ? julia-neme commented on 2026-07-20T02:47:29Z I wanted that yes! But intake only opened one of them. So I had to open 1by1 and merge.
|
|
View / edit / reply to this conversation on ReviewNB anton-seaice commented on 2026-07-19T23:31:52Z Line #2. detadx = grid.interp(grid.diff(ds['sea_level'], 'X', boundary='extend'), 'Y', boundary='extend') / ds['dxu'] It's a bit hard to follow this, but it looks like this:
shouldn't step 3 be either: a. divide by b. moved to between steps 1 and 2
(Assuming B-grid)
This calculation presumably would need changing for C-grid, to get rid of the anton-seaice commented on 2026-07-19T23:59:12Z Hangon - i dont have that correct, ill revisit
anton-seaice commented on 2026-07-20T01:00:17Z
so that is correct for B-grid,
julia-neme commented on 2026-07-20T02:48:10Z Maybe I should change this to use the .derivative() function instead! |
|
Hangon - i dont have that correct, ill revisit
View entire conversation on ReviewNB |
|
View / edit / reply to this conversation on ReviewNB anton-seaice commented on 2026-07-20T00:51:13Z ο»Ώ@charles-turner-1ο»Ώ - this only works on older intake-catalogs, the new ones gives this error:
ESMDataSourceError: Failed to load dataset with key='ocean.fx.xu_ocean:3600.yu_ocean:2700.point'
You can use
anton-seaice commented on 2026-07-20T01:05:57Z I think there is a workaround for this already ? charles-turner-1 commented on 2026-07-20T02:49:58Z Yeah, there should be - in fact, I think it should already be in the newest environments.
Iβll double check when Iβm off the plane. The code needs a more sophisticated fix anyway which is already on the todo list julia-neme commented on 2026-07-27T00:22:48Z This works in the current stable analysis for me?
|
|
so that is correct for B-grid,
View entire conversation on ReviewNB |
|
I am not sure what to do for C-grid / MOM6
This recipe calculates the geostrophic velocities at the cell corner (b-grid) point and compares to model speed at the cell corner.
So for C-grid, to calculate speed, should we also interpolate to the model velocities to the corner point to calculate speed? |
|
I think there is a workaround for this already ? View entire conversation on ReviewNB |
|
I wanted that yes! But intake only opened one of them. So I had to open 1by1 and merge.
View entire conversation on ReviewNB |
|
So no change needed? View entire conversation on ReviewNB |
|
True! I can replace with And regarding the right combination, since discovering that I can use .derivative() you don't need to think about combining interp and diff, so I might change the script to use that.
(see comment below) View entire conversation on ReviewNB |
|
Yeah, there should be - in fact, I think it should already be in the newest environments.
Iβll double check when Iβm off the plane. The code needs a more sophisticated fix anyway which is already on the todo list View entire conversation on ReviewNB |
|
I think using
View entire conversation on ReviewNB |
|
I am not aware of this condition, I only know extend (that just copies the nearest value) or fill (fills with something of your choice). I've actually changed it to fill with nans. View entire conversation on ReviewNB |
|
Ok, so now I've included more information on how to adapt to mom6 ! Also changed to using .derivative() View entire conversation on ReviewNB |
|
This works in the current stable analysis for me?
View entire conversation on ReviewNB |
|
Thanks for the review @anton-seaice ! I've more info on mom6 adaptation and switched to using derivative. |
|
View / edit / reply to this conversation on ReviewNB anton-seaice commented on 2026-07-27T23:36:43Z If the experiments you want to use do not have surface velocities as available diagnostics, you can use the 3D velocity fields and select the top cell. Technically, this represents an average of velocities within that first cell, and it is not exactly velocity at the surface, but it might be good enough for your purposes.
I'm moderately confident there's no difference in model world between average velocities in the top layer and surface velocities.
Also, does this need a dot point to say you need to interpolation the velocities to the corner point with MOM6 output ? julia-neme commented on 2026-07-28T04:21:46Z Ahh I thought surface velocity was evaluated at the surface, didn't know it was the cell average. I'll remove that bit. Re the interpolation with mom6, I'll correct that too, but its up to the user where they want to do the interpolation to. |
|
View / edit / reply to this conversation on ReviewNB anton-seaice commented on 2026-07-27T23:36:44Z did you try boundary = 'none' ?
julia-neme commented on 2026-07-28T04:22:30Z Yeah, but it just fills the boundary with values and I'm not quite sure how its doing that since I couldn't find it in the documentation. Filling with nans seems the more cautious approach. |
|
Ahh I thought surface velocity was evaluated at the surface, didn't know it was the cell average. I'll remove that bit. Re the interpolation with mom6, I'll correct that too, but its up to the user where they want to do the interpolation to. View entire conversation on ReviewNB |
|
Yeah, but it just fills the boundary with values and I'm not quite sure how its doing that since I couldn't find it in the documentation. Filling with nans seems the more cautious approach. View entire conversation on ReviewNB |
|
View / edit / reply to this conversation on ReviewNB anton-seaice commented on 2026-08-14T00:11:53Z This step is kind of confusing. Whether or not its needed just depends on the limits above for u points and t points. I don't really have a good suggestion for it though |
anton-seaice
left a comment
There was a problem hiding this comment.
Thanks @julia-neme
This looks good.
This notebook is complicated and has lots of changes between B-grid and C-grid models. If we are serious about it being usable on C-grid, I think it needs a B-grid and a C-grid version of the notebook
This one was comparing geostrophic surface velocities from sea level to those of the first cell instead of
usurfvsurf, but otherwise OK. I've also updated intake loading.