Skip to content

Commit

Permalink
Fix writing of 'dt' when 'stopnow' is used
Browse files Browse the repository at this point in the history
When the 'stopnow' file is created to immediately stop a run,
`t_params.dt_before_output[]` was previously not set, because the
`adaptive_timestep_update_t_params!()` function does not know that there
is going to be an output triggered by 'stopnow', so 'dt' was written
incorrectly. Fix this by setting
`t_params.dt_before_output[] = t_params.dt[]` when 'stopnow' is found.
  • Loading branch information
johnomotani committed Dec 9, 2024
1 parent 6be296b commit 8f14c69
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions moment_kinetics/src/time_advance.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1921,6 +1921,7 @@ function time_advance!(pdf, scratch, scratch_implicit, scratch_electron, t_para
# Stop cleanly if a file called 'stop' was created
println("Found 'stopnow' file $(t_params.stopfile * "now"), aborting run")
finish_now = true
t_params.dt_before_output[] = t_params.dt[]
end

if t_params.adaptive && !t_params.write_after_fixed_step_count
Expand Down

0 comments on commit 8f14c69

Please sign in to comment.