New function space options for coordinate fields#238
Open
tommbendall wants to merge 22 commits intoMetOffice:mainfrom
Open
New function space options for coordinate fields#238tommbendall wants to merge 22 commits intoMetOffice:mainfrom
tommbendall wants to merge 22 commits intoMetOffice:mainfrom
Conversation
29 tasks
thomasmelvin
approved these changes
Jan 26, 2026
Contributor
thomasmelvin
left a comment
There was a problem hiding this comment.
All the changes look good.
As a comment for future development I think it would be good if correctly specified the element order when creating functions spaces (instead of being built on a single element order for the derahm complex as was originally envisioned).
i.e. The lowest order W0 space would be:
w0_fs = function_space_collection%get_fs(mesh, 1, 1, W0)
and our default Wtheta space would be
wt_fs = function_space_collection%get_fs(mesh, 0, 1, Wtheta)
This was referenced Mar 9, 2026
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: @EdHone
This adds two new namelist options for the function spaces used by the coordinate fields:
When
Wthetais used as the function space, the vertical coordinate order is kept as 0, making the coordinates linear in the vertical. These options are an optimisation to the coordinate fields, which will facilitate us moving tocoord_order=2which gives a significant boost in NWP score:Wthetaspace allows us to have fewer DoFs per cell (see below)Details
The key changes in this PR are:
coord_ordervariablecoord_system='xyz', which which case the coordinate space should be isotropic andcoord_orderis used in both horizontal and vertical directionsWchispace have been changed toANY_SPACE_9(this is not necessary but feels safe)configuration.nmlfiles and unit-tests where relevantThis table illustrates some of the coordinate function space options:
Please See
This branch is built on the changes in #284, 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 #284, 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.Code Quality Checklist
Testing
trac.log
Test Suite Results - lfric_core - test_coord_space_core/run4
Suite Information
Task Information
✅ succeeded tasks - 384
Task Information
✅ succeeded tasks - 372
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