Repository navigation
Only give lat/lon standard names to spherical meshes - #772
Conversation
The latitude and longitude of planar meshes are all zero and are not geographic coordinates, so CF-aware tools should not treat them as such. Move the latitude and longitude standard names out of MESH_VAR_ATTRS into SPHERE_VAR_ATTRS, add get_mesh_var_attrs() to combine them, and have add_mesh_attrs() only add them when on_a_sphere is YES. On a planar mesh, add_mesh_attrs() also removes these standard names, which meshes made with 2.2.0 have. MpasMeshConverter.x and MpasCellCuller.x likewise only write them for spherical meshes. Update the CF tests to check that planar meshes have no lat/lon standard names and spherical meshes do. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
TestingBecause this PR changes With that build, the reproducer from #770, extended through
From the repo root, pre-commit passes. Posted by Claude Code on @xylar's behalf. The testing, analysis and wording above are AI-authored; please check them accordingly. |
Since 2.2.0, planar meshes label
latCell,lonCell,latEdge,lonEdge,latVertexandlonVertexwithstandard_name: latitudeorlongitude. On a planar mesh these are all zero and are not geographic coordinates, so CF-aware tools shouldn't treat them as such.This PR:
MESH_VAR_ATTRSinto a newSPHERE_VAR_ATTRSinmpas_tools.mesh.attrs, and addsget_mesh_var_attrs(on_a_sphere)to combine the twoadd_mesh_attrs()add them only whenon_a_sphereisYES. On planar meshes it also removes these standard names if present, so that planar meshes made with 2.2.0 get cleaned up.MpasMeshConverter.xandMpasCellCuller.xwrite them only for spherical meshesFixes #770
Posted by Claude Code on @xylar's behalf. The testing, analysis and wording above are AI-authored; please check them accordingly.
🤖 Generated with Claude Code