Skip to content

Fix lock-exchange example#5248

Merged
navidcy merged 4 commits intoncc/default-SplitRungeKutta3from
ss/correct-example
Feb 24, 2026
Merged

Fix lock-exchange example#5248
navidcy merged 4 commits intoncc/default-SplitRungeKutta3from
ss/correct-example

Conversation

@simone-silvestri
Copy link
Copy Markdown
Collaborator

It was using the time-step wizard with an Adams-Bashforth which is not recommended (because it changes timestepper under the hood when the wizard is called).

This PR fixes the example

conjure_time_step_wizard!(simulation, cfl=0.3)
# time-stepping with a Courant-Freidrichs-Lewy (CFL) number of 0.7.
# Note that the suitability of the wizard depends on the model's `timestepper`.
# In this case we use a single-step method (a Runge-Kutta discretization)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What does “single step” mean? It’s actually multi step, right?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think the convention is that RK is multi-stage but single-step (only one time-step is involved), while AB2 is single-stage multi-step (2 time-steps involved). However, we can come up with a better naming?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think the description should imply the timestepper has "memory" or not. When the timestepper has memory, changing the time-step requires re-starting the time-stepper. That's why it's better to use adaptive time-stepping wih a self-starting timestepper

tracers = :b,
buoyancy = BuoyancyTracer(),
closure = CATKEVerticalDiffusivity(),
timestepper = :SplitRungeKutta3,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is this not default?

# time-stepping with a Courant-Freidrichs-Lewy (CFL) number of 0.7.
# Note that the suitability of the wizard depends on the model's `timestepper`.
# In this case we use a time discretization (Runge-Kutta)
# which allows the use of a variable time-step
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the discussion is good, but I am not sure most users will understand. It could be better to simply make RK3 the default, and illustrate adaptive time-stepping. Users won't have to think about it --- they will just know that with the default setup, adaptive time-stepping is good to go 👍

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would prefer that also

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.37%. Comparing base (794de1b) to head (31555f3).
⚠️ Report is 63 commits behind head on ncc/default-SplitRungeKutta3.

Additional details and impacted files
@@                      Coverage Diff                      @@
##           ncc/default-SplitRungeKutta3    #5248   +/-   ##
=============================================================
  Coverage                         68.37%   68.37%           
=============================================================
  Files                               394      394           
  Lines                             21352    21352           
=============================================================
  Hits                              14599    14599           
  Misses                             6753     6753           
Flag Coverage Δ
buildkite 68.37% <ø> (ø)
julia 68.37% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@glwagner
Copy link
Copy Markdown
Member

merge?

@navidcy
Copy link
Copy Markdown
Member

navidcy commented Feb 24, 2026

I was hoping we get the #5283 in and then tweak this.
But a systematic error with SplitRungeKutta3 seems to have revealed..

We can definitely merge and then tweak the example in #5283.

@glwagner
Copy link
Copy Markdown
Member

or how about merge into 5283

@navidcy navidcy changed the base branch from main to ncc/default-SplitRungeKutta3 February 24, 2026 09:13
@navidcy navidcy merged commit 846b1ac into ncc/default-SplitRungeKutta3 Feb 24, 2026
73 checks passed
@navidcy navidcy deleted the ss/correct-example branch February 24, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants