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

Use OrdinaryDiffEq.jl for timestepping #270

Closed
charleskawczynski opened this issue Sep 16, 2021 · 0 comments · Fixed by #473
Closed

Use OrdinaryDiffEq.jl for timestepping #270

charleskawczynski opened this issue Sep 16, 2021 · 0 comments · Fixed by #473

Comments

@charleskawczynski
Copy link
Member

charleskawczynski commented Sep 16, 2021

We'd like to use OrdinaryDiffEq.jl for time stepping. This will require a lot of work, but I wanted to open an issue for reference. Here's a rough sketch / pseudo code of what we need:

function step!(gm, edmf, ...)

     pre_filter!(gm_model, edmf_model, state, tendencies, ...) # apply pre-aux/state filters
     update_aux!(gm_model, edmf_model, state, tendencies, ...)
     compute_tendencies!(gm_model, edmf_model, state, tendencies, ...)

     # `solve!` will _only_ perform
     #     x = x + Δt * x_tendencies for explicit variables
     #     solve Ax = b for implicit variables (A, b) should be cached at this point.
     # given x, A, b, Δt and x_tendencies
     solve!(gm, edmf, ...) # This will eventually be replaced by calls to OrdinaryDiffEq.jl, with the appropriate tendencies / matrices
     post_filter!(gm_model, edmf_model, state, tendencies, ...) # apply post-aux/state filters
     callbacks!(gm, edmf, ...) # for exporting diagnostics / io
end

function compute_tendencies!(gm_model, edmf_model, state, tendencies, ...)
     # compute grid mean tendencies for all explicit / implicit stepped equations
     compute_material_tendencies!(edmf_model, gm_model, state, tendencies, ...)
end

# This is where all edmf specific functions should live:
function compute_material_tendencies!(edmf_model, gm_model, state, tendencies, ...)
     # compute edmf tendencies for all explicit / implicit stepped equations
end

function update_aux!(gm_model, edmf_model, state, tendencies, ...)
     # Update grid mean aux variables
     update_aux!(edmf_model, gm_model, state, tendencies, ...)
end

function update_aux!(edmf_model, gm_model, state, tendencies, ...)
     # Update edmf aux variables
end
bors bot added a commit that referenced this issue Sep 16, 2021
271: Restructure-- split tendencies from solve r=charleskawczynski a=charleskawczynski

This PR restructures the code to split tendency computations from the solve by adding some data structures to `EDMF_PrognosticTKE`.

A step towards #270.

Co-authored-by: Charles Kawczynski <kawczynski.charles@gmail.com>
@bors bors bot closed this as completed in ed7e2a4 Nov 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant