add option to use thomas algorithm within SemiImplicitModel#1885
Open
pat-schmitt wants to merge 1 commit into
Open
add option to use thomas algorithm within SemiImplicitModel#1885pat-schmitt wants to merge 1 commit into
pat-schmitt wants to merge 1 commit into
Conversation
Member
|
I think that it does not need to be an option unless for testing? For me a few GCM simulations for a few regions (say, alps and antarctica) to check that results are unchanged would be enough as a test. If results and error rates are the same, then this should simply be the new default? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Here I add an option to the
SemiImplicitModelto use a strapped down version ofscipy.linalg.solve_banded, which replicates the thomas algorithm. This means we are not checking that the inputs are valid (no NaNs and finite) and we automatically select the correct fortran function for our input type. All this is normally happening inside ofscipy.linalg.solve_bandedat every callI quickly tested the speed up with this:
And found that the new implementation needs between 75% to 85% of the original time. Not much but for regional to global simulations this will add up.
For discussion if it is worth to implement properly (adding more tests that the model output is not effected).
whats-new.rst