Bugfix/2568 output fenceposting#2575
Conversation
In the previous version of parcels, particleset.execute() overshoots the particle trajectories by exactly one time step while leading to repeated initial condition output lagged by exactly one time step. This leads to an inconsistency in the actual particle positions and those written to files In this updated approach, when an outputfile is provided, we write the initial condition to file before the time loop. Then, inside the time loop, the kernels are executed with particle position updated immediately after all other kernels and just before file IO. This corrects the inconsistency in the actual and reported time levels for each particle state in the output. Unfortunately this breaks a number of tests. The unit tests are checking for incorrect values (lagged by exactly one time loop iteration..)
…ate after user kernels This removes the `PositionUpdate` kernel from the list of kernels. This change was made to fix `funcname` polution if the `test_kernel_merging`, `test_kernel_from_list`, and `test_metadata`.
With the correction in place, the particle positions are now obtained by 1 less call to positionupdate (correctly); the values in the test output for validation were based off the wrong number of iterations due to the fenceposting bug we're trying to address.
…ion time With the fence posting bugfix in place, the particleset execute call updates the position once; previously, this happened twice (this was the bug). This test failed because the particle didn't go out of bounds with a single position update. Semantically, setting the runtime to 2 days, achieved what was intended here (to get the particle out of bounds)
for more information, see https://pre-commit.ci
erikvansebille
left a comment
There was a problem hiding this comment.
Nice improvement! But it seems that this doesn't (yet) fix the ParticleFile? That now raises some unit test errors. Do you want me to help?
It'd be great to get your input on those. It looks like I need to have some awareness for particles being injected at different points in time into the simulation for the explicit initial condition write in |
VeckoTheGecko
left a comment
There was a problem hiding this comment.
Should we have an additional test that isolates #2568 and tests it? I'm worried that at the moment this only surfaces in position assert statements within other tests
…Code/Parcels into bugfix/2568-output-fenceposting
…Code/Parcels into bugfix/2568-output-fenceposting
|
Failed test looks like a 404 error unrelated to my changes.... |
dtrelative to time labels #2568mainfor normal development,v3-supportfor v3 support)AI Disclosure
dtrelative to time labels #2568 with failing tests for context to suggest potential test failure resolution options.