iris icon indicating copy to clipboard operation
iris copied to clipboard

Allow creation of area weights for Lambert Conformal Grids

Open nhsavage opened this issue 3 years ago • 13 comments

✨ Feature Request

iris.analysis.cartography.area_weights should work for cubes on a Lambert Conformal Grid

Motivation

at the current time, the iris.analysis.cartography.area_weights function only supports spherical geometries (regular lat/lon and rotated pole). Many regional climate models (and other related data) are on other projections. One common example for Europe is the Lambert conformal grid which is used by the REGCM climate model for Europe

Additional context

documentation for iris.analysis.cartography.area_weights states The cube must have coordinates ‘latitude’ and ‘longitude’ with bounds.

nhsavage avatar Jun 17 '22 13:06 nhsavage

Thanks @nhsavage. We've discussed this in the @SciTools/peloton and we expect it would be non-trivial! If you know that this would be widely used, please encourage people to vote so that we know it's worth it!

trexfeathers avatar Jun 22 '22 09:06 trexfeathers

@nhsavage Do you have some example lambert conformal grid data that you could share with me? 😄

bjlittle avatar Jun 23 '22 14:06 bjlittle

Related to https://github.com/SciTools-incubator/iris-esmf-regrid/pull/198

bjlittle avatar Oct 17 '22 08:10 bjlittle

sample data at /data/users/fris/REGCM/EAS-22/tas_EAS-22_NCC-NorESM1-M_historical_r1i1p1_ICTP-RegCM4-4_v0_mon_199101-200012.nc

nhsavage avatar Oct 17 '22 09:10 nhsavage

see also https://github.com/ESMValGroup/ESMValCore/issues/1156

nhsavage avatar Oct 17 '22 09:10 nhsavage

@nhsavage Do you know if there is a mathematical formula for calculating the area of a cell in the Lambert Conformal projection ?

Also, do you have a deadline for a resolution to this issue ? That would help us prioritise on this end, thanks.

(ping @ehogan)

bjlittle avatar Nov 29 '23 10:11 bjlittle

I am sure there is a formula but I don't have a reference for it. I couldn't find anything with a quick Google.

nhsavage avatar Nov 29 '23 12:11 nhsavage

CDO is able to do this, but it doesn't give a reference. http://www.idris.fr/media/ada/cdo.pdf 2.15.3. GRIDCELL - Grid cell quantities

I guess the source code might contain some clues. https://code.mpimet.mpg.de/attachments/29019 file is src/grid_area.cc

I guess if push comes to shove, for ESMValTool we could perhaps use this to make a grid cell area file if it is missing

nhsavage avatar Nov 29 '23 15:11 nhsavage

as for deadline - there is no specific date. While this issue remains unresovled, people are unable to use ESMValTool for analysis of data with Lambert conformal conic grids. This means they find alternative solutions (regridding to a lat/lon grid, using a different tool). This menas there is no specific deadline

nhsavage avatar Nov 29 '23 15:11 nhsavage

Another thing to consider here is that there are multiple projected coordinate systems in use in CORDEX data and so a generic solution would be better if we could come up with one. We don't need areas as such, only area weights. Could this funciton from ESMPy help? https://earthsystemmodeling.org/esmpy_doc/release/ESMF_8_0_1/html/field.html#ESMF.api.field.Field.get_area

nhsavage avatar Dec 05 '23 09:12 nhsavage

@nhsavage I suspect ESMPy could get you close to the area weights, but I imagine there would be a slight difference between the weights ESMPy gives you and the "proper" weights due to the difference what counts as a straight line between two points in a given projection and what counts in ESMF (always a great circle arc). If such an answer would be close enough, there could be a case for adding this as a feature to iris-esmf-regrid in order to keep the iris dependencies minimal.

stephenworsley avatar Dec 05 '23 09:12 stephenworsley

As mentioned here https://github.com/ESMValGroup/ESMValCore/issues/1156#issuecomment-1840648041, there may be a solution possible via iris-esmf-regrid. If this solution works, this would become less of a priority in Iris, though it would still be good to have a solution in Iris if we were able to get better accuracy by using explicit fomulae.

stephenworsley avatar Dec 05 '23 12:12 stephenworsley