Refactor code implementing initial chi transform with respect to North Pole and Schmit stretching - #460
Open
Ricky Wong (mo-rickywong) wants to merge 10 commits into
Open
Conversation
Open
28 tasks
29 tasks
Ricky Wong (mo-rickywong)
marked this pull request as ready for review
September 3, 2026 11:15
Ricky Wong (mo-rickywong)
requested review from
a team and
Thomas Bendall (tommbendall)
as code owners
September 3, 2026 11:15
Ricky Wong (mo-rickywong)
requested review from
Mike Hobson (mike-hobson)
and removed request for
a team
September 3, 2026 11:15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
Sci/Tech Reviewer: Reviewer requested, awaiting confirmation
Code Reviewer: Mike Hobson (@mike-hobson)
While generating the chi fields from meshes, the routine init_chi_transform is called from init_fem. The implementation of this is rather complicated and has in the past resulted in changes to test-suite KGOs if altered. This PR refactors/simplifies the implementation.
Issues with the existing implementation.
The initial chi transform as it stands:
lfric2lfricapplication.init_chi_transform_modare uninitialized and require thatinit_chi_transformis called in order to prevent random data. The transform is only for certain meshes (spherical geometry), however, omitting the call toinit_chi_transformwhen not required still resulted in some KGO changes in the test-suite tasks.init_femfor each mesh in the mesh_collection.PR changes
init_fem.init_chi_transform_modso that they are for the default case, i.e. unrotated, unstretched mesh, to prevent random data.Out-of-Scope issue
The current change refactors and tidies the existing code. Though there is still the issue of assuming that all spherical meshes in an application will use the pole/stretching criteria held in the module sci_chi_transforms_mod. Specifically in the general case with lfric2lfric where source/destination meshes could potentially have different pole location/stretching criteria.
Linked PRs
init_chi_transformslfric_apps#749Code Quality Checklist
Testing
trac.log
Test Suite Results - lfric_core - RefactorChiTrans/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