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

Generalize ldiv! #221

Closed
juliasloan25 opened this issue Jun 6, 2023 · 1 comment
Closed

Generalize ldiv! #221

juliasloan25 opened this issue Jun 6, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@juliasloan25
Copy link
Member

juliasloan25 commented Jun 6, 2023

Is your feature request related to a problem? Please describe.
#218 introduces functions used for implicit timestepping. These will soon be moved to ClimaTimeSteppers (see CliMA/ClimaCore.jl#1230), but we should still generalize them while they are in ClimaLSM.

ldiv! current accesses x.soil.\vartheta_l, which is hardcoded for RRE. We want this function to work for any problem that may be stepped implicitly. We need to generalize this prognostic variable access, maybe by unpacking x recursively as is done for dss! in #218.

Alternative solution
Alternatively, we could have ldiv! dispatch off of concrete TridiagonalW types (so RichardsTridiagonalW for RRE). Then we'll implement one ldiv! function for each model (which isn't ideal), but we would be able to pass the property to access from x and b (so soil.\vartheta_l for RRE) to _ldiv!/ldiv_serial!, and keep _ldiv! and ldiv_serial! general across all AbstractTridiagonalW types.

Additional context
Ultimately, these functions will be generalized and moved to ClimaTimeSteppers, so we don't need a super optimized implementation here.
See ClimaCore SDI for adding these functions there: CliMA/ClimaCore.jl#1230

@juliasloan25
Copy link
Member Author

ldiv! is still in ClimaLand.jl, but has been generalized in #542 and #651

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

No branches or pull requests

1 participant