Skip to content

Commit

Permalink
add viscosities due to tidal mixing
Browse files Browse the repository at this point in the history
  • Loading branch information
alperaltuntas committed May 17, 2018
1 parent cfc6742 commit 8c83e21
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/parameterizations/vertical/MOM_set_diffusivity.F90
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ subroutine set_diffusivity(u, v, h, u_h, v_h, tv, fluxes, optics, visc, dt, &

! Add the Nikurashin and / or tidal bottom-driven mixing
call calculate_tidal_mixing(h, N2_bot, j, TKE_to_Kd, maxTKE, G, GV, CS%tm_csp, &
N2_lay, N2_int, Kd, Kd_int, CS%Kd_max)
N2_lay, N2_int, Kd, Kd_int, CS%Kd_max, visc%Kv_slow)

! This adds the diffusion sustained by the energy extracted from the flow
! by the bottom drag.
Expand Down
24 changes: 19 additions & 5 deletions src/parameterizations/vertical/MOM_tidal_mixing.F90
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ end function tidal_mixing_init
!! tidal dissipation and to add the effect of internal-tide-driven mixing to the layer or interface
!! diffusivities.
subroutine calculate_tidal_mixing(h, N2_bot, j, TKE_to_Kd, max_TKE, G, GV, CS, &
N2_lay, N2_int, Kd, Kd_int, Kd_max)
N2_lay, N2_int, Kd, Kd_int, Kd_max, Kv)
type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure
type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure
real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(in) :: h !< Layer thicknesses, in H (usually m or kg m-2)
Expand All @@ -655,10 +655,12 @@ subroutine calculate_tidal_mixing(h, N2_bot, j, TKE_to_Kd, max_TKE, G, GV, CS, &
real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(inout) :: Kd
real, dimension(SZI_(G),SZJ_(G),SZK_(G)+1), optional, intent(inout) :: Kd_int
real, intent(inout) :: Kd_max
real, dimension(:,:,:), pointer :: Kv !< The "slow" vertical viscosity at each interface
!! (not layer!) in m2 s-1.

if (CS%Int_tide_dissipation .or. CS%Lee_wave_dissipation .or. CS%Lowmode_itidal_dissipation) then
if (CS%use_CVMix_tidal) then
call calculate_CVMix_tidal(h, j, G, GV, CS, N2_int, Kd)
call calculate_CVMix_tidal(h, j, G, GV, CS, N2_int, Kd, Kv)
else
call add_int_tide_diffusivity(h, N2_bot, j, TKE_to_Kd, max_TKE, G, GV, CS, &
N2_lay, Kd, Kd_int, Kd_max)
Expand All @@ -669,14 +671,16 @@ subroutine calculate_tidal_mixing(h, N2_bot, j, TKE_to_Kd, max_TKE, G, GV, CS, &

!> Calls the CVMix routines to compute tidal dissipation and to add the effect of internal-tide-driven
!! mixing to the interface diffusivities.
subroutine calculate_CVMix_tidal(h, j, G, GV, CS, N2_int, Kd)
subroutine calculate_CVMix_tidal(h, j, G, GV, CS, N2_int, Kd, Kv)
integer, intent(in) :: j
type(ocean_grid_type), intent(in) :: G !< Grid structure.
type(verticalGrid_type), intent(in) :: GV !< ocean vertical grid structure
type(tidal_mixing_cs), pointer :: CS !< This module's control structure.
real, dimension(SZI_(G),SZK_(G)+1), intent(in) :: N2_int
real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(in) :: h !< Layer thicknesses, in H (usually m or kg m-2).
real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(inout) :: Kd
real, dimension(:,:,:), pointer :: Kv !< The "slow" vertical viscosity at each interface
!! (not layer!) in m2 s-1.

! local
real, dimension(SZK_(G)+1) :: Kd_tidal !< tidal diffusivity [m2/s]
Expand Down Expand Up @@ -744,9 +748,14 @@ subroutine calculate_CVMix_tidal(h, j, G, GV, CS, N2_int, Kd)
CVMix_params = CS%CVMix_glb_params, &
CVMix_tidal_params_user = CS%CVMix_tidal_params)

! Update diffusivity
do k=1,G%ke
Kd(i,j,k) = Kd(i,j,k) + 0.5*(Kd_tidal(k) + Kd_tidal(k+1) )
!TODO: Kv(i,j,k) = ????????????
enddo

! Update viscosity
do k=1,G%ke+1
Kv(i,j,k) = Kv(i,j,k) + Kv_tidal(k)
enddo

! diagnostics
Expand Down Expand Up @@ -836,9 +845,14 @@ subroutine calculate_CVMix_tidal(h, j, G, GV, CS, N2_int, Kd)
CVmix_params = CS%CVMix_glb_params, &
CVmix_tidal_params_user = CS%CVMix_tidal_params)

! Update diffusivity
do k=1,G%ke
Kd(i,j,k) = Kd(i,j,k) + 0.5*(Kd_tidal(k) + Kd_tidal(k+1) )
!TODO: Kv(i,j,k) = ????????????
enddo

! Update viscosity
do k=1,G%ke+1
Kv(i,j,k) = Kv(i,j,k) + Kv_tidal(k)
enddo

! diagnostics
Expand Down

0 comments on commit 8c83e21

Please sign in to comment.