Per-face harmonic-viscosity ceiling for the velocity-Laplacian
paths (MOM6 Kh_Max_xx analogue, uniform-grid reduction):
ν_max = bound_coef · 0.125 / (dt · (idx² + idy²))
— one quarter of the forward-Euler stability limit
ν·dt·4·(idx²+idy²) ≤ 2, the same margin MOM6’s harmonic
bound uses (“avoid overshoots when bound_coef < 1”). Keeps
the FROZEN depth-mean viscous forcing on the barotropic mode
(F_bt) out of the phase-reversed anti-damping regime for
grid-scale gravity modes (see the bound_kh docstring).
Returns huge (no clamp) for a fully-masked face.
!$acc routine seq — called from the Laplacian do concurrent.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | idx |
Metric inverses |
||
| real(kind=wp), | intent(in) | :: | idy |
Metric inverses |
||
| real(kind=wp), | intent(in) | :: | bound_coef |
CFL safety coefficient ( |
||
| real(kind=wp), | intent(in) | :: | idt |
Reciprocal time step |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | private | :: | k2 |
pure function hvisc_kh_cfl_bound(idx, idy, bound_coef, idt) result(kh_max_cfl) !! Per-face harmonic-viscosity ceiling for the velocity-Laplacian !! paths (MOM6 `Kh_Max_xx` analogue, uniform-grid reduction): !! `ν_max = bound_coef · 0.125 / (dt · (idx² + idy²))` !! — one quarter of the forward-Euler stability limit !! `ν·dt·4·(idx²+idy²) ≤ 2`, the same margin MOM6's harmonic !! bound uses ("avoid overshoots when bound_coef < 1"). Keeps !! the FROZEN depth-mean viscous forcing on the barotropic mode !! (`F_bt`) out of the phase-reversed anti-damping regime for !! grid-scale gravity modes (see the `bound_kh` docstring). !! Returns huge (no clamp) for a fully-masked face. !! `!$acc routine seq` — called from the Laplacian `do concurrent`. real(wp), intent(in) :: idx, idy !! Metric inverses `1/dx`, `1/dy` at the face. real(wp), intent(in) :: bound_coef !! CFL safety coefficient (`this%bound_coef`). real(wp), intent(in) :: idt !! Reciprocal time step `1/dt`. real(wp) :: kh_max_cfl real(wp) :: k2 !$acc routine seq k2 = idx*idx + idy*idy if (k2 > 0.0_wp) then kh_max_cfl = bound_coef*0.125_wp*idt/k2 else kh_max_cfl = huge(1.0_wp) end if end function hvisc_kh_cfl_bound