Skip to content

TR-BDF2 Timestepper - #18

Draft
tommbendall wants to merge 32 commits into
si_operator_dtfrom
tr_bdf2
Draft

TR-BDF2 Timestepper#18
tommbendall wants to merge 32 commits into
si_operator_dtfrom
tr_bdf2

Conversation

@tommbendall

Copy link
Copy Markdown
Owner

Shows the changes just relating to the TR-BDF2 branch

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds TR-BDF2 timestepping support across GungHo dynamics, transport, solver infrastructure, configuration, tests, and documentation.

Changes:

  • Adds timestepper-aware transport, RHS, and solver operators.
  • Introduces per-outer-loop iteration configuration and migration.
  • Adds TR-BDF2 workflows and scientific/user documentation.

Reviewed changes

Copilot reviewed 89 out of 89 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
science/linear/source/algorithm/transport/control/tl_transport_controller_mod.x90 Passes timestepper to TL transport controllers.
science/linear/source/algorithm/transport/control/tl_transport_control_alg_mod.x90 Extends TL transport API with timestepper selection.
science/linear/source/algorithm/timestepping/tl_si_timestep_alg_mod.x90 Supports per-outer SI iterations and timestepper propagation.
science/linear/source/algorithm/timestepping/tl_rk_alg_timestep_mod.x90 Identifies RK transport stages.
science/linear/source/algorithm/core_dynamics/tl_rhs_alg_mod.x90 Makes TL damping operators timestepper-aware.
science/linear/integration-test/tl_test/tl_test_transport_control_mod.x90 Updates transport integration tests.
science/linear/integration-test/tl_test/tl_test_advect_theta_field_mod.x90 Updates theta-advection test setup.
science/linear/integration-test/tl_test/tl_test_advect_density_field_mod.x90 Updates density-advection test setup.
science/linear/integration-test/semi_implicit/resources/semi_implicit_configuration.nml Migrates SI iteration configuration.
science/linear/integration-test/nwp_gal9/resources/nwp_gal9_configuration.nml Migrates NWP SI iteration configuration.
science/gungho/unit-test/kernel/external_forcing/tidally_locked_earth_kernel_mod_test.pf Updates mocked iteration arrays.
science/gungho/unit-test/kernel/external_forcing/shallow_hot_jupiter_kernel_mod_test.pf Updates mocked iteration arrays.
science/gungho/unit-test/kernel/external_forcing/held_suarez_kernel_mod_test.pf Updates mocked iteration arrays.
science/gungho/unit-test/kernel/external_forcing/earth_like_kernel_mod_test.pf Updates mocked iteration arrays.
science/gungho/unit-test/kernel/external_forcing/deep_hot_jupiter_kernel_mod_test.pf Updates mocked iteration arrays.
science/gungho/unit-test/kernel/diagnostics/compute_bottom_mass_from_flux_kernel_mod_test.pf Updates mocked iteration arrays.
science/gungho/unit-test/kernel/diagnostics/cfl_kernel_mod_test.pf Updates mocked iteration arrays.
science/gungho/unit-test/kernel/core_dynamics/compute_dl_matrix_kernel_mod_test.pf Updates mocked iteration arrays.
science/gungho/source/driver/gungho_step_mod.x90 Removes obsolete timestep-method imports.
science/gungho/source/driver/gungho_model_mod.F90 Registers and constructs TR-BDF2 timestepping.
science/gungho/source/configuration/check_configuration_mod.F90 Validates SI iteration arrays.
science/gungho/source/algorithm/transport/control/transport_controller_mod.x90 Selects stage-specific transport duration and wind.
science/gungho/source/algorithm/transport/control/gungho_transport_control_alg_mod.X90 Implements TR/BDF2 transport and flux handling.
science/gungho/source/algorithm/timestepping/timestepping_common_mod.x90 Extracts shared timestepping utilities.
science/gungho/source/algorithm/timestepping/semi_implicit_timestep_alg_mod.X90 Uses shared utilities and variable SI iterations.
science/gungho/source/algorithm/timestepping/rk_alg_timestep_mod.x90 Passes the RK timestepper to transport.
science/gungho/source/algorithm/solver/si_operators_alg_mod.x90 Builds stage-specific SI operators.
science/gungho/source/algorithm/solver/mixed_operator_alg_mod.x90 Selects timestepper-specific mass matrices.
science/gungho/source/algorithm/solver/lam_rhs_alg_mod.x90 Adds timestepper-dependent LAM RHS coefficients.
science/gungho/source/algorithm/runtime_constants/solver_constants_mod.x90 Separates solver matrix inventories by timestepper.
science/gungho/source/algorithm/runtime_constants/dycore_constants_mod.x90 Defines steppers, TR-BDF2 coefficients, and matrix inventories.
science/gungho/source/algorithm/diagnostics/si_diagnostics_mod.x90 Clarifies increment diagnostics for TR-BDF2.
science/gungho/source/algorithm/core_dynamics/rhs_alg_mod.x90 Propagates timestepper selection through RHS calculation.
science/gungho/rose-meta/lfric-gungho/versions.py Adds iteration-setting upgrade macro.
science/gungho/rose-meta/lfric-gungho/HEAD/rose-meta.conf Defines TR-BDF2 configuration metadata.
science/adjoint/source/algorithm/transport/control/atl_transport_control_alg_mod.x90 Propagates timestepper through adjoint transport.
science/adjoint/source/algorithm/timestepping/atl_si_timestep_alg_mod.x90 Supports variable SI iterations in the adjoint.
science/adjoint/source/algorithm/solver/adj_mixed_operator_alg_mod.x90 Selects adjoint timestepper-specific matrices.
science/adjoint/source/algorithm/core_dynamics/atl_rhs_alg_mod.x90 Makes adjoint damping operators timestepper-aware.
rose-stem/site/meto/lfric_atm/tasks_lfric_atm_ex1a.cylc Adds TR-BDF2 task resource settings.
rose-stem/site/meto/groups/groups_lfric_atm.cylc Registers atmospheric TR-BDF2 tasks.
rose-stem/site/meto/groups/groups_gungho_model.cylc Registers GungHo TR-BDF2 tasks.
rose-stem/site/common/lfric_atm/tasks_lfric_atm.cylc Defines atmospheric TR-BDF2 test tasks.
rose-stem/site/common/gungho_model/tasks_gungho_model.cylc Defines GungHo TR-BDF2 test tasks.
rose-stem/site/common/gungho_model/tasks_gungho_model_weekly.cylc Adds weekly TR-BDF2 test coverage.
rose-stem/app/lfric_atm/opt/rose-app-tr_bdf2.conf Adds atmospheric TR-BDF2 options.
rose-stem/app/lfric_atm/opt/rose-app-tr_bdf2_big.conf Adds large-domain TR-BDF2 options.
rose-stem/app/lfric_atm/opt/rose-app-tr_bdf2_big_ral.conf Adds regional TR-BDF2 options.
rose-stem/app/gungho_model/opt/rose-app-tr_bdf2.conf Adds GungHo TR-BDF2 options.
rose-stem/app/gungho_model/opt/rose-app-skamarock_klemp_gw_p0.conf Adjusts diagnostic frequency.
rose-stem/app/gungho_model/opt/rose-app-schar_cart.conf Adjusts diagnostic frequency.
documentation/source/user_guide/timestepping/index.rst Documents timestepping configuration.
documentation/source/user_guide/index.rst Includes the timestepping user guide.
documentation/source/science_guide/timestepping/tr_bdf2.rst Documents TR-BDF2 formulation and algorithm.
documentation/source/science_guide/timestepping/semi_implicit.rst Documents SIQN formulation and coupling.
documentation/source/science_guide/timestepping/runge_kutta.rst Documents Runge–Kutta timestepping.
documentation/source/science_guide/timestepping/index.rst Adds the timestepping science-guide index.
documentation/source/science_guide/references.bib Adds timestepping references.
applications/transport/source/algorithm/transport_control_alg_mod.x90 Marks standalone transport as RK.
applications/transport/example/configuration.nml Migrates iteration configuration.
applications/shallow_water/source/algorithm/swe_transport_control_alg_mod.x90 Propagates timestepper through SWE transport.
applications/shallow_water/source/algorithm/swe_timestep_alg_mod.x90 Uses stage-specific SWE transport settings.
applications/shallow_water/example/configuration.nml Migrates iteration configuration.
applications/ngarch/example/configuration_casim.nml Migrates CASIM configuration.
applications/ngarch/example/configuration_bl.nml Migrates boundary-layer configuration.
applications/name_transport/source/algorithm/name_transport_control_alg_mod.x90 Marks name transport as RK.
applications/name_transport/example/configuration.nml Migrates iteration configuration.
applications/lfric_coupled/example/configuration.nml Migrates coupled configuration.
applications/lfric_atm/example/configuration.nml Migrates atmospheric configuration.
applications/jules/example/configuration.nml Migrates JULES configuration.
applications/jedi_lfric_tests/example/configuration.nml Migrates JEDI configuration.
applications/jedi_lfric_tests/example_tlm_tests/configuration.nml Migrates TLM test configuration.
applications/jedi_lfric_tests/example_tlm_forecast_tl/configuration.nml Migrates TLM forecast configuration.
applications/jedi_lfric_tests/example_tlm_forecast_tl/configuration_op.nml Migrates operational TLM configuration.
applications/jedi_lfric_tests/example_id_tlm_tests/configuration.nml Migrates identity-TLM configuration.
applications/jedi_lfric_tests/example_forecast/configuration.nml Migrates forecast configuration.
applications/gungho_model/lam_example/straka/config_lam.nml Migrates Straka LAM configuration.
applications/gungho_model/lam_example/straka/config_driver.nml Migrates Straka driver configuration.
applications/gungho_model/lam_example/baroclinic/config_lam.nml Migrates baroclinic LAM configuration.
applications/gungho_model/lam_example/baroclinic/config_driver.nml Migrates baroclinic driver configuration.
applications/gungho_model/example/configuration.nml Migrates GungHo example configuration.
applications/gravity_wave/example/configuration.nml Migrates gravity-wave configuration.
applications/adjoint_tests/source/algorithm/transport/setup_test_alg_mod.x90 Updates adjoint transport setup.
applications/adjoint_tests/source/algorithm/transport/control/atlt_transport_controller_alg_mod.x90 Updates TL controller tests.
applications/adjoint_tests/source/algorithm/transport/control/atlt_transport_control_alg_mod.x90 Updates TL/adjoint transport tests.
applications/adjoint_tests/source/algorithm/transport/control/adjt_transport_controller_alg_mod.x90 Updates adjoint controller tests.
applications/adjoint_tests/source/algorithm/core_dynamics/atlt_rhs_alg_mod.x90 Updates TL/adjoint RHS tests.
applications/adjoint_tests/example/configuration.nml Migrates adjoint-test configuration.
Suppressed comments (1)

science/gungho/rose-meta/lfric-gungho/HEAD/rose-meta.conf:6146

  • This description says density, but tau_u controls the velocity/momentum equation, as the help text immediately below explains.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread science/gungho/source/algorithm/core_dynamics/rhs_alg_mod.x90
Comment on lines 90 to +92
subroutine tl_rhs_alg(rhs, alpha_dt, base_state, state, moist_dyn, &
ls_state, ls_moist_dyn, compute_eos, &
dlayer_rhs, model_clock)
dlayer_rhs, stepper, model_clock)
Comment thread science/gungho/source/algorithm/timestepping/semi_implicit_timestep_alg_mod.X90 Outdated
Comment on lines +33 to +37
class vn32_t379(MacroUpgrade):
"""Upgrade macro for ticket #379 by Thomas Bendall."""

BEFORE_TAG = "vn3.2"
AFTER_TAG = "vn3.2_t379"
Comment thread science/gungho/source/configuration/check_configuration_mod.F90
Comment thread documentation/source/science_guide/timestepping/tr_bdf2.rst Outdated
Comment thread science/gungho/rose-meta/lfric-gungho/HEAD/rose-meta.conf Outdated
Comment on lines +33 to +35
material derivative which preserves the numerical properties of the
Crank-Nicolson scheme: high frequency (acoustic) waves are damped while low
frequency waves (such as Rossby waves) are represented accurately.
Comment thread documentation/source/science_guide/timestepping/index.rst Outdated
Comment thread documentation/source/science_guide/timestepping/tr_bdf2.rst Outdated

@iboutle iboutle left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

A few minor comments (I realise I'm doing this in the wrong place, but it was easier to do here!)

Comment thread rose-stem/site/common/lfric_atm/tasks_lfric_atm.cylc Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Not an issue for this PR, but I do have a worry that by having 2 timestepping routines, things will be added to 1 but not the other. I'm not sure if we can think of some way of grouping/simplifying things such that everything that is shared between the different methods only exists in 1 place, and the timestepping routines themselves only contain the differences which are relevant for SI/TRBDF2

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Yes agreed, it will be a pain and could cause issues if something gets forgotten from one.

I've made steps towards that by adding the timestepping_common_mod.x90 file which contains some common things, but this was as far as I was comfortable going in this PR as I didn't want to completely refactor the semi-implicit timestepper!

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I'll make a note for now that we'll need to take care to ensure the changes from MetOffice#709 are included in whoever's PR ends up going on 2nd

Comment thread rose-stem/site/common/lfric_atm/tasks_lfric_atm.cylc Outdated
Comment thread rose-stem/app/lfric_atm/opt/rose-app-tr_bdf2.conf
outer, model_clock, dt &
)

fast_smagorinsky = ( &

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry - suggest calling this "outer_smagorinsky", because we also have the option of calling smagorinsky inside fast physics, which might get confusing!

{% do task_dict.update({
"opt_confs": ["l70_40km","ral3","ral_opts","hh_solve","tr_bdf2_big_ral"],
"resolution": "seuk_MG",
"DT": 120,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry, just noticed this. 2 minutes is a pain, because there are requirements for model output at 5min and 15min intervals. So it would be better if this was either 100s or 150s (i.e something that divides into 5min). n_radstep can then be set appropriately to still be 15min, and you'll also need to set n_inc_radstep (5min)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants