Skip to content

Higher-order Orography#180

Open
tommbendall wants to merge 114 commits intoMetOffice:mainfrom
tommbendall:TBendall/HighOrderOrog
Open

Higher-order Orography#180
tommbendall wants to merge 114 commits intoMetOffice:mainfrom
tommbendall:TBendall/HighOrderOrog

Conversation

@tommbendall
Copy link
Contributor

@tommbendall tommbendall commented Jan 23, 2026

PR Summary

Sci/Tech Reviewer: @atb1995
Code Reviewer: @harry-shepherd

This PR implements the capability to represent orography with higher-order finite elements. This allows the heights of cell centres to be match the values defined in the orography ancillary files, and avoids loss of power in the orography from the process of averaging from W3 to W0 points. This has shown a significant improvement in NWP scores.

Please See

This branch is built on the changes in #277 and #179, and until those PRs are merged, the diff on this PR will also include the changes from those branches. 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 and #179, which are necessary to use the increased coordinate order efficiently.

Details

The changes in this PR can be summarised as:

  1. Ensure that the surface_altitude field has a degree that is specified through a new namelist option (and is not inherited from element_order)
  2. Reorganise orography namelist, to make this more coherent by:
  • moving n_orog_smooth into the orography namelist from initialization
  • moving w0_orography_mapping into the orography namelist and renaming it as w0_multigrid_mapping
  • introducing the orography_order option
  1. Set coord_order=2, orography_order=2 and w0_multigrid_mapping=.true. as default for the gungho_model, lfric_atm, lfric_coupled, linear_model and jedi_lfric_tests apps (which updates KGOs)
  2. science/gungho/source/orography/assign_orography_field_mod.F90 is directly passed surface_altitude_w0. Previously the W3 field was passed in here, which meant that the mapping from W3 to W0 and a deep halo exchange were duplicated for setting the orography for both the prime and shifted meshes
  3. science/gungho/source/orography/setup_orography_alg_mod.x90: this is the most significant coding change, as this file has been reorganised to ensure that:
  • the surface_altitude_w0 field has the appropriate element order
  • the restriction/prolongation to form the surface_altitude fields on other meshes is handled appropriately with the new option

Results

Plots from the gungho_model and lfric_atm test suites for the changes in this PR are shown in the following PDFs. The only significant difference comes in the gungho_model DCMIP mountain test, which shows that the mountain is now being resolved properly.

The use of quadratic coordinate order has shown considerable improvement in NWP scores. For results, see:

Some timing results are shown in the following table. The change to use coord_order=2 will increase costs for the calculation of the runtime constants, and parts of the timestep that use chi: map_physics_fields and the conversions between the W2 wind field and Cartesian components for transport, but this table shows that the increase in runtime is small (1-3% of timestepping cost) and should be acceptable for the level of scientific improvement.

timestepping vn3.1: coord_space='Wchi', coord_order=1 #179: coord_space='Wtheta', coord_order=1 #180: coord_space'Wtheta', coord_order=2
UKV 312.62 312.38 324.05
C48 climate 333.72 335.41 343.26
C224 221.83 220.18 222.62
C896 416.21 413.34 419.47
C896 performance 2403.87 2391.93 2414.40

Code Quality Checklist

  • I have performed a self-review of my own code
  • My code follows the project's style guidelines
  • Comments have been included that aid understanding and enhance the readability of the code
  • My changes generate no new warnings
  • All automated checks in the CI pipeline have completed successfully

Testing

  • I have tested this change locally, using the LFRic Core rose-stem suite
  • If required (e.g. API changes) I have also run the LFRic Apps test suite using this branch
  • If any tests fail (rose-stem or CI) the reason is understood and acceptable (e.g. kgo changes)
  • I have added tests to cover new functionality as appropriate (e.g. system tests, unit tests, etc.)
  • Any new tests have been assigned an appropriate amount of compute resource and have been allocated to an appropriate testing group (i.e. the developer tests are for jobs which use a small amount of compute resource and complete in a matter of minutes)

trac.log

Test Suite Results - lfric_apps - test_high_order_orog/run12

Suite Information

Item Value
Suite Name test_high_order_orog/run12
Suite User thomas.bendall
Workflow Start 2026-03-19T17:49:43
Groups Run all
Dependency Reference Main Like
casim MetOffice/casim@2026.03.2 True
jules MetOffice/jules@2026.03.2 True
lfric_apps tommbendall/lfric_apps@TBendall/TestHighOrderOrog False
lfric_core tommbendall/lfric_core@TBendall/CoordSpace True
moci MetOffice/moci@2026.03.2 True
SimSys_Scripts MetOffice/SimSys_Scripts@2026.03.2 True
socrates MetOffice/socrates@2026.03.2 True
socrates-spectral MetOffice/socrates-spectral@2026.03.2 True
ukca MetOffice/ukca@2026.03.2 True

Task Information

✅ succeeded tasks - 1511

Security Considerations

  • I have reviewed my changes for potential security issues
  • Sensitive data is properly handled (if applicable)
  • Authentication and authorisation are properly implemented (if applicable)

Performance Impact

  • Performance of the code has been considered and, if applicable, suitable performance measurements have been conducted

AI Assistance and Attribution

  • Some of the content of this change has been produced with the assistance of Generative AI tool name (e.g., Met Office Github Copilot Enterprise, Github Copilot Personal, ChatGPT GPT-4, etc) and I have followed the Simulation Systems AI policy (including attribution labels)

Documentation

  • Where appropriate I have updated documentation related to this change and confirmed that it builds correctly

PSyclone Approval

  • If you have edited any PSyclone-related code (e.g. PSyKAl-lite, Kernel interface, optimisation scripts, LFRic data structure code) then please contact the TCD Team

Sci/Tech Review

  • I understand this area of code and the changes being added
  • The proposed changes correspond to the pull request description
  • Documentation is sufficient (do documentation papers need updating)
  • Sufficient testing has been completed

(Please alert the code reviewer via a tag when you have approved the SR)

Code Review

  • All dependencies have been resolved
  • Related Issues have been properly linked and addressed
  • CLA compliance has been confirmed
  • Code quality standards have been met
  • Tests are adequate and have passed
  • Documentation is complete and accurate
  • Security considerations have been addressed
  • Performance impact is acceptable

@github-actions github-actions bot added the cla-required The CLA has not yet been signed by the author of this PR - added by GA label Jan 23, 2026
@tommbendall tommbendall added enhancement New feature or request KGO This PR contains changes to KGO macro This PR contains a metadata upgrade macro and removed cla-required The CLA has not yet been signed by the author of this PR - added by GA labels Jan 23, 2026
@tommbendall tommbendall added this to the Spring 2026 milestone Jan 23, 2026
@DanStoneMO DanStoneMO added the Linked Jedi This PR is linked to a Jedi PR - this will be managed by the DA team label Mar 16, 2026
@DanStoneMO
Copy link
Contributor

Will need a linked JEDI PR, I will link it once ready.

Copy link
Contributor

@cjohnson-pi cjohnson-pi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you able to check whether the ral weekly tests run with this please? Thanks.

Christine

@tommbendall
Copy link
Contributor Author

Are you able to check whether the ral weekly tests run with this please? Thanks.

Christine

Yep, I have already run the weekly tests separately, here is the trac.log that shows that everything passes:

Test Suite Results - lfric_apps - test_high_order_orog/run9

Suite Information

Item Value
Suite Name test_high_order_orog/run9
Suite User thomas.bendall
Workflow Start 2026-03-14T10:41:00
Groups Run lfric_atm_ex1a_weekly', 'lfric_atm_ex1a_performance_check
Dependency Reference Main Like
casim MetOffice/casim@2026.03.2 True
jules MetOffice/jules@2026.03.2 True
lfric_apps tommbendall/lfric_apps@TBendall/TestHighOrderOrog False
lfric_core tommbendall/lfric_core@TBendall/CoordSpace True
moci MetOffice/moci@2026.03.2 True
SimSys_Scripts MetOffice/SimSys_Scripts@2026.03.2 True
socrates MetOffice/socrates@2026.03.2 True
socrates-spectral MetOffice/socrates-spectral@2026.03.2 True
ukca MetOffice/ukca@2026.03.2 True

Task Information

✅ succeeded tasks - 63

@cjohnson-pi cjohnson-pi self-requested a review March 17, 2026 14:25
Copy link
Contributor

@jameskent-metoffice jameskent-metoffice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code owner review approved

@tom-j-h
Copy link
Contributor

tom-j-h commented Mar 18, 2026

Hi Tom - just in case you aren't aware, adjoint_tests, jedi_id_tlm_tests, jedi_tlm_tests and jedi_tlm_forecast_tl configs should also match linear_model, along with jedi_lfric_tests as stated in your description. I'm not sure this has been done yet.

@DrTVockerodtMO
Copy link
Contributor

DrTVockerodtMO commented Mar 18, 2026

Hi Tom - just in case you aren't aware, adjoint_tests, jedi_id_tlm_tests, jedi_tlm_tests and jedi_tlm_forecast_tl configs should also match linear_model, along with jedi_lfric_tests as stated in your description. I'm not sure this has been done yet.

I think this is handled with the upgrade macro, no? The rose-stem config changes should be reflected in https://github.com/tommbendall/lfric_apps/pull/8/changes.

@tommbendall
Copy link
Contributor Author

Hi Tom - just in case you aren't aware, adjoint_tests, jedi_id_tlm_tests, jedi_tlm_tests and jedi_tlm_forecast_tl configs should also match linear_model, along with jedi_lfric_tests as stated in your description. I'm not sure this has been done yet.

Apologies, you're right that I hadn't test those apps to use the new options. I'll do that now and re-run the test-suites (and update KGOs). This will also need doing for the pre-cursor ticket #179, so I'll do that there too

@tom-j-h
Copy link
Contributor

tom-j-h commented Mar 19, 2026

Apologies, you're right that I hadn't test those apps to use the new options. I'll do that now and re-run the test-suites (and update KGOs). This will also need doing for the pre-cursor ticket #179, so I'll do that there too

No problem and thanks for fixing. I'm aware we have an odd setup of multiple main programs in one "application"!

@DrTVockerodtMO
Copy link
Contributor

It looks like this is also glitched and showing the #347 changes in the diff.

@DanStoneMO
Copy link
Contributor

Accompanying JEDI PR is now live at: https://github.com/JCSDA-internal/lfric-jedi/pull/1244

@github-actions github-actions bot added the cla-modified The CLA has been modified as part of this PR - added by GA label Mar 19, 2026
@github-actions
Copy link

⚠️ Hello @tommbendall!

Your CLA signature was found on the base branch, but you appear to have modified the CONTRIBUTORS.md file in this PR.

Please do not edit the CONTRIBUTORS.md file. If you have already signed the CLA, revert changes to the file and your signature will be picked up.

@tommbendall tommbendall changed the base branch from main to stable March 20, 2026 08:15
@tommbendall tommbendall changed the base branch from stable to main March 20, 2026 08:15
@tommbendall
Copy link
Contributor Author

Apologies, you're right that I hadn't test those apps to use the new options. I'll do that now and re-run the test-suites (and update KGOs). This will also need doing for the pre-cursor ticket #179, so I'll do that there too

No problem and thanks for fixing. I'm aware we have an odd setup of multiple main programs in one "application"!

Just to confirm, I've now done this (and for #179).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-modified The CLA has been modified as part of this PR - added by GA enhancement New feature or request KGO This PR contains changes to KGO Linked Jedi This PR is linked to a Jedi PR - this will be managed by the DA team macro This PR contains a metadata upgrade macro

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants