TR-BDF2 Timestepper - #714
Thomas Bendall (tommbendall) wants to merge 45 commits into
Conversation
Update stable for vn3.1
Merge vn3.2 stable
thomasmelvin
left a comment
There was a problem hiding this comment.
These changes all look good to me, thanks for updating the documentation
|
|
||
| .. attention:: | ||
|
|
||
| The formulations below use the notation of a state vector |
There was a problem hiding this comment.
I think a summary table would be very useful here. In particular, equation set being solved (Transport vs Compressible Euler), and specifically for TR-BDF2 the standard number of calls to the main components, i.e. linear solver, physics etc.
There was a problem hiding this comment.
Or some sort of headline description of each of the methods
There was a problem hiding this comment.
Thanks for the suggestion I've gone for the headline description -- the table for comparing number of calls is really useful but depends on timestep and configuration, which at the moment is a bit of a guess!
Alex Brown (atb1995)
left a comment
There was a problem hiding this comment.
This ticket adds a new timestepper - the SISL version of TR-BDF2. It make use of much of the infrastructure that exists for SIQN, but refactors many of the common components. As noted by TB, TR-BDF2 is a two stage implicit method, which maintains second order accuracy (and L-Stability) without off-centering and reduction in order.
The PR/changes are thorough and well written, and the addition of the timestepping docs is a very welcome one.
I only have a small number of commends (already added to the PR). I realise this is the first step before a thorough analysis on whether to adopt TR-BDF2 instead of SIQN. In longer term (not part of this PR) I would suggest a handful of investigations:
- SBR test case - much deeper, open an issue to investigate this
- I am sure an investigation will be done in GMED into TR-BDF2 performance for global NWP and climate modelling, and that work has been done looking at TR-BDF2 in Gusto for dycore only problems. But a direct comparison (TR-BDF2 vs SIQN) using GungHo for a variety of dycore test cases would be very welcome
Thanks so much for the review. I think I've responded to your points. I agree about your suggested investigations. I haven't opened an issue since TR-BDF2 is still only a research option, but these are on my own list of things to do imminently. |
Alex Brown (atb1995)
left a comment
There was a problem hiding this comment.
Thanks Tom. This looks good to me, happy to approve
|
Pierre Siddall (@Pierre-siddall) this is ready for code review |
DrTVockerodtMO
left a comment
There was a problem hiding this comment.
Thanks Tom. Sorry to be a pain but some of the adjoint routines need the stepper enum included in the interface. Part of this is preference to have things matched up (even if it goes unused), but one of the adjoint routines is missing the updated dt_rtran logic.
|
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. |
DrTVockerodtMO
left a comment
There was a problem hiding this comment.
Thanks for making those changes, LGTM!
PR Summary
Sci/Tech Reviewer: Alex Brown (@atb1995)
Code Reviewer: Pierre Siddall (@Pierre-siddall)
This PR adds a new timestepping scheme called TR-BDF2. Unlike the Semi-Implicit scheme currently used in Gungho, TR-BDF2 consists of two stages: TR (Trapezoidal) and BDF2 (Second-Order Backwards-Difference).
However both stages involve a Quasi-Newton outer/inner iteration like the Semi-Implicit scheme.
Because it contains two stages, the intention is that TR-BDF2 is used with a doubled timestep length. Physics schemes are called only once per the doubled timestep, reducing their cost. It is also possible to reduce the total number of inner iterations compared with the Semi-Implicit scheme, reducing the cost of the linear solver.
TR-BDF2 avoids the implicit off-centering of the Semi-Implicit scheme, which also improves the overall accuracy.
While this scheme will not be immediately adopted, it may be included in GC7 which is why I am lodging the code now.
The changes involved in this PR are:
inner_iterationssetting toinner_iterations_si, and makingthis an array (so that it is possible to perform different numbers of inner
iteration on each outer iteration)
stepperenumerator through to the transport scheme, as this theTR and BDF steps require different timestep lengths
different matrices are needed for the TR and BDF2 steps.
for any algorithm that calls the dynamics W2 mass matrices, such as
rhs_algIs Blocked By #659
Key Diffs
Therefore the appropriate diff for this PR can be found in this draft PR in my own
fork: https://github.com/tommbendall/lfric_apps/pull/18/changes
Documentation
equivalents can be found in this PDF:
results_tr_bdf2.pdf
provide reviewers with a path to view the compiled documentation through a browser
Code Quality Checklist
Testing
trac.log
Test Suite Results - lfric_apps - test_tr_bdf2/run5
Suite Information
Task Information
✅ succeeded tasks - 1714
Security Considerations
Performance Impact
AI Assistance and Attribution
AI has been used to help draft the documentation.
Documentation
PSyclone Approval
Sci/Tech Review
(Please alert the code reviewer via a tag when you have approved the SR)
Code Review