vmix_apply_convection Subroutine

public pure subroutine vmix_apply_convection(grid, this, ms, bl_depth)

Brunt-Vaisala-triggered convective adjustment – a CONTRIBUTOR into kv/kt (see the module docstring for the full physics and the D1-D4 divergences from MOM6’s MOM_CVMix_conv). Early- returns when conv_enable is off (bit-identical). bl_depth (m, positive down) is the caller’s active surface-boundary-layer depth: pass this%bl_depth under KPP / no BL scheme, epbl%mld under EPBL – both are permanently-zero, device-resident fields when their owning scheme is off, so either is a free “no BL scheme -> mask nothing” default (z_int(k) >= 0 for every interior interface).

Arguments

Type IntentOptional Attributes Name
type(hgrid_t), intent(in) :: grid
type(ocean_vmix_t), intent(inout) :: this
type(multilayer_state_t), intent(in) :: ms
real(kind=wp), intent(in) :: bl_depth(:,:)

Calls

proc~~vmix_apply_convection~~CallsGraph proc~vmix_apply_convection vmix_apply_convection proc~vmix_convection_impl vmix_convection_impl proc~vmix_apply_convection->proc~vmix_convection_impl local local proc~vmix_convection_impl->local

Called by

proc~~vmix_apply_convection~~CalledByGraph proc~vmix_apply_convection vmix_apply_convection proc~vmix_apply_in_stage vmix_apply_in_stage proc~vmix_apply_in_stage->proc~vmix_apply_convection proc~run_stage run_stage proc~run_stage->proc~vmix_apply_in_stage proc~run_stage_split run_stage_split proc~run_stage_split->proc~vmix_apply_in_stage proc~ocean_dyn_step ocean_dyn_step proc~ocean_dyn_step->proc~run_stage 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 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

Variables

Type Visibility Attributes Name Initial
integer, private :: nx
integer, private :: ny
integer, private :: nz

Source Code

   pure subroutine vmix_apply_convection(grid, this, ms, bl_depth)
      !! Brunt-Vaisala-triggered convective adjustment -- a CONTRIBUTOR
      !! into kv/kt (see the module docstring for the full physics and
      !! the D1-D4 divergences from MOM6's `MOM_CVMix_conv`).  Early-
      !! returns when `conv_enable` is off (bit-identical).  `bl_depth`
      !! (m, positive down) is the caller's active surface-boundary-layer
      !! depth: pass `this%bl_depth` under KPP / no BL scheme, `epbl%mld`
      !! under EPBL -- both are permanently-zero, device-resident fields
      !! when their owning scheme is off, so either is a free "no BL
      !! scheme -> mask nothing" default (`z_int(k) >= 0` for every
      !! interior interface).
      type(hgrid_t), intent(in) :: grid
      type(ocean_vmix_t), intent(inout) :: this
      type(multilayer_state_t), intent(in) :: ms
      real(wp), intent(in) :: bl_depth(:, :)

      integer :: nx, ny, nz

      if (.not. this%conv_enable) return

      nx = grid%nx_total
      ny = grid%ny_total
      nz = ms%nz_ml

      call vmix_convection_impl(nx, ny, nz + 1, this%kv, this%kt, &
                                ms%rho_layer, ms%h_layer, bl_depth, &
                                this%conv_kd, this%conv_prandtl, &
                                this%conv_n2_thresh, this%rho0)
   end subroutine vmix_apply_convection