@@ -297,14 +297,14 @@ def test_moving_eddy(kernel, rtol):
297297 ds ["Kh" ] = (["time" , "depth" , "YG" , "XG" ], np .full (ds ["U" ].shape , 0 ))
298298 fieldset .add_field (Field ("Kh" , ds ["Kh" ], grid , interp_method = XLinear ), "Kh_zonal" )
299299 fieldset .add_field (Field ("Kh" , ds ["Kh" ], grid , interp_method = XLinear ), "Kh_meridional" )
300- fieldset .add_constant ( "dres" , 0.1 )
300+ fieldset .constants [ "dres" ] = 0.1
301301
302302 start_lon , start_lat , start_z = 12000 , 12500 , 12500
303303 dt = np .timedelta64 (30 , "m" )
304304 endtime = np .timedelta64 (1 , "h" )
305305
306306 if kernel == AdvectionRK45 :
307- fieldset .add_constant ( "RK45_tol" , rtol )
307+ fieldset .constants [ "RK45_tol" ] = rtol
308308
309309 pset = ParticleSet (
310310 fieldset , pclass = DEFAULT_PARTICLES [kernel ], lon = start_lon , lat = start_lat , z = start_z , time = np .timedelta64 (0 , "s" )
@@ -346,8 +346,8 @@ def test_decaying_moving_eddy(kernel, rtol):
346346 endtime = np .timedelta64 (23 , "h" )
347347
348348 if kernel == AdvectionRK45 :
349- fieldset .add_constant ( "RK45_tol" , rtol )
350- fieldset .add_constant ( "RK45_min_dt" , 10 * 60 )
349+ fieldset .constants [ "RK45_tol" ] = rtol
350+ fieldset .constants [ "RK45_min_dt" ] = 10 * 60
351351
352352 pset = ParticleSet (
353353 fieldset , pclass = DEFAULT_PARTICLES [kernel ], lon = start_lon , lat = start_lat , time = np .timedelta64 (0 , "s" )
@@ -403,7 +403,7 @@ def test_stommelgyre_fieldset(kernel, rtol, grid_type):
403403 )
404404
405405 if kernel == AdvectionRK45 :
406- fieldset .add_constant ( "RK45_tol" , rtol )
406+ fieldset .constants [ "RK45_tol" ] = rtol
407407
408408 def UpdateP (particles , fieldset ): # pragma: no cover
409409 particles .p = fieldset .P [particles .time , particles .z , particles .lat , particles .lon ]
@@ -443,7 +443,7 @@ def test_peninsula_fieldset(kernel, rtol, grid_type):
443443 )
444444
445445 if kernel == AdvectionRK45 :
446- fieldset .add_constant ( "RK45_tol" , rtol )
446+ fieldset .constants [ "RK45_tol" ] = rtol
447447
448448 def UpdateP (particles , fieldset ): # pragma: no cover
449449 particles .p = fieldset .P [particles .time , particles .z , particles .lat , particles .lon ]
0 commit comments