Closed jamessmith1metoffice closed 5 months ago
I suspect this may be due to the fact that your mesh contains only two faces. From what I can tell about how bilinear regridding works in ESMF, ESMF will try and create "cells" out of the face centers based on how the faces are connected. The data on target points will then be a weighted average the data on the of the face centers which make up the nodes of that "cell". In order to make a geometrically proper cell, it seems like you would need at least three face centers, so I imagine this might be what is causing ESMF to segfault. If you were to create a simple mesh out of three faces, each of which was connected to each other, I suspect this might work.
Okay, understood. I will try that. But ESMF should not segfault, no? Should I open an issue somewhere else, perhaps?
I can confirm that it is my fault, so to speak. A cube with three faces works fine.
@scitools/peloton it sounds like the only way to "fix" this would be to handle within ESMF itself, or just possibly in ESMPy, since there is generally no way to catch this in Python. It seems like checking whether data is well-conditioned for this operation isn't really practical at the Python (ESMPy) level either. You could create a issue https://github.com/esmf-org/esmf
I have created an issue here:
Apologies in advance for the long listings. I thought it would be helpful to show my workings in full.
Note that I will invoke this function with location set to
Face
.When I create this cube and invoke the regridder...
...I get the following segmentation fault:
I have little idea of where to start to make sense of this. I am hoping it will make sense to you!
I would expect this either to throw a helpful error informing me that I cannot regrid a face-located cube with the bilinear scheme, or to run without exceptions.
The version is 0.9.0. I am running on Red Hat Enterprise Linux Client 7.9.