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

Make prognostics available for forcing, drag in Barotropic/SWM #423

Merged
merged 5 commits into from
Dec 17, 2023

Conversation

milankl
Copy link
Member

@milankl milankl commented Dec 14, 2023

With this PR the drag formulation from #394 can be simplified to

function SpeedyWeather.drag!(   diagn::SpeedyWeather.DiagnosticVariablesLayer,
                                progn::SpeedyWeather.PrognosticVariablesLayer,
                                drag::JetDrag,
                                time::DateTime,
                                model::SpeedyWeather.ModelSetup)

    (;vor) = progn
    (;vor_tend) = diagn.tendencies
    (;ζ₀) = drag
    
    (;radius) = model.spectral_grid
    r = radius/drag.time_scale.value
    for lm in eachindex(vor,vor_tend,ζ₀)
        vor_tend[lm] -= r*(vor[lm] - ζ₀[lm])
    end
    
    return nothing
end

because PrognosticVariablesLayer is passed on

@milankl milankl added structure 🏠 Internal structure of the code forcing 🏋️ Forcing of the momentum equations dynamics 〰️ Affects the dynamical core labels Dec 14, 2023
@milankl milankl merged commit 3e11df6 into main Dec 17, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dynamics 〰️ Affects the dynamical core forcing 🏋️ Forcing of the momentum equations structure 🏠 Internal structure of the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant