|
265 | 265 | "outputs": [], |
266 | 266 | "source": [ |
267 | 267 | "testParticles = get_test_particles()\n", |
268 | | - "testParticles.update_dt_dtype(\"timedelta64[ms]\")\n", |
269 | 268 | "output_file = parcels.ParticleFile(\n", |
270 | 269 | " store=\"M1_out.zarr\",\n", |
271 | 270 | " chunks=(len(testParticles), 50),\n", |
|
345 | 344 | "outputs": [], |
346 | 345 | "source": [ |
347 | 346 | "testParticles = get_test_particles()\n", |
348 | | - "testParticles.update_dt_dtype(\"timedelta64[ms]\")\n", |
349 | 347 | "output_file = parcels.ParticleFile(\n", |
350 | 348 | " store=\"EM_out.zarr\",\n", |
351 | 349 | " chunks=(len(testParticles), 50),\n", |
|
458 | 456 | " A = A / sq_deg_to_sq_m\n", |
459 | 457 | " Kh = fieldset.Cs * A * np.sqrt(dudx**2 + 0.5 * (dudy + dvdx) ** 2 + dvdy**2)\n", |
460 | 458 | "\n", |
461 | | - " dlat = np.random.normal(0.0, 1.0, dt.shape) * np.sqrt(2 * np.fabs(dt) * Kh)\n", |
462 | | - " dlon = np.random.normal(0.0, 1.0, dt.shape) * np.sqrt(2 * np.fabs(dt) * Kh)\n", |
| 459 | + " dlat = np.random.normal(0.0, 1.0, particles.dt.shape) * np.sqrt(\n", |
| 460 | + " 2 * np.fabs(particles.dt) * Kh\n", |
| 461 | + " )\n", |
| 462 | + " dlon = np.random.normal(0.0, 1.0, particles.dt.shape) * np.sqrt(\n", |
| 463 | + " 2 * np.fabs(particles.dt) * Kh\n", |
| 464 | + " )\n", |
463 | 465 | " particles.dlat += dlat\n", |
464 | 466 | " particles.dlon += dlon" |
465 | 467 | ] |
|
0 commit comments