Previously, main would only clamp the next timestep based on when the time that the next output was scheduled for (this was based on incrementing outtime with outstep). This produced some weird behavior when the OUTPUT_ALWAYS macro is defined. As documented in issue https://github.com/cholla-hydro/cholla/issues/301, when that macro is enabled the simulation would write the final output slightly after tout.
Now, timesteps are adjusted so that the simulation after the current timestep does not exceed the next output-time or tout
I also adjusted the logic for incrementing outtime (which tracks the next simulation time when output is written). This change ensures that the simulation will take the same timesteps whether or not OUTPUT_ALWAYS is enabled. (Previously, when the code was compiled with OUTPUT_ALWAYS it might skip the timesteps that were based on the value of the outstep parameter)
I adjusted logic for clamping the timestep
main
would only clamp the next timestep based on when the time that the next output was scheduled for (this was based on incrementingouttime
withoutstep
). This produced some weird behavior when theOUTPUT_ALWAYS
macro is defined. As documented in issue https://github.com/cholla-hydro/cholla/issues/301, when that macro is enabled the simulation would write the final output slightly aftertout
.tout
I also adjusted the logic for incrementing
outtime
(which tracks the next simulation time when output is written). This change ensures that the simulation will take the same timesteps whether or notOUTPUT_ALWAYS
is enabled. (Previously, when the code was compiled withOUTPUT_ALWAYS
it might skip the timesteps that were based on the value of theoutstep
parameter)