Skip to content

Commit

Permalink
Changing the checkBelowDataDepth kernel to use 1m instead of 0.5, sin…
Browse files Browse the repository at this point in the history
…ce the VerticalMixing kernel uses a 0.5m distance in the finite-differencing scheme. Also only running the test for 1d rather than 2.
  • Loading branch information
michaeldenes committed Dec 5, 2024
1 parent d5bce74 commit bd05c27
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/test_kernels.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ def checkBelowDataDepth(particle, fieldset, time):
# The vertical mixing kernel can push particles below the test dataset depth, throwing an
# out of bounds error. This kernel will keep particles above the max depth.
if particle.depth + particle_ddepth >= fieldset.max_depth: # noqa
# move half a meter above the max depth
particle_ddepth = fieldset.max_depth - particle.depth - 0.5 # noqa
# move a meter above the max depth
particle_ddepth = fieldset.max_depth - particle.depth - 1.0 # noqa
particle.state = parcels.StatusCode.Success


@pytest.mark.parametrize('use_3D', [True, False])
Expand Down Expand Up @@ -224,6 +225,9 @@ def test_mixing():
fieldset = pp.constructors.create_fieldset(settings)
fieldset.add_constant('max_depth', fieldset.U.depth[-1])

# Set the simulation runtime to just 1 day so particles aren't kicked around significantly
settings['simulation']['runtime'] = timedelta(days=1)

kernels = [parcels.application_kernels.AdvectionRK4_3D, pp.kernels.checkThroughBathymetry,
pp.kernels.checkErrorThroughSurface, pp.kernels.deleteParticle]

Expand Down

0 comments on commit bd05c27

Please sign in to comment.