xMIP icon indicating copy to clipboard operation
xMIP copied to clipboard

Calculating unprovided grid metrics from CMIP output?

Open emaroon opened this issue 3 years ago • 6 comments

I need to calculate divergence using generic CMIP ocean model output. Unfortunately, much of the needed grid information (dx/dy of the U/T cells) is not provided. After reading the discussions here and at xgcm, it seems like this is a known issue, so I'm hoping that maybe there's already a solution that I've been unable to find.

It looks like cmip_preprocessing can detect B-grid vs C-grid, which is very cool, and gets me part of the way there. The next issue is backing out the dx and dy's on T, U, and V-points from the lat_bnds and lon_bnds variables that are available and a little bit of trig. I can do this calculation in a kludgey way (that I hope is exact enough...) and then pass the dxs/dys as metrics to the xgcm.Grid object. However, maybe this problem has already been solved somewhere in cmip_preprocessing or xgcm and I just can't find the right documentation?

I apologize if this question is better asked over in xgcm or if this has long been figured out. I'm still on the steep part of the learning curve for xgcm.

emaroon avatar Jun 24 '22 22:06 emaroon

Hi @emaroon, thanks for raising the issue and using cmip6_pp. This is a longstanding issue, that I am currently working to solve. I have a long-standing discussion over at the pangeo-discourse and have started to bring some of the grid files I have gotten from modelling centers to the cloud in this pangeo-forge feedstock. I would really like for others to get involved in this effort!

This is however in a really early stage, and will need some TLC (renaming etc) to work and is only available for very few models at this point (I do have more in the pipeline, but am very busy this week). Shall we continue the discussion over there?

jbusecke avatar Jun 27 '22 16:06 jbusecke

Thanks for the quick response @jbusecke! Yes, let's continue this discussion on the pangeo-discourse. My current project aligns with your effort to collect CMIP6 grid files, and though unfamiliar with pangeo-forge, I should be able to help at least a little.

Of course, after I posted this, I found this notebook that you wrote, which should help me work around the missing grid metrics for a little while. But it would be much preferable to have the original grid files and avoid the Arctic issues that you demonstrated.

emaroon avatar Jun 27 '22 17:06 emaroon

Yes that should be a good work around, and I should have totally mentioned that (sorry for the oversight). But I agree, this functionality does a) not really belong into cmip6_pp (its much more general) and b) is really only a crutch until we can get the native grids.

jbusecke avatar Jun 27 '22 18:06 jbusecke

Minor point: I note a new effort specific to Australian modelling efforts - https://www.access-nri.org.au/ - that is spinning up. Now is a great time to highlight this issue, at least in the Australian community context. I'll do that today in their Slack channels.

Thomas-Moore-Creative avatar Jun 28 '22 23:06 Thomas-Moore-Creative

Would love to learn more @Thomas-Moore-Creative.

jbusecke avatar Jun 28 '22 23:06 jbusecke

Would love to learn more @Thomas-Moore-Creative.

I've suggested that ACCESS-NRI staff reach out to you as I know you're keen to work collaboratively to make things better for the community.

Thomas-Moore-Creative avatar Jun 28 '22 23:06 Thomas-Moore-Creative