##### Eddy-diffusivity models

abstract type EddyDiffusivityModel end

struct SCAMPyEddyDiffusivity{FT} <: EddyDiffusivityModel
    tke_ed_coeff::FT
end

"""
    compute_eddy_diffusivities_tke!

Define eddy-diffusivity fields

 - `aux[:K_m, k, i]`
 - `aux[:K_h, k, i]`

 for all `k` and all `i`
"""
function compute_eddy_diffusivities_tke! end

function compute_eddy_diffusivities_tke!(
    grid::Grid{FT},
    q,
    aux,
    params,
    model::SCAMPyEddyDiffusivity,
) where {FT}
    gm, en, ud, sd, al = allcombinations(q)
    @inbounds for k in over_elems_real(grid)
        l_mix = aux[:l_mix, k, gm]
        K_m_k = model.tke_ed_coeff * l_mix * sqrt(max(q[:tke, k, en], FT(0)))
        aux[:K_m, k, gm] = K_m_k
        aux[:K_h, k, gm] = K_m_k / params[:prandtl_number]
    end
end
