chksum_hotface Subroutine

public subroutine chksum_hotface(grid, ms, visc_rem_u, visc_rem_v, probe, label, stage, step)

Hot-face anatomy at a phase seam: interior argmax |u| and |v| with the local thickness pair (donor/receiver cells), the per-face viscous remnant, and the column context (thickness of the layer below/above at the max face). The forensic question this answers: WHICH face takes the explicit dt·F kick, is it an outcrop edge (massive|vanished thickness pair), and is visc_rem actually small there (i.e. would MOM6’s attenuation have caught it)? Row format (grep “HOTFACE”): HOTFACE s

Arguments

Type IntentOptional Attributes Name
type(hgrid_t), intent(in) :: grid
type(multilayer_state_t), intent(inout) :: ms
real(kind=wp), intent(in) :: visc_rem_u(:,:,:)
real(kind=wp), intent(in) :: visc_rem_v(:,:,:)
type(chksum_probe_t), intent(inout) :: probe
character(len=*), intent(in) :: label
integer, intent(in) :: stage
integer, intent(in) :: step

Calls

proc~~chksum_hotface~~CallsGraph proc~chksum_hotface chksum_hotface proc~chksum_active chksum_active proc~chksum_hotface->proc~chksum_active proc~chksum_argmax chksum_argmax proc~chksum_hotface->proc~chksum_argmax proc~hotface_row hotface_row proc~chksum_hotface->proc~hotface_row

Called by

proc~~chksum_hotface~~CalledByGraph proc~chksum_hotface chksum_hotface proc~run_stage_split run_stage_split proc~run_stage_split->proc~chksum_hotface proc~ocean_dyn_step_split ocean_dyn_step_split proc~ocean_dyn_step_split->proc~run_stage_split proc~engine_step engine_step proc~engine_step->proc~ocean_dyn_step_split proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_step proc~rdb_ocean_step rdb_ocean_step proc~rdb_ocean_step->proc~engine_step proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean

Variables

Type Visibility Attributes Name Initial
real(kind=wp), private :: amax
integer, private :: i0
integer, private :: i1
integer, private :: ig
integer, private :: im
integer, private :: j0
integer, private :: j1
integer, private :: jm
integer, private :: km

Source Code

   subroutine chksum_hotface(grid, ms, visc_rem_u, visc_rem_v, probe, label, stage, step)
      !! Hot-face anatomy at a phase seam: interior argmax |u| and |v|
      !! with the local thickness pair (donor/receiver cells), the
      !! per-face viscous remnant, and the column context (thickness of
      !! the layer below/above at the max face).  The forensic question
      !! this answers: WHICH face takes the explicit dt·F kick, is it an
      !! outcrop edge (massive|vanished thickness pair), and is visc_rem
      !! actually small there (i.e. would MOM6's attenuation have caught
      !! it)?  Row format (grep "HOTFACE"):
      !!   HOTFACE <step> s<stage> <label> u|v (i,j,k) val hL hR rem h_dn h_up
      !! Debug-window only (chksum_active gate); D→H of the two face
      !! fields per sample — affordable at window cadence, not at
      !! production cadence.
      type(hgrid_t), intent(in) :: grid
      type(multilayer_state_t), intent(inout) :: ms
      real(wp), intent(in) :: visc_rem_u(:, :, :), visc_rem_v(:, :, :)
      ! assumed-shape-ok: host-side debug probe, no device loops here.
      type(chksum_probe_t), intent(inout) :: probe
      character(len=*), intent(in) :: label
      integer, intent(in) :: stage, step

      integer :: ig, i0, i1, j0, j1, im, jm, km
      real(wp) :: amax

      if (.not. chksum_active(probe, step)) return
      !$acc wait
      !$acc update self(ms%u_face_x_layer, ms%v_face_y_layer, ms%h_layer)
      !$acc update self(visc_rem_u, visc_rem_v)

      ig = grid%nghost
      i0 = ig + 1
      i1 = grid%nx_total - ig
      j0 = ig + 1
      j1 = grid%ny_total - ig

      ! ---- u argmax over interior u-faces ----
      call chksum_argmax(ms%u_face_x_layer, grid%nx_total + 1, grid%ny_total, &
                         ms%nz_ml, i0, i1 + 1, j0, j1, im, jm, km, amax)
      call hotface_row(label, stage, step, "u", im, jm, km, &
                       ms%u_face_x_layer(im, jm, km), &
                       ms%h_layer(im - 1, jm, km), ms%h_layer(im, jm, km), &
                       visc_rem_u(im, jm, km), &
                       ms%h_layer(im - 1, jm, max(km - 1, 1)), &
                       ms%h_layer(im - 1, jm, min(km + 1, ms%nz_ml)))

      ! ---- v argmax over interior v-faces ----
      call chksum_argmax(ms%v_face_y_layer, grid%nx_total, grid%ny_total + 1, &
                         ms%nz_ml, i0, i1, j0, j1 + 1, im, jm, km, amax)
      call hotface_row(label, stage, step, "v", im, jm, km, &
                       ms%v_face_y_layer(im, jm, km), &
                       ms%h_layer(im, jm - 1, km), ms%h_layer(im, jm, km), &
                       visc_rem_v(im, jm, km), &
                       ms%h_layer(im, jm - 1, max(km - 1, 1)), &
                       ms%h_layer(im, jm - 1, min(km + 1, ms%nz_ml)))
   end subroutine chksum_hotface