rdb_ice_basal_flux Module

fb = RHO_WATERSEAWATER_CPmax(0, SST - T_f)h_top/dt_therm [W/m^2], the complement of the frazil bank: a warm (above-freezing) ocean surface under ice melts the base (fb > 0 -> bmelt in ice_temp_sis2 TRAP #3); a supercooled surface grows it (that path is the frazil bank, PR 1/3b). Same RHO_WATERSEAWATER_CP convention as ice_frazil_accumulate so growth and melt share one energy scale.

NO CAP (v1): fb is the full above-freezing flux. The column’s bottom-melt peel is self-limiting (clamps to available ice mass, spills the remainder to heat_to_ocn), so nothing is discarded and the heat budget closes.

ICE-PRESENCE GATE (crucial): fb is ZERO on ice-free cells — no ice base, no basal flux. The gate mirrors ice_thermo_columns’ own ice threshold sum_cat m_ice > ICE_RHO_ICE*H_VANISHED so the column and the coupler agree EXACTLY on which cells exchange. Without it, a warm ice-free ocean cell (the normal open-ocean state, SST > T_f) would compute a large fb > 0 that the column then never consumes (m_ice = 0 => heat_to_ocn = 0), and the melt-side reduce kernel would inject a spurious Q_heat = -fb, cooling the open ocean by several degC per thermo step. The sample seam (sst_seam/ssurf_seam/tfw_seam) is STILL filled on all wet cells (harmless — the column only reads it where it has ice).

One-step lag: reads the outer step’s FINAL surface state (called post-dyn, pre-column, like ice_frazil_accumulate). Physical cells only; wet + non-vanished gate. Outer-shim + flat-impl (registry deref on host).

ALSO fills the sample seam (sst_seam/ssurf_seam/tfw_seam) the column driver (rdb_ice_thermo_driver) reuses — one SST/SSS/T_f sample serves both fb and the column’s ocean-side inputs, keeping them at the same one-step-lagged snapshot (physically consistent, PLAN_ICE_PR3c §”Ocean -> ice basal heat flux”).


Uses

  • module~~rdb_ice_basal_flux~~UsesGraph module~rdb_ice_basal_flux rdb_ice_basal_flux module~rdb_constants rdb_constants module~rdb_ice_basal_flux->module~rdb_constants module~rdb_eos rdb_eos module~rdb_ice_basal_flux->module~rdb_eos module~rdb_grid rdb_grid module~rdb_ice_basal_flux->module~rdb_grid module~rdb_ice_column rdb_ice_column module~rdb_ice_basal_flux->module~rdb_ice_column module~rdb_ice_state rdb_ice_state module~rdb_ice_basal_flux->module~rdb_ice_state module~rdb_multilayer_state rdb_multilayer_state module~rdb_ice_basal_flux->module~rdb_multilayer_state module~rdb_ocean_surface_flux rdb_ocean_surface_flux module~rdb_ice_basal_flux->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_ice_column->module~rdb_constants module~rdb_ice_enthalpy rdb_ice_enthalpy module~rdb_ice_column->module~rdb_ice_enthalpy module~rdb_ice_mass rdb_ice_mass module~rdb_ice_column->module~rdb_ice_mass module~rdb_ice_optics rdb_ice_optics module~rdb_ice_column->module~rdb_ice_optics module~rdb_ice_state->module~rdb_constants module~rdb_ice_state->module~rdb_grid module~rdb_ice_state->module~rdb_ice_column iso_fortran_env iso_fortran_env module~rdb_ice_state->iso_fortran_env module~rdb_ice_state->module~rdb_ice_enthalpy module~rdb_mem_report rdb_mem_report module~rdb_ice_state->module~rdb_mem_report module~rdb_multilayer_state->module~rdb_constants module~rdb_multilayer_state->module~rdb_grid 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_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_ice_enthalpy->module~rdb_constants module~rdb_ice_mass->module~rdb_constants module~rdb_ice_mass->module~rdb_ice_enthalpy module~rdb_ice_optics->module~rdb_constants module~rdb_ice_optics->module~rdb_ice_enthalpy 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_basal_flux~~UsedByGraph module~rdb_ice_basal_flux rdb_ice_basal_flux module~rdb_ocean_engine rdb_ocean_engine module~rdb_ocean_engine->module~rdb_ice_basal_flux 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_compute_basal_flux(grid, eos, ms, ice, dt_therm)

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 — same rule as ice_frazil_accumulate / ice_frazil_uptake. 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(in) :: ms

READ-ONLY: SST/SSS are sampled here, never written.

type(ocean_sea_ice_t), intent(inout) :: ice

Writes ice%fb and the sst_seam/ssurf_seam/tfw_seam sample seam.

real(kind=wp), intent(in) :: dt_therm

Effective thermo timestep (s) — ocean_dyn_t%therm_dt(dt).

private pure subroutine ice_compute_basal_flux_impl(hTr_T, hTr_S, h_layer, wet_mask, m_ice, eos, fb, sst_seam, ssurf_seam, tfw_seam, dt_therm, nghost, ncat, nz, nx, ny)

Device kernel over PHYSICAL cells (ghosts excluded — same physical-cells-only contract as ice_frazil_accumulate_impl). fb/sst_seam/ssurf_seam/tfw_seam are zeroed unconditionally first. The SAMPLE seam (sst_seam/ssurf_seam/tfw_seam) is filled on every wet, non-vanished cell (harmless — the column reads it only where it has ice). But fb is filled ONLY where BOTH the cell is wet+non-vanished AND it carries ice (sum_cat m_ice > ICE_RHO_ICE*H_VANISHED, exactly ice_thermo_columns’ own per-cat ice threshold, summed): no ice base ⇒ no basal flux. This keeps the coupler and the column in lockstep on which cells exchange, so an ice-free warm ocean cell (SST > T_f, the normal open-ocean state) reports fb = 0 and the melt-side reduce kernel’s -fb term is a harmless subtraction of zero (rather than a spurious ocean-cooling Q_heat = -fb).

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: 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(in) :: m_ice(nx,ny,ncat)
type(eos_t), intent(in) :: eos
real(kind=wp), intent(inout) :: fb(nx,ny)
real(kind=wp), intent(inout) :: sst_seam(nx,ny)
real(kind=wp), intent(inout) :: ssurf_seam(nx,ny)
real(kind=wp), intent(inout) :: tfw_seam(nx,ny)
real(kind=wp), intent(in) :: dt_therm
integer, intent(in) :: nghost
integer, intent(in) :: ncat
integer, intent(in) :: nz
integer, intent(in) :: nx
integer, intent(in) :: ny