NCAR / micm

A model-independent chemistry module for atmosphere models
https://ncar.github.io/micm/
Apache License 2.0
6 stars 4 forks source link

572 check for singularity when the solver parameters flag is turned on #603

Closed K20shores closed 1 month ago

K20shores commented 1 month ago

Closes #572

This PR fixes an unknown bug where a zero in the bottom right position of the U matrix (which leads to a singular matrix) was not detected by always checking for zero in the bottom right element. Additionally, two tests are added to check for singular matrices when running rosenbrock

I learned that to get a singular U matrix, at least for these simple 2 and 3 species reactions, we needed a negative reaction rate, which I think is not physically realistic. This, in addition to the knowledge that chemical simulations have been running for decades without a singularity check, seem to indicate that chemical systems are not structured in a way that would lead to singular systems.

codecov-commenter commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 93.47%. Comparing base (6a60a49) to head (03b15ef).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #603 +/- ## ========================================== + Coverage 93.17% 93.47% +0.30% ========================================== Files 49 49 Lines 3500 3494 -6 ========================================== + Hits 3261 3266 +5 + Misses 239 228 -11 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.