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

prevent hang by erroring out if shortest_time_between_assimilations <=0 #713

Merged
merged 2 commits into from
Aug 29, 2024

Conversation

hkershaw-brown
Copy link
Member

Description:

Catch and error out when shortest_time_between_assimilations/get_model_time_step == 0
This prevents hangs in lower order models (e.g. lorenz_96) and "Inconsistent model state/observation times, cannot continue" in large models.

Note the routine shortest_time_between_assimilations and get_model_time_step are the same routine.

get_model_time_step => shortest_time_between_assimilations, &

Fixes issue

fixes #535

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Documentation changes needed?

  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.

Tests

Please describe any tests you ran to verify your changes.

lorenz_96 with

&model_nml
   ...
   time_step_days    = 0,
   time_step_seconds = 0,
   /

hangs on main, errors out with message 'shortest_time_between_assimilations must be > 0' with this fix.

wrf with

&model_nml
   assimilation_period_seconds = 0,

Errors out with message 'shortest_time_between_assimilations must be > 0' with this fix

Checklist for merging

  • Updated changelog entry
  • Documentation updated
  • Update conf.py

Checklist for release

  • Merge into main
  • Create release from the main branch with appropriate tag
  • Delete feature-branch

Testing Datasets

  • Dataset needed for testing available upon request
  • Dataset download instructions included
  • No dataset needed

shortest_time_between_assimilations is get_model_time_step

fixes #535
Copy link
Contributor

@mjs2369 mjs2369 left a comment

Choose a reason for hiding this comment

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

Nice fix

Tried it with lorenz_96: code hangs on the main branch as expected, but errors out correctly with this check implemented

@hkershaw-brown hkershaw-brown added the release! bundle with next release label Aug 28, 2024
@braczka
Copy link
Contributor

braczka commented Aug 28, 2024

I would like to take a look at this soon, but just bogged down with other bugs -- go ahead and merge if you want to push this through though.

@hkershaw-brown hkershaw-brown merged commit 7d5fd79 into main Aug 29, 2024
4 checks passed
@hkershaw-brown hkershaw-brown deleted the fix-zero-window branch August 29, 2024 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release! bundle with next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: dart doesn't catch 0 size model advance windows (hangs for subroutine callable models)
3 participants