rdb_ice_frazil Module

Clamp the ocean SURFACE layer at the seawater freezing point and BANK the removed supercooling deficit for the sea-ice model (PLAN_SEA_ICE.md “Prerequisites” #2 — the MOM6/SIS2 frazil limiter on the ocean side of the coupling seam).

Physics: after a full outer dynamics step the surface layer (k = nz, Roundabout’s bottom-up convention) can be advected/mixed below the salinity-dependent freezing point T_f = eos_freezing_point(S, p). Liquid seawater cannot supercool at leading order — the deficit freezes out as frazil crystals whose latent-heat release warms the water back to T_f. This kernel applies exactly that: it raises the surface tracer temperature to T_f and deposits the heat spent,

deficit = ρ·Cp·h_surf·(T_f − T)⁺ [J/m²],

into the persistent frazil_heat bank on the ice slot. ENERGY CONSERVING by construction: the sensible heat ADDED to the ocean equals the latent heat the (future, PR 3) ice model will spend forming new ice from the same bank — banked, never discarded.

The matching hTr increment h·(T_f − T) (K·m) is mirrored into the slot’s heat_budget_frazil contributor so the global heat budget (rdb_ocean_budgets) still closes with ice on.

Runs ONCE per outer step on the FINAL (post-RK2-average, post-remap) tracer state — clamping inside the RK2 stages would not bound the averaged result. Gated at the driver on state%ice%enable (default off ⇒ byte-identical).


Uses

  • module~~rdb_ice_frazil~~UsesGraph module~rdb_ice_frazil rdb_ice_frazil module~rdb_constants rdb_constants module~rdb_ice_frazil->module~rdb_constants module~rdb_eos rdb_eos module~rdb_ice_frazil->module~rdb_eos module~rdb_grid rdb_grid module~rdb_ice_frazil->module~rdb_grid module~rdb_multilayer_state rdb_multilayer_state module~rdb_ice_frazil->module~rdb_multilayer_state module~rdb_ocean_surface_flux rdb_ocean_surface_flux module~rdb_ice_frazil->module~rdb_ocean_surface_flux pic_types pic_types module~rdb_constants->pic_types module~rdb_eos->module~rdb_constants module~rdb_eos->module~rdb_grid module~rdb_grid->module~rdb_constants module~rdb_multilayer_state->module~rdb_constants module~rdb_multilayer_state->module~rdb_grid iso_fortran_env iso_fortran_env module~rdb_multilayer_state->iso_fortran_env module~rdb_efp rdb_efp module~rdb_multilayer_state->module~rdb_efp module~rdb_error_ring rdb_error_ring module~rdb_multilayer_state->module~rdb_error_ring module~rdb_mem_report rdb_mem_report module~rdb_multilayer_state->module~rdb_mem_report module~rdb_tracer rdb_tracer module~rdb_multilayer_state->module~rdb_tracer pic_logger pic_logger module~rdb_multilayer_state->pic_logger module~rdb_ocean_surface_flux->module~rdb_constants module~rdb_ocean_surface_flux->module~rdb_grid module~rdb_ocean_surface_flux->module~rdb_multilayer_state module~rdb_ocean_surface_flux->iso_fortran_env module~rdb_ocean_surface_flux->module~rdb_mem_report module~rdb_efp->iso_fortran_env ieee_arithmetic ieee_arithmetic module~rdb_efp->ieee_arithmetic module~rdb_error_ring->pic_logger module~rdb_mem_report->module~rdb_constants module~rdb_mem_report->iso_fortran_env module~rdb_mem_report->pic_logger pic_strings pic_strings module~rdb_mem_report->pic_strings module~rdb_tracer->module~rdb_constants module~rdb_tracer->module~rdb_grid module~rdb_tracer->iso_fortran_env module~rdb_tracer->module~rdb_mem_report

Used by

  • module~~rdb_ice_frazil~~UsedByGraph module~rdb_ice_frazil rdb_ice_frazil module~rdb_ocean_engine rdb_ocean_engine module~rdb_ocean_engine->module~rdb_ice_frazil module~rdb_driver rdb_driver module~rdb_driver->module~rdb_ocean_engine module~rdb_handle rdb_handle module~rdb_handle->module~rdb_ocean_engine module~rdb_ocean_api rdb_ocean_api module~rdb_ocean_api->module~rdb_ocean_engine module~rdb_ocean_api->module~rdb_handle

Subroutines

public pure subroutine ice_frazil_accumulate(grid, eos, ms, frazil_heat, heat_budget_frazil)

Outer shim (outer-shim + flat-impl pattern): dereference the tracer registry (ms%tracers(idx)%hTr) on the HOST and forward bare arrays to the device kernel — NVHPC stdpar cannot follow the array-of-derived-types indirection inside a do-concurrent body. No-op when either S or T is unregistered.

Arguments

Type IntentOptional Attributes Name
type(hgrid_t), intent(in) :: grid
type(eos_t), intent(in) :: eos
type(multilayer_state_t), intent(inout) :: ms
real(kind=wp), intent(inout) :: frazil_heat(:,:)

Persistent supercooling bank (J/m²) on the ice slot — ocean_sea_ice_t%frazil_heat, device-mapped by the slot’s enter_data.

real(kind=wp), intent(inout) :: heat_budget_frazil(:,:,:)

Heat-budget contributor accumulator (K·m per cell) — ocean_sea_ice_t%heat_budget_frazil.

private pure subroutine ice_frazil_accumulate_impl(hTr_T, hTr_S, h_layer, wet_mask, frazil_heat, heat_budget_frazil, eos, nghost, nz, nx, ny)

Device kernel over PHYSICAL surface cells (ghosts excluded — wall ghosts are inert and seam ghosts are rebuilt by the wrap / exchange, so clamping them would double-count the bank in any area integral). Per wet cell at k = nz:

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(inout) :: hTr_T(nx,ny,nz)
real(kind=wp), intent(in) :: hTr_S(nx,ny,nz)
real(kind=wp), intent(in) :: h_layer(nx,ny,nz)
real(kind=wp), intent(in) :: wet_mask(nx,ny)
real(kind=wp), intent(inout) :: frazil_heat(nx,ny)
real(kind=wp), intent(inout) :: heat_budget_frazil(nx,ny,1)
type(eos_t), intent(in) :: eos
integer, intent(in) :: nghost
integer, intent(in) :: nz
integer, intent(in) :: nx
integer, intent(in) :: ny