Skip to content

SemiImplicitModel now supports k-calving#1858

Open
bearecinos wants to merge 1 commit intoOGGM:masterfrom
bearecinos:semi_implicit_w_calving
Open

SemiImplicitModel now supports k-calving#1858
bearecinos wants to merge 1 commit intoOGGM:masterfrom
bearecinos:semi_implicit_w_calving

Conversation

@bearecinos
Copy link
Member

Add k-calving support to SemiImplicitModel

This PR extends SemiImplicitModel to run tidewater (marine-terminating) experiments with k-calving, using the same retreat-based calving bucket logic as FluxBasedModel, while keeping the semi-implicit diffusivity matrix solve unchanged.

Calving parametrization

The glacier thickness is first advanced by solving the semi-implicit diffusivity equation. After this update, the calving routine is applied as a post-step geometry modification.

If the glacier terminus is water-terminating (ice above water level with the bed below water), the last grid cell above the water level is identified and a calving flux is computed using the calving law. This flux is accumulated in a calving bucket (volume). The bucket is then used to remove ice starting with any ice below sea level and, if necessary, by retreating the terminus through partial or full removal of grid cells.

This approach keeps the semi-implicit solver unchanged and avoids introducing the highly nonlinear moving-boundary calving process into the linear matrix system. Instead, calving is treated as a mass-removal step applied after the thickness evolution, mirroring the implementation in FluxBasedModel.

Key design choices

  • Calving is applied after the diffusivity solve, not inside the linear system.
  • The implementation follows the retreat-based calving bucket approach used in FluxBasedModel.
  • An upstream Neumann boundary condition (flux gate) is added to allow prescribed ice flux entering the domain.

Changes in flowline.py

1. Calving parameters added to SemiImplicitModel.__init__

New parameters:

  • do_calving
  • calving_k
  • calving_law
  • calving_use_limiter
  • calving_limiter_frac (currently only 0 supported)
  • water_level

Diagnostics added:

  • self.calving_m3_since_y0
  • self.calving_rate_myr

These follow the same bookkeeping used in the FluxBasedModel calving implementation.


2. Flux gate support

SemiImplicitModel now accepts either:

  • flux_gate as a prescribed flux (m³ s⁻¹), optionally ramped with flux_gate_build_up
  • flux_gate_thickness, which is converted to a theoretical flux (as in FluxBasedModel)

The flux gate is not included in the matrix coefficients. Instead, it modifies the RHS of the first grid cell:

rhs[0] += dt * q_in / (width[0] * dx)

Test updates (tests_numerics.py and helper functions)

1. Generalized tidewater test helpers

The helper functions used in tidewater tests were generalized so they can be used with both FluxBasedModel and SemiImplicitModel. A new internal function _make_tw_flowline was introduced to build either:

  • RectangularBedFlowline
  • TrapezoidalBedFlowline

from the same input arrays.


2. Flexible bed construction

The bu_tidewater_bed helper function now accepts:

  • bed_shape ("rectangular" or "trapezoidal")
  • lambdas

This allows:

  • rectangular beds for FluxBasedModel
  • trapezoidal flowlines with λ = 0 for SemiImplicitModel

Using λ = 0 gives a rectangular cross-section while still using the trapezoidal flowline class required by SemiImplicitModel. Maybe we need to re-think bedshapes for TW glaciers.


3. Parameterized calving tests

The k-calving tests were updated to run for both solvers via a parameterized default_calving fixture.

The fixture:

  • builds equivalent tidewater setups
  • runs the models to equilibrium
  • verifies mass conservation:

This PR partially solves #1733

  • Tests added/passed
  • Fully documented

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.

1 participant