|
22 | 22 | from parcels._datasets.structured.generated import simple_UV_dataset |
23 | 23 | from parcels._datasets.structured.generic import datasets as datasets_structured |
24 | 24 | from parcels._datasets.unstructured.generic import datasets as datasets_unstructured |
25 | | -from parcels.interpolators import UXPiecewiseConstantFace |
26 | | -from parcels.kernels import AdvectionEE, AdvectionRK4 |
| 25 | +from parcels.interpolators import UXPiecewiseConstantFace, UXPiecewiseLinearNode |
| 26 | +from parcels.kernels import AdvectionEE, AdvectionRK4, AdvectionRK4_3D |
27 | 27 | from tests import utils |
28 | 28 | from tests.common_kernels import DoNothing |
29 | 29 |
|
@@ -479,6 +479,50 @@ def test_uxstommelgyre_pset_execute(): |
479 | 479 | assert utils.round_and_hash_float_array([p.lat for p in pset]) == 1142124776 |
480 | 480 |
|
481 | 481 |
|
| 482 | +def test_uxstommelgyre_multiparticle_pset_execute(): |
| 483 | + ds = datasets_unstructured["stommel_gyre_delaunay"] |
| 484 | + grid = UxGrid(grid=ds.uxgrid, z=ds.coords["nz"], mesh="spherical") |
| 485 | + U = Field( |
| 486 | + name="U", |
| 487 | + data=ds.U, |
| 488 | + grid=grid, |
| 489 | + interp_method=UXPiecewiseConstantFace, |
| 490 | + ) |
| 491 | + V = Field( |
| 492 | + name="V", |
| 493 | + data=ds.V, |
| 494 | + grid=grid, |
| 495 | + interp_method=UXPiecewiseConstantFace, |
| 496 | + ) |
| 497 | + W = Field( |
| 498 | + name="W", |
| 499 | + data=ds.W, |
| 500 | + grid=grid, |
| 501 | + interp_method=UXPiecewiseLinearNode, |
| 502 | + ) |
| 503 | + P = Field( |
| 504 | + name="P", |
| 505 | + data=ds.p, |
| 506 | + grid=grid, |
| 507 | + interp_method=UXPiecewiseConstantFace, |
| 508 | + ) |
| 509 | + UVW = VectorField(name="UVW", U=U, V=V, W=W) |
| 510 | + fieldset = FieldSet([UVW, UVW.U, UVW.V, UVW.W, P]) |
| 511 | + pset = ParticleSet( |
| 512 | + fieldset, |
| 513 | + lon=[30.0, 32.0], |
| 514 | + lat=[5.0, 5.0], |
| 515 | + depth=[50.0, 50.0], |
| 516 | + time=[np.timedelta64(0, "s")], |
| 517 | + pclass=Particle, |
| 518 | + ) |
| 519 | + pset.execute( |
| 520 | + runtime=np.timedelta64(10, "m"), |
| 521 | + dt=np.timedelta64(60, "s"), |
| 522 | + pyfunc=AdvectionRK4_3D, |
| 523 | + ) |
| 524 | + |
| 525 | + |
482 | 526 | @pytest.mark.xfail(reason="Output file not implemented yet") |
483 | 527 | def test_uxstommelgyre_pset_execute_output(): |
484 | 528 | ds = datasets_unstructured["stommel_gyre_delaunay"] |
|
0 commit comments