Skip to content

Commit

Permalink
Option to apply KHTH_MIN in the whole water column
Browse files Browse the repository at this point in the history
This commit introduces a new parameter, FULL_DEPTH_KHTH_MIN, which
enforces a user-specified minimum diffusivity (KHTH_MIN) to be
applied throughout the entire water column instead of only at
the surface. This option is available only when
KHTH_USE_EBT_STRUCT=True and KHTH_MIN > 0.
  • Loading branch information
gustavo-marques committed Aug 2, 2024
1 parent 967908d commit 0c63d96
Showing 1 changed file with 43 additions and 9 deletions.
52 changes: 43 additions & 9 deletions src/parameterizations/lateral/MOM_thickness_diffuse.F90
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ module MOM_thickness_diffuse
real :: kappa_smooth !< Vertical diffusivity used to interpolate more sensible values
!! of T & S into thin layers [H Z T-1 ~> m2 s-1 or kg m-1 s-1]
logical :: thickness_diffuse !< If true, interfaces heights are diffused.
logical :: full_depth_khth_min !< If true, KHTH_MIN is enforced throughout the whole water column.
!! Otherwise, KHTH_MIN is only enforced at the surface. This parameter
!! is only available when KHTH_USE_EBT_STRUCT=True and KHTH_MIN>0.
logical :: use_FGNV_streamfn !< If true, use the streamfunction formulation of
!! Ferrari et al., 2010, which effectively emphasizes
!! graver vertical modes by smoothing in the vertical.
Expand Down Expand Up @@ -294,10 +297,18 @@ subroutine thickness_diffuse(h, uhtr, vhtr, tv, dt, G, GV, US, MEKE, VarMix, CDp
enddo ; enddo

if (khth_use_ebt_struct) then
!$OMP do
do K=2,nz+1 ; do j=js,je ; do I=is-1,ie
KH_u(I,j,K) = KH_u(I,j,1) * 0.5 * ( VarMix%ebt_struct(i,j,k-1) + VarMix%ebt_struct(i+1,j,k-1) )
enddo ; enddo ; enddo
if (CS%full_depth_khth_min) then
!$OMP do
do K=2,nz+1 ; do j=js,je ; do I=is-1,ie
KH_u(I,j,K) = KH_u(I,j,1) * 0.5 * ( VarMix%ebt_struct(i,j,k-1) + VarMix%ebt_struct(i+1,j,k-1) )
KH_u(I,j,K) = max(KH_u(I,j,K), CS%Khth_Min)
enddo ; enddo ; enddo
else
!$OMP do
do K=2,nz+1 ; do j=js,je ; do I=is-1,ie
KH_u(I,j,K) = KH_u(I,j,1) * 0.5 * ( VarMix%ebt_struct(i,j,k-1) + VarMix%ebt_struct(i+1,j,k-1) )
enddo ; enddo ; enddo
endif
else
!$OMP do
do K=2,nz+1 ; do j=js,je ; do I=is-1,ie
Expand Down Expand Up @@ -390,10 +401,18 @@ subroutine thickness_diffuse(h, uhtr, vhtr, tv, dt, G, GV, US, MEKE, VarMix, CDp
endif

if (khth_use_ebt_struct) then
!$OMP do
do K=2,nz+1 ; do J=js-1,je ; do i=is,ie
KH_v(i,J,K) = KH_v(i,J,1) * 0.5 * ( VarMix%ebt_struct(i,j,k-1) + VarMix%ebt_struct(i,j+1,k-1) )
enddo ; enddo ; enddo
if (CS%full_depth_khth_min) then
!$OMP do
do K=2,nz+1 ; do J=js-1,je ; do i=is,ie
KH_v(i,J,K) = KH_v(i,J,1) * 0.5 * ( VarMix%ebt_struct(i,j,k-1) + VarMix%ebt_struct(i,j+1,k-1) )
KH_v(i,J,K) = max(KH_v(i,J,K), CS%Khth_Min)
enddo ; enddo ; enddo
else
!$OMP do
do K=2,nz+1 ; do J=js-1,je ; do i=is,ie
KH_v(i,J,K) = KH_v(i,J,1) * 0.5 * ( VarMix%ebt_struct(i,j,k-1) + VarMix%ebt_struct(i,j+1,k-1) )
enddo ; enddo ; enddo
endif
else
!$OMP do
do K=2,nz+1 ; do J=js-1,je ; do i=is,ie
Expand Down Expand Up @@ -2132,7 +2151,11 @@ subroutine thickness_diffuse_init(Time, G, GV, US, param_file, diag, CDp, CS)
! rotation [nondim].
real :: Stanley_coeff ! Coefficient relating the temperature gradient and sub-gridscale
! temperature variance [nondim]
integer :: default_answer_date ! The default setting for the various ANSWER_DATE flags.
logical :: khth_use_ebt_struct ! If true, uses the equivalent barotropic structure
! as the vertical structure of thickness diffusivity.
! Used to determine if FULL_DEPTH_KHTH_MIN should be
! available.
integer :: default_answer_date ! The default setting for the various ANSWER_DATE flags.
integer :: i, j

CS%initialized = .true.
Expand Down Expand Up @@ -2178,6 +2201,17 @@ subroutine thickness_diffuse_init(Time, G, GV, US, param_file, diag, CDp, CS)
call get_param(param_file, mdl, "KHTH_MIN", CS%KHTH_Min, &
"The minimum horizontal thickness diffusivity.", &
default=0.0, units="m2 s-1", scale=US%m_to_L**2*US%T_to_s)
call get_param(param_file, mdl, "KHTH_USE_EBT_STRUCT", khth_use_ebt_struct, &
"If true, uses the equivalent barotropic structure "//&
"as the vertical structure of thickness diffusivity.",&
default=.false., do_not_log=.true.)
if (khth_use_ebt_struct .and. CS%KHTH_Min>0.0) then
call get_param(param_file, mdl, "FULL_DEPTH_KHTH_MIN", CS%full_depth_khth_min, &
"If true, KHTH_MIN is enforced throughout the whole water column. "//&
"Otherwise, KHTH_MIN is only enforced at the surface. This parameter "//&
"is only available when KHTH_USE_EBT_STRUCT=True and KHTH_MIN>0.", &
default=.false.)
endif
call get_param(param_file, mdl, "KHTH_MAX", CS%KHTH_Max, &
"The maximum horizontal thickness diffusivity.", &
default=0.0, units="m2 s-1", scale=US%m_to_L**2*US%T_to_s)
Expand Down

0 comments on commit 0c63d96

Please sign in to comment.