vdiff_bbl_configure Subroutine

public subroutine vdiff_bbl_configure(this, nx, ny, nz, form, cd, r_linear, hbbl, bg_vel, thick_min, rino_cap, rho0, kv_bg)

Latch the MOM6 per-face bottom boundary layer (bbl_per_face) from the bottom-drag configuration and size its workspace. Called once at configure, BEFORE enter_data, by rdb_ocean_setup when bbl_glue is on. MOM6 set_visc_init is the parameter map:

  • quadratic: CDRAG = cd, LINEAR_DRAG = False;
  • linear: LINEAR_DRAG = True with CDRAG·DRAG_BG_VEL = r·hbbl, the stress r·hbbl·u of roundabout’s HBBL-distributed linear drag, so CDRAG = r·hbbl/bg_vel (needs bg_vel > 0);
  • HBBL = hbbl, DRAG_BG_VEL = bg_vel, BBL_THICK_MIN = thick_min, KV = kv_bg, RiNo_mix = rino_cap;
  • BBL_USE_EOS = True (mandatory in ALE mode), CORRECT_BBL_BOUNDS = False, BBL_USE_TIDAL_BG = False, CHANNEL_DRAG = False, BODY_FORCE_DRAG = False.

A form with no drag (cd <= 0 quadratic, r <= 0 / bg_vel <= 0 linear) or hbbl <= 0 leaves the glue OFF (bbl_glue = .false.) and the caller’s drag path untouched — there is no MOM6 bottom-drag law to port without a drag, and MOM6 has no HBBL-less one.

Arguments

Type IntentOptional Attributes Name
class(ocean_vdiff_t), intent(inout) :: this
integer, intent(in) :: nx

Cell-centred extents (ghosts included) of the workspace.

integer, intent(in) :: ny

Cell-centred extents (ghosts included) of the workspace.

integer, intent(in) :: nz

Cell-centred extents (ghosts included) of the workspace.

integer, intent(in) :: form

BBL_FORM_LINEAR or BBL_FORM_QUADRATIC.

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

Quadratic drag coefficient (dimensionless).

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

Linear drag rate (1/s) of the HBBL-distributed linear drag.

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

MOM6 HBBL (m).

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

MOM6 DRAG_BG_VEL (m/s).

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

MOM6 BBL_THICK_MIN (m).

logical, intent(in) :: rino_cap

MOM6 RiNo_mix (kappa-shear on).

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

Boussinesq reference density (kg/m^3).

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

MOM6 KV, the background viscosity (m^2/s).


Called by

proc~~vdiff_bbl_configure~~CalledByGraph proc~vdiff_bbl_configure vdiff_bbl_configure proc~configure_ocean_vmix configure_ocean_vmix proc~configure_ocean_vmix->proc~vdiff_bbl_configure proc~engine_setup engine_setup proc~engine_setup->proc~configure_ocean_vmix proc~complete_ocean_create complete_ocean_create proc~complete_ocean_create->proc~engine_setup proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_setup proc~driver_validate driver_validate proc~driver_validate->proc~engine_setup proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean proc~rdb_ocean_create_finalize rdb_ocean_create_finalize proc~rdb_ocean_create_finalize->proc~complete_ocean_create proc~rdb_ocean_create_from_string rdb_ocean_create_from_string proc~rdb_ocean_create_from_string->proc~complete_ocean_create

Source Code

   subroutine vdiff_bbl_configure(this, nx, ny, nz, form, cd, r_linear, hbbl, bg_vel, &
                                  thick_min, rino_cap, rho0, kv_bg)
      !! Latch the MOM6 per-face bottom boundary layer (`bbl_per_face`) from
      !! the bottom-drag configuration and size its workspace.  Called once
      !! at configure, BEFORE `enter_data`, by `rdb_ocean_setup` when
      !! `bbl_glue` is on.  MOM6 `set_visc_init` is the parameter map:
      !!
      !!   * quadratic: `CDRAG = cd`, `LINEAR_DRAG = False`;
      !!   * linear: `LINEAR_DRAG = True` with `CDRAG·DRAG_BG_VEL = r·hbbl`,
      !!     the stress `r·hbbl·u` of roundabout's HBBL-distributed linear
      !!     drag, so `CDRAG = r·hbbl/bg_vel` (needs `bg_vel > 0`);
      !!   * `HBBL = hbbl`, `DRAG_BG_VEL = bg_vel`, `BBL_THICK_MIN =
      !!     thick_min`, `KV = kv_bg`, `RiNo_mix = rino_cap`;
      !!   * `BBL_USE_EOS = True` (mandatory in ALE mode),
      !!     `CORRECT_BBL_BOUNDS = False`, `BBL_USE_TIDAL_BG = False`,
      !!     `CHANNEL_DRAG = False`, `BODY_FORCE_DRAG = False`.
      !!
      !! A form with no drag (`cd <= 0` quadratic, `r <= 0` / `bg_vel <= 0`
      !! linear) or `hbbl <= 0` leaves the glue OFF (`bbl_glue = .false.`)
      !! and the caller's drag path untouched — there is no MOM6
      !! bottom-drag law to port without a drag, and MOM6 has no HBBL-less
      !! one.
      class(ocean_vdiff_t), intent(inout) :: this
      integer, intent(in) :: nx, ny, nz
         !! Cell-centred extents (ghosts included) of the workspace.
      integer, intent(in) :: form
         !! `BBL_FORM_LINEAR` or `BBL_FORM_QUADRATIC`.
      real(wp), intent(in) :: cd
         !! Quadratic drag coefficient (dimensionless).
      real(wp), intent(in) :: r_linear
         !! Linear drag rate (1/s) of the HBBL-distributed linear drag.
      real(wp), intent(in) :: hbbl
         !! MOM6 `HBBL` (m).
      real(wp), intent(in) :: bg_vel
         !! MOM6 `DRAG_BG_VEL` (m/s).
      real(wp), intent(in) :: thick_min
         !! MOM6 `BBL_THICK_MIN` (m).
      logical, intent(in) :: rino_cap
         !! MOM6 `RiNo_mix` (kappa-shear on).
      real(wp), intent(in) :: rho0
         !! Boussinesq reference density (kg/m^3).
      real(wp), intent(in) :: kv_bg
         !! MOM6 `KV`, the background viscosity (m^2/s).

      this%bbl_per_face = .false.
      if (.not. this%bbl_glue) return
      this%bbl_form = form
      this%bbl_hbbl = hbbl
      this%bbl_bg_vel = bg_vel
      this%bbl_thick_min = thick_min
      this%bbl_rino_cap = rino_cap
      this%bbl_rho0 = rho0
      this%kv_bbl_bg = kv_bg
      if (form == BBL_FORM_LINEAR) then
         this%bbl_cd = 0.0_wp
         if (bg_vel > 0.0_wp) this%bbl_cd = r_linear*hbbl/bg_vel
      else
         this%bbl_cd = cd
      end if
      if (this%bbl_cd <= 0.0_wp .or. hbbl <= 0.0_wp) then
         this%bbl_glue = .false.
         return
      end if
      this%bbl_per_face = .true.
      if (allocated(this%bbl_conc_t)) deallocate (this%bbl_conc_t)
      if (allocated(this%bbl_conc_s)) deallocate (this%bbl_conc_s)
      allocate (this%bbl_conc_t(nx, ny, nz), source=0.0_wp)
      allocate (this%bbl_conc_s(nx, ny, nz), source=0.0_wp)
   end subroutine vdiff_bbl_configure