Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect limiter in FULL_DEPTH_KHTR_MIN implementation #318

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/tracer/MOM_tracer_hor_diff.F90
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@ subroutine tracer_hordiff(h, dt, MEKE, VarMix, visc, G, GV, US, CS, Reg, tv, do_
Kh_v ! Tracer mixing coefficient at u-points [L2 T-1 ~> m2 s-1].

real :: khdt_max ! The local limiting value of khdt_x or khdt_y [L2 ~> m2].
real :: max_CFL ! The global maximum of the diffusive CFL number [nondim]
real :: Coef_min ! The local limiting value of Coef_x or Coef_y, in [L2 ~> m2] for some
! schemes and [H L2 ~> m3 or kg] for others.
real :: max_CFL ! The global maximum of the diffusive CFL number [nondim]
logical :: use_VarMix, Resoln_scaled, do_online, use_Eady
integer :: i, j, k, m, is, ie, js, je, nz, ntr, itt, num_itts
real :: I_numitts ! The inverse of the number of iterations, num_itts [nondim]
Expand Down Expand Up @@ -431,15 +433,17 @@ subroutine tracer_hordiff(h, dt, MEKE, VarMix, visc, G, GV, US, CS, Reg, tv, do_
do J=js-1,je
do i=is,ie
Coef_y(i,J,K) = Coef_y(i,J,1) * 0.5 * ( VarMix%ebt_struct(i,j,k-1) + VarMix%ebt_struct(i,j+1,k-1) )
Coef_y(i,J,K) = max(Coef_y(i,J,K), CS%KhTr_min)
Coef_min = I_numitts * dt * (CS%KhTr_min*(G%dx_Cv(i,J)*G%IdyCv(i,J)))
Coef_y(i,J,K) = max(Coef_y(i,J,K), Coef_min)
enddo
enddo
enddo
do k=2,nz+1
do j=js,je
do I=is-1,ie
Coef_x(I,j,K) = Coef_x(I,j,1) * 0.5 * ( VarMix%ebt_struct(i,j,k-1) + VarMix%ebt_struct(i+1,j,k-1) )
Coef_x(I,j,K) = max(Coef_x(I,j,K), CS%KhTr_min)
Coef_min = I_numitts * dt * (CS%KhTr_min*(G%dy_Cu(I,j)*G%IdxCu(I,j)))
Coef_x(I,j,K) = max(Coef_x(I,j,K), Coef_min)
enddo
enddo
enddo
Expand Down
Loading