fitting an MPIOM curvilinear grid
See original GitHub issueHas anyone worked with MPIOM/MPIESM ocean in xgcm
?
I started to play around with xgcm
based on the tutorial. I have a large fx
file which has a bunch of variables describing the distance between different parameters of a grid box and a ds
with a few variables which are saved on different grids 'x','y'
for T and S, and for instance 'x_2','y_2'
for u-velocities which is just slightly shifted on the corner of that grid box.
Mostly, I am hoping you guys know someone who got this already work. I tried from xgcm.autogenerate import generate_grid_ds
but actually dont yet get the concept of xgcm
. Eventually, I want to calculate divergence and budgets (with xgcm
). Is this possible with these ds
and fx
file?
Right now, I dont get the grid = Grid(ds)
command running as in the tutorials.
timestr='3171*'
ds = xr.open_mfdataset(f'/work/bm1124/m300524/experiments/asp_esmControl_PMassim_3014_T_over_3170/outdata/mpiom/asp_esmControl_PMassim_3014_T_over_3170_mpiom_data_3d_mm_{timestr}.nc')
fx = xr.open_dataset('/work/bm1124/m300524/experiments/asp_esmControl_PMassim_3014_T_over_3170/outdata/mpiom/asp_esmControl_PMassim_3014_T_over_3170_mpiom_fx_31700101_31701231.nc')
for v in fx.data_vars:
try:
print(v,'\t',fx[v].attrs['long_name'],fx[v].load().coords,'\n')
except:
pass
alatv Latitude at v vector point Coordinates:
lon (y, x) float64 -47.37 -47.82 -48.26 -48.68 ... 131.3 132.5 133.8
lat (y, x) float64 76.41 76.35 76.29 76.22 ... -77.25 -77.39 -77.54
* depth (depth) float64 0.0
* time (time) object 3170-01-01 00:00:00
alonv Longitude at v vector point Coordinates:
lon (y, x) float64 -47.37 -47.82 -48.26 -48.68 ... 131.3 132.5 133.8
lat (y, x) float64 76.41 76.35 76.29 76.22 ... -77.25 -77.39 -77.54
* depth (depth) float64 0.0
* time (time) object 3170-01-01 00:00:00
deptho Depth at pressure point Coordinates:
lon_2 (y_2, x_2) float64 -47.25 -47.69 -48.12 ... 131.3 132.5 133.8
lat_2 (y_2, x_2) float64 76.36 76.3 76.24 76.17 ... -77.25 -77.39 -77.54
* depth (depth) float64 0.0
* time (time) object 3170-01-01 00:00:00
dlxp Grid x distance at pressure point Coordinates:
lon_2 (y_2, x_2) float64 -47.25 -47.69 -48.12 ... 131.3 132.5 133.8
lat_2 (y_2, x_2) float64 76.36 76.3 76.24 76.17 ... -77.25 -77.39 -77.54
* depth (depth) float64 0.0
* time (time) object 3170-01-01 00:00:00
dlyp Grid y distance at pressure point Coordinates:
lon_2 (y_2, x_2) float64 -47.25 -47.69 -48.12 ... 131.3 132.5 133.8
lat_2 (y_2, x_2) float64 76.36 76.3 76.24 76.17 ... -77.25 -77.39 -77.54
* depth (depth) float64 0.0
* time (time) object 3170-01-01 00:00:00
areacello Cell area Coordinates:
lon_2 (y_2, x_2) float64 -47.25 -47.69 -48.12 ... 131.3 132.5 133.8
lat_2 (y_2, x_2) float64 76.36 76.3 76.24 76.17 ... -77.25 -77.39 -77.54
* depth (depth) float64 0.0
* time (time) object 3170-01-01 00:00:00
alatu Latitude at u vector point Coordinates:
lon_3 (y_3, x_3) float64 -47.48 -47.91 -48.34 ... 131.9 133.2 134.4
lat_3 (y_3, x_3) float64 76.33 76.27 76.21 76.14 ... -77.32 -77.47 -77.61
* depth (depth) float64 0.0
* time (time) object 3170-01-01 00:00:00
alonu Longitude at u vector point Coordinates:
lon_3 (y_3, x_3) float64 -47.48 -47.91 -48.34 ... 131.9 133.2 134.4
lat_3 (y_3, x_3) float64 76.33 76.27 76.21 76.14 ... -77.32 -77.47 -77.61
* depth (depth) float64 0.0
* time (time) object 3170-01-01 00:00:00
weto Sea binary mask at pressure point Coordinates:
lon_2 (y_2, x_2) float64 -47.25 -47.69 -48.12 ... 131.3 132.5 133.8
lat_2 (y_2, x_2) float64 76.36 76.3 76.24 76.17 ... -77.25 -77.39 -77.54
* depth_2 (depth_2) float64 6.0 17.0 27.0 37.0 ... 4.67e+03 5.17e+03 5.72e+03
* time (time) object 3170-01-01 00:00:00
dlxpsi Grid x distance at psi point Coordinates:
lon_4 (y_4, x_4) float64 -47.36 -47.78 -48.2 -48.61 ... 132.2 133.5 133.5
lat_4 (y_4, x_4) float64 76.28 76.22 76.16 76.09 ... -77.19 -77.33 -77.33
* depth (depth) float64 0.0
* time (time) object 3170-01-01 00:00:00
dlypsi Grid y distance at psi point Coordinates:
lon_4 (y_4, x_4) float64 -47.36 -47.78 -48.2 -48.61 ... 132.2 133.5 133.5
lat_4 (y_4, x_4) float64 76.28 76.22 76.16 76.09 ... -77.19 -77.33 -77.33
* depth (depth) float64 0.0
* time (time) object 3170-01-01 00:00:00
dduo Ocean level thickness at u vector point Coordinates:
lon_3 (y_3, x_3) float64 -47.48 -47.91 -48.34 ... 131.9 133.2 134.4
lat_3 (y_3, x_3) float64 76.33 76.27 76.21 76.14 ... -77.32 -77.47 -77.61
* depth_2 (depth_2) float64 6.0 17.0 27.0 37.0 ... 4.67e+03 5.17e+03 5.72e+03
* time (time) object 3170-01-01 00:00:00
dlxu Grid x distance at u vector point Coordinates:
lon_3 (y_3, x_3) float64 -47.48 -47.91 -48.34 ... 131.9 133.2 134.4
lat_3 (y_3, x_3) float64 76.33 76.27 76.21 76.14 ... -77.32 -77.47 -77.61
* depth (depth) float64 0.0
* time (time) object 3170-01-01 00:00:00
dlyu Grid y distance at u vector point Coordinates:
lon_3 (y_3, x_3) float64 -47.48 -47.91 -48.34 ... 131.9 133.2 134.4
lat_3 (y_3, x_3) float64 76.33 76.27 76.21 76.14 ... -77.32 -77.47 -77.61
* depth (depth) float64 0.0
* time (time) object 3170-01-01 00:00:00
ddue Ocean level thickness at v vector point Coordinates:
lon (y, x) float64 -47.37 -47.82 -48.26 -48.68 ... 131.3 132.5 133.8
lat (y, x) float64 76.41 76.35 76.29 76.22 ... -77.25 -77.39 -77.54
* depth_2 (depth_2) float64 6.0 17.0 27.0 37.0 ... 4.67e+03 5.17e+03 5.72e+03
* time (time) object 3170-01-01 00:00:00
dlxv Grid x distance at v vector point Coordinates:
lon (y, x) float64 -47.37 -47.82 -48.26 -48.68 ... 131.3 132.5 133.8
lat (y, x) float64 76.41 76.35 76.29 76.22 ... -77.25 -77.39 -77.54
* depth (depth) float64 0.0
* time (time) object 3170-01-01 00:00:00
dlyv Grid y distance at v vector point Coordinates:
lon (y, x) float64 -47.37 -47.82 -48.26 -48.68 ... 131.3 132.5 133.8
lat (y, x) float64 76.41 76.35 76.29 76.22 ... -77.25 -77.39 -77.54
* depth (depth) float64 0.0
* time (time) object 3170-01-01 00:00:00
alat Latitude at pressure point Coordinates:
lon_2 (y_2, x_2) float64 -47.25 -47.69 -48.12 ... 131.3 132.5 133.8
lat_2 (y_2, x_2) float64 76.36 76.3 76.24 76.17 ... -77.25 -77.39 -77.54
* depth (depth) float64 0.0
* time (time) object 3170-01-01 00:00:00
alon Longitude at pressure point Coordinates:
lon_2 (y_2, x_2) float64 -47.25 -47.69 -48.12 ... 131.3 132.5 133.8
lat_2 (y_2, x_2) float64 76.36 76.3 76.24 76.17 ... -77.25 -77.39 -77.54
* depth (depth) float64 0.0
* time (time) object 3170-01-01 00:00:00
ddpo Ocean level thickness at pressure point Coordinates:
lon_2 (y_2, x_2) float64 -47.25 -47.69 -48.12 ... 131.3 132.5 133.8
lat_2 (y_2, x_2) float64 76.36 76.3 76.24 76.17 ... -77.25 -77.39 -77.54
* depth_2 (depth_2) float64 6.0 17.0 27.0 37.0 ... 4.67e+03 5.17e+03 5.72e+03
* time (time) object 3170-01-01 00:00:00
deuto Depth at u vector point Coordinates:
lon_3 (y_3, x_3) float64 -47.48 -47.91 -48.34 ... 131.9 133.2 134.4
lat_3 (y_3, x_3) float64 76.33 76.27 76.21 76.14 ... -77.32 -77.47 -77.61
* depth (depth) float64 0.0
* time (time) object 3170-01-01 00:00:00
amsue Sea binary mask at v vector point Coordinates:
lon (y, x) float64 -47.37 -47.82 -48.26 -48.68 ... 131.3 132.5 133.8
lat (y, x) float64 76.41 76.35 76.29 76.22 ... -77.25 -77.39 -77.54
* depth_2 (depth_2) float64 6.0 17.0 27.0 37.0 ... 4.67e+03 5.17e+03 5.72e+03
* time (time) object 3170-01-01 00:00:00
amsuo Sea binary mask at u vector point Coordinates:
lon_3 (y_3, x_3) float64 -47.48 -47.91 -48.34 ... 131.9 133.2 134.4
lat_3 (y_3, x_3) float64 76.33 76.27 76.21 76.14 ... -77.32 -77.47 -77.61
* depth_2 (depth_2) float64 6.0 17.0 27.0 37.0 ... 4.67e+03 5.17e+03 5.72e+03
* time (time) object 3170-01-01 00:00:00
deute Depth at v vector point Coordinates:
lon (y, x) float64 -47.37 -47.82 -48.26 -48.68 ... 131.3 132.5 133.8
lat (y, x) float64 76.41 76.35 76.29 76.22 ... -77.25 -77.39 -77.54
* depth (depth) float64 0.0
* time (time) object 3170-01-01 00:00:00
thkcello Cell thickness Coordinates:
lon_2 (y_2, x_2) float64 -47.25 -47.69 -48.12 ... 131.3 132.5 133.8
lat_2 (y_2, x_2) float64 76.36 76.3 76.24 76.17 ... -77.25 -77.39 -77.54
* depth_2 (depth_2) float64 6.0 17.0 27.0 37.0 ... 4.67e+03 5.17e+03 5.72e+03
* time (time) object 3170-01-01 00:00:00
for v in ds[['thetao','so','umo','vmo','wmo']].data_vars:
try:
print(v,'\t',ds[v].attrs['long_name'],ds[v].load().coords,'\n')
except:
pass
thetao Sea water potential temperature Coordinates:
lon (y, x) float64 -47.25 -47.69 -48.12 -48.54 ... 131.3 132.5 133.8
lat (y, x) float64 76.36 76.3 76.24 76.17 ... -77.25 -77.39 -77.54
* depth (depth) float64 6.0 17.0 27.0 37.0 ... 4.67e+03 5.17e+03 5.72e+03
* time (time) object 3171-01-31 23:15:00 ... 3171-12-31 23:15:00
so Sea water salinity Coordinates:
lon (y, x) float64 -47.25 -47.69 -48.12 -48.54 ... 131.3 132.5 133.8
lat (y, x) float64 76.36 76.3 76.24 76.17 ... -77.25 -77.39 -77.54
* depth (depth) float64 6.0 17.0 27.0 37.0 ... 4.67e+03 5.17e+03 5.72e+03
* time (time) object 3171-01-31 23:15:00 ... 3171-12-31 23:15:00
umo Ocean mass x transport Coordinates:
lon_2 (y_2, x_2) float64 -47.48 -47.91 -48.34 ... 131.9 133.2 134.4
lat_2 (y_2, x_2) float64 76.33 76.27 76.21 76.14 ... -77.32 -77.47 -77.61
* depth (depth) float64 6.0 17.0 27.0 37.0 ... 4.67e+03 5.17e+03 5.72e+03
* time (time) object 3171-01-31 23:15:00 ... 3171-12-31 23:15:00
vmo Ocean mass y transport Coordinates:
lon_3 (y_3, x_3) float64 -47.37 -47.82 -48.26 ... 131.3 132.5 133.8
lat_3 (y_3, x_3) float64 76.41 76.35 76.29 76.22 ... -77.25 -77.39 -77.54
* depth (depth) float64 6.0 17.0 27.0 37.0 ... 4.67e+03 5.17e+03 5.72e+03
* time (time) object 3171-01-31 23:15:00 ... 3171-12-31 23:15:00
wmo Upward ocean mass transport Coordinates:
lon (y, x) float64 -47.25 -47.69 -48.12 -48.54 ... 131.3 132.5 133.8
lat (y, x) float64 76.36 76.3 76.24 76.17 ... -77.25 -77.39 -77.54
* depth_2 (depth_2) float64 0.0 12.0 22.0 32.0 ... 4.92e+03 5.42e+03 6.02e+03
* time (time) object 3171-01-31 23:15:00 ... 3171-12-31 23:15:00
The files are quite large. fx
is 90MB and 6 variables is ds
are 70MB. (Where should I upload them?)
Issue Analytics
- State:
- Created 4 years ago
- Comments:15 (7 by maintainers)
Top GitHub Comments
Absolutely understandable. If you have a skeleton notebook and the data accessible I can also polish it and take care of the PR.
I asked a bit around in our institute. Having different priorities now. But this issue isn’t completely forgotten. Probably it fits the examples better than here