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

Compute and add tendencies by default #219

Open
charleskawczynski opened this issue Sep 26, 2023 · 0 comments
Open

Compute and add tendencies by default #219

charleskawczynski opened this issue Sep 26, 2023 · 0 comments

Comments

@charleskawczynski
Copy link
Member

One pattern that we're currently using is:

# ClimaODEFunction(;
T_exp! = nothing
)

...

if !isnothing(T_exp!)
     T_exp!(U, p, t)
end
...
if !isnothing(T_exp!)
     @. U_exp += dt * T_exp
end

This really complicates the code. I think the algorithm will be much easier if we by default initialize T_exp = zeros and have T_exp! = (u,p,t) -> nothing. The optimization as it is, is really only benefiting toy examples where, for example, T_exp (or T_lim) don't exist. If they're toy examples, adding these zeros (@. U_exp += dt * T_exp) is should not be an issue. Basically, I think we shouldn't be optimizing for toy examples, and write the code in a simpler way for the real world example, but also allow it to work for toy examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant