-
Notifications
You must be signed in to change notification settings - Fork 66
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
A Documented Example on how to use xgcm
with cosima output is wanted
#164
Comments
Agreed this would be good. We currently have:
|
@adele157 re. your first point, I thought |
That is,
Is this clarifying enough? |
Yep, thanks, that's what I thought! So we need both |
I made a regridding one with xesmf at some point: let's revisit that --> https://cosima-recipes.readthedocs.io/en/latest/documented_examples/Regridding.html#gallery-documented-examples-regridding-ipynb |
Thanks, I've used |
Sorry for confusion and thanks for clarification. I’ve only used xgcm
before in the vertical (where it does do regridding) not the horizontal.
…On Mon, Jan 23, 2023 at 12:18 PM, Andrew Kiss ***@***.***> wrote:
Thanks, I've used xesmf a lot, but not xgcm. I'd just been confused by
Adele's suggestion of xgcm for horizontal regridding, but it turns out
that's not a thing.
—
Reply to this email directly, view it on GitHub
<#164 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACA44UYWPHZJKEMZYBYMSZ3WTXL7TANCNFSM6AAAAAARVWZUVA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
[ waves ] Hi folks. I'm a 100% COSIMA Cookbook noob - with all of 1 hour under my belt. I'm wondering if there is a CC "key" to pull in all the |
like the grid specs that but there are few examples in the recipes that use |
There have been some proposals to store grid info in the cookbook database, but none implemented as yet - e.g. see COSIMA/cosima-cookbook#191 and #190 |
folder = '/g/data/hh5/tmp/cosima/access-om2-025/025deg_jra55v13_iaf_gmredi6/output000/ocean/'
grid = xr.open_mfdataset(folder + 'ocean_grid.nc', combine='by_coords')
ds = xr.merge([u, v, grid])
ds.coords['xt_ocean'].attrs.update(axis='X')
ds.coords['xu_ocean'].attrs.update(axis='X', c_grid_axis_shift=0.5)
ds.coords['yt_ocean'].attrs.update(axis='Y')
ds.coords['yu_ocean'].attrs.update(axis='Y', c_grid_axis_shift=0.5)
metrics = {
('X',): ['dxt', 'dxu'], # X distances
('Y',): ['dyt', 'dyu'], # Y distances
('X', 'Y'): ['area_t', 'area_u'] # Areas
}
grid = xgcm.Grid(ds, periodic=['X'], metrics=metrics)
ζ_xgcm = grid.interp(grid.derivative(v, 'X'), 'Y', boundary='extend') - grid.interp(grid.derivative(u, 'Y'), 'X')
ζ_xgcm We need to update the relative vorticity example. Another job for the Hackathon v2.0. |
#151 is definitely related here (if we'll update the relative vorticity example) |
That's coming out from the discussion in Cosima workshop 2022.
cc @janjaapmeijer
The text was updated successfully, but these errors were encountered: