Skip to content
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

iris.analysis.cartography.area_weights() not working with 2D ocean coordinates #380

Closed
valeriupredoi opened this issue Nov 22, 2019 · 3 comments
Assignees
Labels
enhancement New feature or request preprocessor Related to the preprocessor

Comments

@valeriupredoi
Copy link
Contributor

valeriupredoi commented Nov 22, 2019

Problem

iris.analysis.cartography.area_weights calls it a day when cube.coord("latitude") and/or cube.coord("longitude") are 2D

When using _volume.volume_statistics() area_weights need to be computed that crashes when passed in ocean data with 2D coords

Specialists like @ledm @zklaus @bjlittle should chip in here plese 🍺

@valeriupredoi
Copy link
Contributor Author

@zklaus says: Fortunately, it is also unnecessary: the information of the area is available in areacello.

The reason why iris does not provide this information is that it is really hard impossible to calculate in general. It becomes merely really hard when you accept the simplication of connecting points with arcs of great-circles. In that case, triangulation of cells with triangles on the surface of a sphere is possible, as done by cdo. This is, however, not a good approximation for some of the most common model grids.

This would be a problem with ideal model data. In reality, the problem is larger. Take as a case study the orca grids as used by nemo. They have two poles that come to lie at the top row of the data after unwrapping of the grid. But to ensure computational continuity, the two top rows are repeated and prepended to the data, this time mirrored left to right. Consequently, taking the coordinates just from that row for all rows is not merely dramatically wrong (as it would be if you took the, say, tenth row) but really in completely unrelated areas of the world.

@zklaus
Copy link

zklaus commented Nov 22, 2019

PS: (Ofx, areacello) should be available more reliably than other ocean measures like volcello because the variation generally stems from variations in layer thickness, either from a free surface or a density or bathymetry based vertical coordinate,none of which influence purely horizontal quantities like the area.

@schlunma
Copy link
Contributor

I think this can be closed, we have very good solutions for this now:

Feel free to re-open if necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request preprocessor Related to the preprocessor
Projects
None yet
4 participants