Skip to content

Commit

Permalink
Add tidal diffusivities (Kd_tidal) into Kd_int
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavo-marques committed May 6, 2020
1 parent 0cddf1f commit c06515f
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/parameterizations/vertical/MOM_tidal_mixing.F90
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ subroutine calculate_tidal_mixing(h, N2_bot, j, TKE_to_Kd, max_TKE, G, GV, US, C
real, dimension(SZI_(G),SZJ_(G),SZK_(G)), &
intent(inout) :: Kd_lay !< The diapycnal diffusvity in layers [Z2 T-1 ~> m2 s-1].
real, dimension(SZI_(G),SZJ_(G),SZK_(G)+1), &
optional, intent(inout) :: Kd_int !< The diapycnal diffusvity at interfaces,
optional, intent(inout) :: Kd_int !< The diapycnal diffusvity at interfaces,
!! [Z2 T-1 ~> m2 s-1].
real, intent(in) :: Kd_max !< The maximum increment for diapycnal
!! diffusivity due to TKE-based processes,
Expand All @@ -692,7 +692,7 @@ subroutine calculate_tidal_mixing(h, N2_bot, j, TKE_to_Kd, max_TKE, G, GV, US, C

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, US, CS, N2_int, Kd_lay, Kv)
call calculate_CVMix_tidal(h, j, G, GV, US, CS, N2_int, Kd_lay, Kd_int, Kv)
else
call add_int_tide_diffusivity(h, N2_bot, j, TKE_to_Kd, max_TKE, &
G, GV, US, CS, N2_lay, Kd_lay, Kd_int, Kd_max)
Expand All @@ -703,7 +703,7 @@ end subroutine calculate_tidal_mixing

!> 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, US, CS, N2_int, Kd_lay, Kv)
subroutine calculate_CVMix_tidal(h, j, G, GV, US, CS, N2_int, Kd_lay, Kd_int, Kv)
integer, intent(in) :: j !< The j-index to work on
type(ocean_grid_type), intent(in) :: G !< Grid structure.
type(verticalGrid_type), intent(in) :: GV !< ocean vertical grid structure
Expand All @@ -715,6 +715,9 @@ subroutine calculate_CVMix_tidal(h, j, G, GV, US, CS, N2_int, Kd_lay, Kv)
intent(in) :: h !< Layer thicknesses [H ~> m or kg m-2].
real, dimension(SZI_(G),SZJ_(G),SZK_(G)), &
intent(inout) :: Kd_lay!< The diapycnal diffusivities in the layers [Z2 T-1 ~> m2 s-1].
real, dimension(SZI_(G),SZJ_(G),SZK_(G)+1), &
optional, intent(inout) :: Kd_int !< The diapycnal diffusvity at interfaces,
!! [Z2 T-1 ~> m2 s-1].
real, dimension(:,:,:), pointer :: Kv !< The "slow" vertical viscosity at each interface
!! (not layer!) [Z2 T-1 ~> m2 s-1].
! Local variables
Expand Down Expand Up @@ -794,7 +797,11 @@ subroutine calculate_CVMix_tidal(h, j, G, GV, US, CS, N2_int, Kd_lay, Kv)
do k=1,G%ke
Kd_lay(i,j,k) = Kd_lay(i,j,k) + 0.5 * US%m2_s_to_Z2_T * (Kd_tidal(k) + Kd_tidal(k+1))
enddo

if (present(Kd_int)) then
do k=1,G%ke+1
Kd_int(i,j,k) = Kd_int(i,j,k) + (US%m2_s_to_Z2_T * Kd_tidal(k))
enddo
endif
! Update viscosity with the proper unit conversion.
if (associated(Kv)) then
do k=1,G%ke+1
Expand Down Expand Up @@ -896,6 +903,11 @@ subroutine calculate_CVMix_tidal(h, j, G, GV, US, CS, N2_int, Kd_lay, Kv)
do k=1,G%ke
Kd_lay(i,j,k) = Kd_lay(i,j,k) + 0.5 * US%m2_s_to_Z2_T * (Kd_tidal(k) + Kd_tidal(k+1))
enddo
if (present(Kd_int)) then
do k=1,G%ke+1
Kd_int(i,j,k) = Kd_int(i,j,k) + (US%m2_s_to_Z2_T * Kd_tidal(k))
enddo
endif

! Update viscosity
if (associated(Kv)) then
Expand Down

0 comments on commit c06515f

Please sign in to comment.