Closed
Description
Describe the bug
Area calculation is incorrect?
For mesh gridfile_fesom = current_path / "meshfiles" / "ugrid" / "fesom" / "fesom.mesh.diag.nc"
To Reproduce
Steps to reproduce the behavior:
sum of area comes to be 9776.665489773564
Expected behavior
Some message and more checks might be needed.
Metadata
Metadata
Labels
bugSomething isn't working
Type
Fields
Priority
None yet
Projects
- StatusShow more project fields✅ Done
Activity
erogluorhan commentedon Feb 25, 2026
Is this still the case or somehow fixed in the meantime?
Sevans711 commentedon Jul 13, 2026
This seems fine now? On uxarray 2026.6.0, I am getting:
Gives
8.378036745330922. This seems reasonable to me;grid.plot()looks like this:I can certainly believe this grid covers roughly 67% (
== area / (4 * np.pi)) of the surface.If this makes sense to you too please mark as closed!
rajeeja commentedon Jul 17, 2026
@Sevans711 Confirmed — the bad value is fixed; the FESOM mesh now gives ~8.38 sr, which is correct. I'll still add the error check this issue asked for: a warning when total face area exceeds the unit-sphere area (4π), so a malformed grid can't return garbage silently. That's in #1577, which will close this issue.
Sevans711 commentedon Jul 20, 2026
Clarifying: the error check proposed to be added to #1577 was removed, because it was originally added in a way that does not respect grid.sphere_radius (when not on unit sphere, area can easily be larger than 4π), and in a way that adds inefficiency to every face_areas computation since
face_areasdoesn't otherwise require summing across all faces.So, what remains to close this issue? I think doing both of the following would be sufficient:
grid.calculate_total_face_areas()(which is already doing a sum across all faces) whether the result is too large, and make warning if it is. This check should compute "too large" as "larger than4 * np.pi * grid.sphere_radius**2" not just 4π.