question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

fitting an MPIOM curvilinear grid

See original GitHub issue

Has 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?)

https://github.com/xgcm/xgcm/issues/142

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
jbuseckecommented, Jun 25, 2021

Absolutely understandable. If you have a skeleton notebook and the data accessible I can also polish it and take care of the PR.

1reaction
aaronspringcommented, Jun 24, 2021

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Max-Planck-Institute Global Ocean/Sea-Ice Model MPI-OM
sure the positions fit to the grid runoff obs and runoff pos have to be specif- ... 4.4: Standard MPI-OM orthogonal curvilinear grid...
Read more >
Supported Models - ESM Tools documentation
MPIOM is a primitive equation model (C-Grid, z-coordinates, free surface) with the ... global ocean/sea ice model with orthogonal curvilinear coordinates.
Read more >
ocean model mpiom: Topics by Science.gov
We establish the following model setup: We use the Max Planck Institute Ocean Model (MPIOM) on a tripolar grid with 45km horizontal resolution...
Read more >
A High-Efficient Scalable Solver for the Global Ocean/Sea-Ice ... - KIT
horizontal discretization in HOPE was based on a staggered Arakawa E-grid, MPIOM makes use of a curvilinear C-grid [2]. There are mainly two...
Read more >
Model grid (only every fifth grid line is displayed) and land-sea ...
orthogonal curvilinear grid allows for an arbitrary placement of the grid poles ... The ocean component used for the MPI-ESM-P simulations is the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found