From bd05c2711905e4820a8de054c9e9e609c0ebf763 Mon Sep 17 00:00:00 2001 From: michaeldenes Date: Thu, 5 Dec 2024 12:21:30 +0100 Subject: [PATCH] Changing the checkBelowDataDepth kernel to use 1m instead of 0.5, since the VerticalMixing kernel uses a 0.5m distance in the finite-differencing scheme. Also only running the test for 1d rather than 2. --- tests/test_kernels.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/test_kernels.py b/tests/test_kernels.py index 2e192da..0cf758c 100644 --- a/tests/test_kernels.py +++ b/tests/test_kernels.py @@ -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]) @@ -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]