meke_ku_closure Subroutine

private pure subroutine meke_ku_closure(nx, ny, backscatter, visc_coeff_ku, meke, le, ku)

Derived harmonic backscatter viscosity ku = visc_coeff_ku*sqrt(2*max(0,E))*Lmix (m²/s), matching MOM6 MEKE%Ku = MEKE_VISCOSITY_COEFF_KU*sqrt(2*MEKE)*Lmix. Unlike the kh closure (which carries the barotropic-mode factor gamma_t2 inside the eddy velocity), MOM6’s Ku uses the PLAIN sqrt(2*MEKE) — no vertical-structure factor — so gamma_t2 is deliberately absent here (vertical structure BS_struct = 1; EBT/SQG deferred). Off ⇒ ku left at 0 (bit-identical seam). Always ≥ 0; the SIGN of the momentum effect is set by the subtraction downstream.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nx
integer, intent(in) :: ny
logical, intent(in) :: backscatter
real(kind=wp), intent(in) :: visc_coeff_ku
real(kind=wp), intent(in) :: meke(nx,ny)
real(kind=wp), intent(in) :: le(nx,ny)
real(kind=wp), intent(out) :: ku(nx,ny)

Calls

proc~~meke_ku_closure~~CallsGraph proc~meke_ku_closure meke_ku_closure local local proc~meke_ku_closure->local

Called by

proc~~meke_ku_closure~~CalledByGraph proc~meke_ku_closure meke_ku_closure proc~meke_step meke_step proc~meke_step->proc~meke_ku_closure proc~run_meke_step run_meke_step proc~run_meke_step->proc~meke_step proc~ocean_dyn_step_split ocean_dyn_step_split proc~ocean_dyn_step_split->proc~run_meke_step 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

Variables

Type Visibility Attributes Name Initial
integer, private :: i
integer, private :: j
real(kind=wp), private :: ueddy

Source Code

   pure subroutine meke_ku_closure(nx, ny, backscatter, visc_coeff_ku, &
                                   meke, le, ku)
      !! Derived harmonic backscatter viscosity
      !! `ku = visc_coeff_ku*sqrt(2*max(0,E))*Lmix` (m²/s), matching MOM6
      !! `MEKE%Ku = MEKE_VISCOSITY_COEFF_KU*sqrt(2*MEKE)*Lmix`.  Unlike the
      !! kh closure (which carries the barotropic-mode factor `gamma_t2`
      !! inside the eddy velocity), MOM6's Ku uses the PLAIN `sqrt(2*MEKE)` —
      !! no vertical-structure factor — so `gamma_t2` is deliberately absent
      !! here (vertical structure `BS_struct = 1`; EBT/SQG deferred).
      !! Off ⇒ ku left at 0 (bit-identical seam).  Always ≥ 0; the SIGN of
      !! the momentum effect is set by the subtraction downstream.
      integer, intent(in) :: nx, ny
      logical, intent(in) :: backscatter
      real(wp), intent(in) :: visc_coeff_ku
      real(wp), intent(in) :: meke(nx, ny)
      real(wp), intent(in) :: le(nx, ny)
      real(wp), intent(out) :: ku(nx, ny)
      integer :: i, j
      real(wp) :: ueddy

      do concurrent(j=1:ny, i=1:nx) local(ueddy)
         if (backscatter .and. visc_coeff_ku /= 0.0_wp) then
            ueddy = sqrt(2.0_wp*max(0.0_wp, meke(i, j)))
            ku(i, j) = visc_coeff_ku*ueddy*le(i, j)
         else
            ku(i, j) = 0.0_wp
         end if
      end do
   end subroutine meke_ku_closure