New function space options for coordinate fields#179
Open
tommbendall wants to merge 38 commits intoMetOffice:mainfrom
Open
New function space options for coordinate fields#179tommbendall wants to merge 38 commits intoMetOffice:mainfrom
tommbendall wants to merge 38 commits intoMetOffice:mainfrom
Conversation
29 tasks
iboutle
requested changes
Mar 13, 2026
There was a problem hiding this comment.
As discussed, "cbl" and "rad_gas" lfric_atm idealised tests are erroneously having their initial wind set to 0 by this, because they use smp_init_wind=true with the wtheta co-ordinate. lfric_atm uses smp_init_wind=true, because using false results in a projection being done, which leads to noisy profiles - this is the only way to get exactly what is in the namelist. I can think of 3 possible options:
- change these tests back to using the wchi co-ordinate
- change these tests to use the pw_linear vertical profile, with just a single value specified to replace the current constant_uv values
- make the sample_initial_u kernel use da_at_w2 instead of chi
I have no strong preference which!
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: @thomasmelvin
Code Reviewer:
This PR picks up on the new coordinate field namelist options from MetOffice/lfric_core#238, and sets some key apps to use the new Wtheta coordinate space.
A handful of science changes were necessary to get this to work -- these are detailed below. Otherwise, the vast majority of changes involve the addition of the new namelist options into all of the required files.
Please See
This branch is built on the changes in #277, and until that is merged the diff on this PR will also include the changes from that branch. I have created PRs in my own fork to show useful diffs for reviewing:
Linked-To
Blocked-By
This branch includes the changes from #277, which are necessary to be able to safely use a Wtheta space for the coordinate fields.
Blocks
The ultimate aim of this work is to facilitate moving to
coord_order=2to give a better representation of the orography.Details
Some science changes were necessary to allow the use of a Wtheta-like coordinate space:
chiis discontinuous, and modify the DoFs in place. I have rewritten this file to make a copy ofchibefore the coordinates are adjusted to account for orography, which allows them to work in the case of (partial) continuitycoordinate_basedoption for specifying LBCs assumes the coordinate values are in the corner of DoFs. To ensure this still works, I copy the coordinate fields intoWchiWchispace. To avoid issues, the kernel has been changed to avoid using the chi field, and instead uses the dA_at_w2 field (which will be valid for any coordinate options)Otherwise the changes involve picking up the Core branch:
Wchispace have been changed toANY_SPACE_9(this is not necessary but feels safe)configuration.nmlfilesfeign_configsin unit-testsgungho_model,lfric_atm,linear_modelandjedi_lfricapps use theWthetacoordinate spaceResults
The attached PDFs show plots from the gungho_model and lfric_atm test suites, indicating that the change to use a Wtheta-like coordinate space is science-neutral:
Some timing results are shown in the following table, showing changes to timing are within normal variability for this change (note that bigger savings are expected when comparing between
'Wchi'and'Wtheta'coordinate spaces forcoord_order=2)coord_space='Wchi'coord_space='Wtheta'Code Quality Checklist
Testing
trac.log
Test Suite Results - lfric_apps - test_coord_space_apps/run27
Suite Information
Task Information
✅ succeeded tasks - 1511
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