-
Notifications
You must be signed in to change notification settings - Fork 94
Change Timing for Gauge Updating #649
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
Conversation
Also checks for initial time updates so that the initial time is always output and the second is skipped if it's the initial time.
This seems to work although there are two questions:
My guess is no to both, but it would be good to have a double check.
|
This modification can make a significant change in the gauge values printed, e.g. for the chile2010 example comparing this to the master branch version commit 271bea3 that it is based on, there are changes in the 2nd significant digit in many values, particularly in hu and hv. E.g. master gives these lines as part of
while the modified code gives
The third line is identical, but there are significant differences in the first line, and in the middle line shown, I think I know why, and I'm remembering now why we (including @mjberger) previously decided it wasn't so easy to move the I think when we discussed this before, we determined it would be a lot more work to update the ghost cells after the step in order for this interpolation to work properly and was not worth doing every time step just so that the gauges would be output at the final time of the simulation. An alternative would be to do something special at the end of the simulation to fill ghost cells and output gauges properly, but that also didn't seem worth doing since the gauge value is rarely actually needed at the final time. If it is, the user should just increase But we could reconsider this. I notice that the routine The reason the middle line in the example above is so different is that in the new code the gauge value is output immediately after taking a time step, while in the original code there is a regridding that takes place in between the end of one time step and printing the gauge at the beginning of the next, and a recomputation of |
So I decided to go through the exercise of adding time to I will continue to get a better handle again as to exactly what is going on but there are two questions that this raises:
In any case, I think this PR can be closed, but we should reopen a new issue to maintain the discussion and make PRs from there. |
This PR moves the
update_gauge
call to after a step is taken. It also puts a condition on an initial timeabs(t0 - time) < TOLERANCE
so that the initial time is still recorded at the initial time.