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

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

Closed
nancycollins opened this issue Aug 31, 2023 · 2 comments · Fixed by #713
Assignees
Labels
Bug Something isn't working

Comments

@nancycollins
Copy link
Collaborator

🐛

Describe the bug

  1. compile L96
  2. set the input.nml namelist items model_nml : time_step_days and time_step_seconds to 0
  3. run pmo or filter
  4. wait forever

for larger models with real data times (not 0,0) if you set the window size to 0 you'll get a window that starts at T+1 second and ends at T, which can't contain any of the obs.

Error Message

L96 loops forever. WRF prints:

PE 0:
PE 0: move_ahead Next available observation at: day= 154166 sec=0
PE 0: move_ahead Next assimilation window starts at: day= 154166 sec=1
PE 0: move_ahead Current model data time is: day= 154166 sec=0
PE 0:
ERROR FROM:
source : obs_model_mod.f90
routine: move_ahead
message: Inconsistent model state/observation times, cannot continue
message: ... If this is the start of the obs_seq file,
message: ... can use filter namelist to set first obs or initial data time.

Which model(s) are you working with?

any

Version of DART

the current main branch

Have you modified the DART code?

not yet, but i think the fix is to add a test in assim_model_mod.f90 : get_closest_state_time_to() and error out if time_step is <= 0.

Build information

any machine, any compiler.

@hkershaw-brown hkershaw-brown changed the title bug: dart doesn't catch 0 size model advance windows bug: dart doesn't catch 0 size model advance windows (hangs for subroutine callable models) Sep 5, 2023
@hkershaw-brown hkershaw-brown added the Bug Something isn't working label Nov 27, 2023
@hkershaw-brown
Copy link
Member

! WATCH OUT FOR USING BOUNDARY TIME OBS TWICE; add one second to bottom time
! ALSO, avoid having a negative time for the start (for low-order models in general)
if(delta_time / 2 > time2) then
start_time = set_time(0, 0)
else
start_time = time2 - delta_time / 2 + set_time(1, 0)
endif
end_time = time2 + delta_time / 2

@hkershaw-brown hkershaw-brown self-assigned this Aug 8, 2024
@hkershaw-brown
Copy link
Member

the hang is in the do while loop

do while((time_step + 2*get_closest_state_time_to) < 2*given_time)
get_closest_state_time_to = get_closest_state_time_to + time_step
enddo

(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
  * frame #0: 0x0000000193bbbba0 libsystem_platform.dylib`__bzero
    frame #1: 0x00000001939f286c libsystem_malloc.dylib`nanov2_malloc_zero_on_alloc + 548
    frame #2: 0x00000001019ca4d8 libgfortran.5.dylib`___lldb_unnamed_symbol1692 + 20
    frame #3: 0x0000000101a895b4 libgfortran.5.dylib`___lldb_unnamed_symbol2126 + 56
    frame #4: 0x0000000101a834b0 libgfortran.5.dylib`___lldb_unnamed_symbol2013 + 128
    frame #5: 0x0000000101a81af4 libgfortran.5.dylib`___lldb_unnamed_symbol1992 + 88
    frame #6: 0x0000000101089dfc filter`__time_manager_mod_MOD_set_time at time_manager_mod.f90:177:73
    frame #7: 0x0000000101089a08 filter`__time_manager_mod_MOD_increment_time at time_manager_mod.f90:269:70
    frame #8: 0x000000010108903c filter`__time_manager_mod_MOD_time_plus at time_manager_mod.f90:431:60
    frame #9: 0x0000000100f36a38 filter`__assim_model_mod_MOD_get_closest_state_time_to at assim_model_mod.f90:107:68
    frame #10: 0x0000000101037800 filter`__obs_model_mod_MOD_move_ahead at obs_model_mod.f90:180:54
    frame #11: 0x0000000100fa3150 filter`__filter_mod_MOD_filter_main at filter_mod.f90:1081:57
    frame #12: 0x0000000101089f50 filter`MAIN__ at filter.f90:20:18
    frame #13: 0x0000000101089fa0 filter`main at filter.f90:11:55
    frame #14: 0x0000000193863e50 dyld`start + 2544

hkershaw-brown added a commit that referenced this issue Aug 9, 2024
shortest_time_between_assimilations is get_model_time_step

fixes #535
hkershaw-brown added a commit that referenced this issue Aug 19, 2024
shortest_time_between_assimilations is get_model_time_step

fixes #535
hkershaw-brown added a commit that referenced this issue Aug 26, 2024
shortest_time_between_assimilations is get_model_time_step

fixes #535
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants