Skip to content

Issue648 mld check#649

Merged
einola merged 2 commits intodevelopfrom
issue648_MLD_check
Jan 3, 2024
Merged

Issue648 mld check#649
einola merged 2 commits intodevelopfrom
issue648_MLD_check

Conversation

@einola
Copy link
Copy Markdown
Member

@einola einola commented Jan 3, 2024

Adds a very minimal check to address issue #648. This solution has been tested and it works well.

This adds a check on the MLD in checkFieldsFast, which throws an
std::runtime_error if MLD is outside [0, 10 km]. The lower bound is
quite strict (could also be a few mm) and the upper bound is just there
because the code requires an upper bound. In reality we just want to
check the lower bound.
The check on MLD doesn't really belong in checkFieldsFast, because it's
not a prognostic field. We're just checking if we get crazy input, not
if neXtSIM is doing something wrong. This is better done with a simple
assert in the thermodynamics routine - as I've done in this commit.

This way is also better, because it's more like to be caught right away,
before NaNs spread all over the solution.
@einola einola requested a review from docguibou January 3, 2024 06:30
Copy link
Copy Markdown
Contributor

@docguibou docguibou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worked ok for me, error message was clear.

@einola einola merged commit da8bdda into develop Jan 3, 2024
@einola einola deleted the issue648_MLD_check branch January 3, 2024 08:03
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

Successfully merging this pull request may close these issues.

2 participants