ocean_tidal_mixing_t Derived Type

type, public :: ocean_tidal_mixing_t


Inherits

type~~ocean_tidal_mixing_t~~InheritsGraph type~ocean_tidal_mixing_t ocean_tidal_mixing_t type~eos_t eos_t type~ocean_tidal_mixing_t->type~eos_t eos

Inherited by

type~~ocean_tidal_mixing_t~~InheritedByGraph type~ocean_tidal_mixing_t ocean_tidal_mixing_t type~ocean_state_t ocean_state_t type~ocean_state_t->type~ocean_tidal_mixing_t vmix_tidal type~ocean_engine_t ocean_engine_t type~ocean_engine_t->type~ocean_state_t state type~ocean_handle_t ocean_handle_t type~ocean_handle_t->type~ocean_state_t state type~ocean_handle_t->type~ocean_engine_t engine

Components

Type Visibility Attributes Name Initial
logical, public :: e_compute = .false.

v1.1 state-dependent E: when on, e_in = min(TKE_coef*N_bot, e_max). Default off (uses the prescribed e_uniform).

real(kind=wp), public, allocatable :: e_in(:,:)

Bottom internal-tide energy input E (W m-2), (nx,ny).

real(kind=wp), public :: e_max = 1.0e3_wp

TKE_itide_max cap on E (W m-2).

real(kind=wp), public :: e_uniform = 0.0_wp

Uniform bottom energy input E (W m-2); default 0 => inert even when enabled (structural path live, physics zero).

logical, public :: enable = .false.

Master switch. Default off — existing namelists and tests stay bit-identical. Requires vmix%use_closure + thermodynamics (validated at configure).

type(eos_t), public :: eos

Value copy of ocean_state%eos, set at configure — the buoyancy derivatives use the SAME EOS the dyn-core runs.

real(kind=wp), public :: frac_rough = 0.1_wp

Roughness clamp: <= (frac_rough*H)^2.

real(kind=wp), public :: gamma = 0.3333_wp

Local-dissipation fraction q (GAMMA_ITIDES).

real(kind=wp), public :: h2_rough = 0.0_wp

Sub-grid topographic roughness variance (m^2) for v1.1 E.

logical, public :: is_init = .false.

True between init and destroy.

real(kind=wp), public :: kappa_h2 = 1.0_wp

KAPPA_H2_FACTOR for the v1.1 E recompute.

real(kind=wp), public :: kappa_itides = 6.2832e-4_wp

Topographic wavenumber kappa (m^-1) for the v1.1 E recompute.

real(kind=wp), public, allocatable :: kd_int(:,:,:)

Tidal diffusivity at interfaces (m^2/s), (nx,ny,nz+1), global bottom-up: zero at bed (K=1) and surface (K=nz+1).

real(kind=wp), public :: kd_max = 1.0e-2_wp

Per-layer physical Kd cap (m^2/s); < 0 => no cap. Distinct from the vmix_assemble ceiling (the final clip).

real(kind=wp), public :: min_zbot = 0.0_wp

Mask off where column depth H < min_zbot (m).

real(kind=wp), public :: mu = 0.2_wp

Mixing efficiency Gamma_mix (MU_ITIDES).

real(kind=wp), public :: omega2 = OMEGA_EARTH**2

Rotation floor Omega^2 (s^-2) on N^2; physics, not merely a 1/0 guard. The floor is plain Omega^2 (Melet et al. 2013 efficiency rescaling N^2/(N^2+Omega^2)), not (2*Omega)^2.

real(kind=wp), public :: prandtl_tidal = 1.0_wp

Kv = prandtl_tidal * Kd into the momentum solve.

real(kind=wp), public :: rho0 = 1035.0_wp

Boussinesq reference density (kg/m^3).

real(kind=wp), public :: utide = 0.0_wp

RMS barotropic tidal velocity amplitude (m/s) for v1.1 E.

real(kind=wp), public :: zeta = 500.0_wp

Bottom decay scale (m) (INT_TIDE_DECAY_SCALE).


Type-Bound Procedures

procedure, public, non_overridable :: bytes => ocean_tidal_mixing_bytes

  • private pure function ocean_tidal_mixing_bytes(this) result(nbytes)

    Counted allocatable footprint of the tidal mixing slot (0 when unallocated). One arr_bytes term per array — add a term here when a new allocatable joins the type.

    Arguments

    Type IntentOptional Attributes Name
    class(ocean_tidal_mixing_t), intent(in) :: this

    Return Value integer(kind=int64)

procedure, public, non_overridable :: destroy => ocean_tidal_mixing_destroy

procedure, public, non_overridable :: enter_data => ocean_tidal_mixing_enter_data

procedure, public, non_overridable :: exit_data => ocean_tidal_mixing_exit_data

procedure, public, non_overridable :: init => ocean_tidal_mixing_init

  • private subroutine ocean_tidal_mixing_init(this, grid, nz_ml)

    Allocate the persistent fields. Always allocates (configure runs after init, so enable is not known yet); the off-cost is one 2D field + one interface field.

    Arguments

    Type IntentOptional Attributes Name
    class(ocean_tidal_mixing_t), intent(inout) :: this
    type(hgrid_t), intent(in) :: grid
    integer, intent(in), optional :: nz_ml

procedure, public, non_overridable :: set_e_uniform => ocean_tidal_mixing_set_e_uniform

  • private subroutine ocean_tidal_mixing_set_e_uniform(this, e_value)

    Fill the bottom energy field e_in with a uniform value. Host loop (setup phase); call after init, before enter_data.

    Arguments

    Type IntentOptional Attributes Name
    class(ocean_tidal_mixing_t), intent(inout) :: this
    real(kind=wp), intent(in) :: e_value

Source Code

   type :: ocean_tidal_mixing_t
      logical :: is_init = .false.
         !! True between `init` and `destroy`.

      ! ---- Master switch ----
      logical :: enable = .false.
         !! Master switch.  Default off — existing namelists and tests
         !! stay bit-identical.  Requires `vmix%use_closure` +
         !! thermodynamics (validated at configure).

      ! ---- St-Laurent / Simmons knobs (defaults = paper / MOM6) ----
      real(wp) :: gamma = 0.3333_wp
         !! Local-dissipation fraction `q` (GAMMA_ITIDES).
      real(wp) :: mu = 0.2_wp
         !! Mixing efficiency Gamma_mix (MU_ITIDES).
      real(wp) :: zeta = 500.0_wp
         !! Bottom decay scale (m) (INT_TIDE_DECAY_SCALE).
      real(wp) :: kd_max = 1.0e-2_wp
         !! Per-layer physical Kd cap (m^2/s); < 0 => no cap.  Distinct
         !! from the `vmix_assemble` ceiling (the final clip).
      real(wp) :: prandtl_tidal = 1.0_wp
         !! Kv = prandtl_tidal * Kd into the momentum solve.
      real(wp) :: min_zbot = 0.0_wp
         !! Mask off where column depth H < min_zbot (m).
      real(wp) :: omega2 = OMEGA_EARTH**2
         !! Rotation floor Omega^2 (s^-2) on N^2; physics, not merely a
         !! 1/0 guard.  The floor is plain Omega^2 (Melet et al. 2013
         !! efficiency rescaling N^2/(N^2+Omega^2)), not (2*Omega)^2.

      ! ---- Energy source (v1: prescribed scalar/uniform field) ----
      real(wp) :: e_uniform = 0.0_wp
         !! Uniform bottom energy input E (W m-2); default 0 => inert
         !! even when enabled (structural path live, physics zero).
      logical :: e_compute = .false.
         !! v1.1 state-dependent E: when on, `e_in = min(TKE_coef*N_bot,
         !! e_max)`.  Default off (uses the prescribed `e_uniform`).
      real(wp) :: kappa_itides = 6.2832e-4_wp
         !! Topographic wavenumber kappa (m^-1) for the v1.1 E recompute.
      real(wp) :: kappa_h2 = 1.0_wp
         !! KAPPA_H2_FACTOR for the v1.1 E recompute.
      real(wp) :: utide = 0.0_wp
         !! RMS barotropic tidal velocity amplitude (m/s) for v1.1 E.
      real(wp) :: h2_rough = 0.0_wp
         !! Sub-grid topographic roughness variance <h^2> (m^2) for v1.1 E.
      real(wp) :: frac_rough = 0.1_wp
         !! Roughness clamp: <h^2> <= (frac_rough*H)^2.
      real(wp) :: e_max = 1.0e3_wp
         !! TKE_itide_max cap on E (W m-2).

      ! ---- EOS hookup (shared flat-POD handle from the eos slot) ----
      type(eos_t) :: eos
         !! Value copy of `ocean_state%eos`, set at configure — the
         !! buoyancy derivatives use the SAME EOS the dyn-core runs.
      real(wp) :: rho0 = 1035.0_wp
         !! Boussinesq reference density (kg/m^3).

      ! ---- Persistent fields ----
      real(wp), allocatable :: e_in(:, :)
         !! Bottom internal-tide energy input E (W m-2), (nx,ny).
      real(wp), allocatable :: kd_int(:, :, :)
         !! Tidal diffusivity at interfaces (m^2/s), (nx,ny,nz+1),
         !! global bottom-up: zero at bed (K=1) and surface (K=nz+1).
   contains
      procedure, non_overridable :: init => ocean_tidal_mixing_init
      procedure, non_overridable :: destroy => ocean_tidal_mixing_destroy
      procedure, non_overridable :: enter_data => ocean_tidal_mixing_enter_data
      procedure, non_overridable :: exit_data => ocean_tidal_mixing_exit_data
      procedure, non_overridable :: set_e_uniform => ocean_tidal_mixing_set_e_uniform
      procedure, non_overridable :: bytes => ocean_tidal_mixing_bytes
   end type ocean_tidal_mixing_t