Decouple base mesh geometry / topology enumerations from low level lfric code - #463
Ricky Wong (mo-rickywong) wants to merge 8 commits into
Conversation
Thomas Bendall (tommbendall)
left a comment
There was a problem hiding this comment.
I don't really have any issues with the code itself, but I don't fully understand the motivation from the PR description. Is this to support apps like lfric2lfric which may have a single namelist but multiple meshes (with different geometry/topology)?
I think I understand that the reason that base_mesh_config_mod is now used in local_mesh_mod because it's too much work for a single PR to remove it? Removing geometry/topology from base_mesh_config would require all kernels still getting geometry/topology from base_mesh_config to be updated first -- but I do wonder if it would've been better to do that first? That would have avoided the confusing situation of infrastructure code now depending on namelists from components/driver, which is the consequence of this PR.
I also don't understand the suggestion in the description that the base_mesh_config should be moved out of LFRic-Core: it seems about the most core-y namelist there is!
Finally, please could you revert the changes to the log level in panel_decomposition_mod which are not related to this PR.
PS there is a typo in the title: geology -> geometry
geology / topology enumerations from low level lfric codegeometry / topology enumerations from low level lfric code
Yes, it's to support apps such as Lfric2Lfric, however, Lfric2lfric's issues only highlighted the problem. In most cases, it works out to be the same (1 mesh, checked to match the application etc), though it's not appropriate. This practice of using the
Doing that first would require all kernels to have the
That is temporary, it is taken care of in the preprocessing and uses the same enumerations as in
Base mesh is one of those, "sounded good at the time" type of namelists. It was the assumption that applications would only have one principle mesh. That's not really the case now. The driver layer should work on the mesh(es) that's its presented with, though it shouldn't really be deciding how an app configures the meshes for the app. The app should determine these then pass the meshes to infrastructure or components to work with. So the functionality of
|
|
Log levels reverted on this PR |
Ricky Wong (mo-rickywong)
left a comment
There was a problem hiding this comment.
changes made, back to scitech
Thomas Bendall (tommbendall)
left a comment
There was a problem hiding this comment.
Thanks for making those changes. mo-lucy-gordon this is ready for code review
PR Summary
Sci/Tech Reviewer: Thomas Bendall (@tommbendall)
Code Reviewer: mo-lucy-gordon
There are many places in the lfric core/apps core which use the mesh
geometry/topologynamelist settings to determine behaviour. These are taken frombase_config_mesh_mod, however, this namelist was never intended to be used as a proxy test for what mesh a piece of code operates on. The code should be querying the mesh object itself,base_mesh_config_modwas only to test if the mesh in the file matched the expected configuration.Existing code stills uses
geometry/topopogyenumerations and these are tied to thebase_mesh_config_mod. To decouplebase_mesh_configenumerations, the enumeration access is moved to themesh_typeobject. Some parts of the code may still be accessinggeometry/topologyfrom module scope without a clear access to the correctmesh_object. Until all parts of the code accessgeometry/topologyfrom the mesh object,local_mesh_modwill usebase_mesh_config_modand later on use fixed hardcoded enumeration values.Eventually,
base_mesh_configshould be moved out of components and be under the control of the application.Linked PRs
base_mesh_configgeology/topologyenumerations lfric_apps#757This PR is blocking
Code Quality Checklist
Testing
trac.log
Test Suite Results - lfric_core - DecoupleGeoTop/run1
Suite Information
Task Information
✅ succeeded tasks - 433
Security Considerations
Performance Impact
AI Assistance and Attribution
Documentation
PSyclone Approval
Sci/Tech Review
(Please alert the code reviewer via a tag when you have approved the SR)
Code Review