Fill this%ke_diss with the lateral-viscosity KE dissipation rate
Σ_k ρ_k h_k (u·du_visc + v·dv_visc) at T-cell centres (kg/s³; ≤0
where the viscosity removes KE). MUST run AFTER
compute_tendencies (du_visc fresh) and BEFORE the viscous apply,
while u_face/v_face still hold the velocity the viscosity acted
on. No-op (and bit-identical) unless compute_ke_diss is set and
the density field is live. Feeds the MEKE frictional source.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(ocean_horizontal_viscosity_t), | intent(inout) | :: | this | |||
| type(multilayer_state_t), | intent(in) | :: | ms |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | nx | ||||
| integer, | private | :: | ny | ||||
| integer, | private | :: | nz |
subroutine ocean_horizontal_viscosity_compute_ke_diss(this, ms) !! Fill `this%ke_diss` with the lateral-viscosity KE dissipation rate !! `Σ_k ρ_k h_k (u·du_visc + v·dv_visc)` at T-cell centres (kg/s³; ≤0 !! where the viscosity removes KE). MUST run AFTER !! `compute_tendencies` (du_visc fresh) and BEFORE the viscous apply, !! while `u_face`/`v_face` still hold the velocity the viscosity acted !! on. No-op (and bit-identical) unless `compute_ke_diss` is set and !! the density field is live. Feeds the MEKE frictional source. type(ocean_horizontal_viscosity_t), intent(inout) :: this type(multilayer_state_t), intent(in) :: ms integer :: nx, ny, nz if (.not. this%compute_ke_diss) return if (.not. allocated(ms%rho_layer)) return nx = size(ms%u_face_x_layer, 1) - 1 ny = size(ms%v_face_y_layer, 2) - 1 nz = ms%nz_ml call hvisc_ke_diss_impl(nx, ny, nz, ms%u_face_x_layer, ms%v_face_y_layer, & this%du_visc%data, this%dv_visc%data, & ms%rho_layer, ms%h_layer, this%ke_diss) end subroutine ocean_horizontal_viscosity_compute_ke_diss