-
Notifications
You must be signed in to change notification settings - Fork 171
Bugfix/2568 output fenceposting #2575
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
e9947ed
Add test that reproduces the issue described in issue #2568
fluidnumericsJoe f75eefe
Switch to appending positionUpdate, rather than prepending
fluidnumericsJoe 773c526
Move position update kernel to kernels attribute; explicitly call upd…
fluidnumericsJoe b456f0c
Apply position update only to particles in normal state
fluidnumericsJoe fc11251
Adjusted expected output values based on fenceposting correction
fluidnumericsJoe 51b1967
Run test_particleset_interpolate_outside_domainedge with 2 day execut…
fluidnumericsJoe 9fb895c
Incorporate sign_dt into next output to accomodate backwards time ste…
fluidnumericsJoe 626675c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 00d0689
Merge branch 'bugfix/2568-output-fenceposting' of github.com:Parcels-…
fluidnumericsJoe bde21c6
Skip test_pset_repeated_release_delayed_adding_deleting tests
fluidnumericsJoe c0db495
Merge branch 'main' into bugfix/2568-output-fenceposting
fluidnumericsJoe 6f5981f
Make _position_update a class procedure and remove _make_position_update
fluidnumericsJoe 90cebd3
Merge branch 'bugfix/2568-output-fenceposting' of github.com:Parcels-…
fluidnumericsJoe 0e08123
Test the particle file output in addition to the pset.lon
fluidnumericsJoe 4d05ec3
Remove unused variable; fix linting
fluidnumericsJoe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| import numpy as np | ||
| import pytest | ||
| import xarray as xr | ||
|
|
||
| import parcels | ||
| from parcels._datasets.unstructured.generic import datasets as datasets_unstructured | ||
| from parcels.kernels import ( | ||
| AdvectionEE, | ||
| AdvectionRK2, | ||
| AdvectionRK4, | ||
| ) | ||
|
|
||
|
|
||
| @pytest.mark.parametrize("integrator", [AdvectionEE, AdvectionRK2, AdvectionRK4]) | ||
| def test_ux_constant_flow_face_centered_2D(integrator, tmp_zarrfile): | ||
| ds = datasets_unstructured["ux_constant_flow_face_centered_2D"] | ||
| T = np.timedelta64(3600, "s") | ||
| dt = np.timedelta64(300, "s") | ||
|
|
||
| fieldset = parcels.FieldSet.from_ugrid_conventions(ds, mesh="flat") | ||
| pset = parcels.ParticleSet(fieldset, lon=[5.0], lat=[5.0]) | ||
| pfile = parcels.ParticleFile(store=tmp_zarrfile, outputdt=dt) | ||
| pset.execute(integrator, runtime=T, dt=dt, output_file=pfile, verbose_progress=False) | ||
| expected_lon = 8.6 | ||
| np.testing.assert_allclose(pset.lon, expected_lon, atol=1e-5) | ||
|
|
||
| ds_out = xr.open_zarr(tmp_zarrfile) | ||
| np.testing.assert_allclose(ds_out["lon"][:, -1], expected_lon, atol=1e-5) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.