Skip to content

Commit 9c1f5bd

Browse files
reint-fischerreint-fischer
authored andcommitted
fix some writing
1 parent 04645dd commit 9c1f5bd

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

docs/user_guide/examples/tutorial_diffusion.ipynb

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@
253253
"cell_type": "markdown",
254254
"metadata": {},
255255
"source": [
256-
"Now we will simulate the advection and diffusion of the particles using the `AdvectionDiffusionM1` kernel. We run the simulation for 0.3 seconds, with a numerical timestep $\\Delta t = 0.001$s. We also write away particle locations at each timestep for plotting. Note that this will hinder a runtime comparison between kernels, since it will cause most time to be spent on I/O.\n"
256+
"Now we will simulate the advection and diffusion of the particles using the `AdvectionDiffusionM1` kernel. We run the simulation for 0.3 seconds, with a numerical timestep $\\Delta t = 0.001$ s. We also write away particle locations at each timestep for plotting. Note that this will hinder a runtime comparison between kernels, since it will cause most time to be spent on I/O.\n"
257257
]
258258
},
259259
{
@@ -463,7 +463,7 @@
463463
"cell_type": "markdown",
464464
"metadata": {},
465465
"source": [
466-
"Reading velocity fields from netcdf files\n"
466+
"Reading velocity fields from a Copernicus Marine Service dataset:\n"
467467
]
468468
},
469469
{
@@ -562,15 +562,7 @@
562562
"cell_type": "markdown",
563563
"metadata": {},
564564
"source": [
565-
"In the example, particles are released at one location periodically (every hour) for 12 hours\n"
566-
]
567-
},
568-
{
569-
"attachments": {},
570-
"cell_type": "markdown",
571-
"metadata": {},
572-
"source": [
573-
"Simulating the particles moving during 7 days using advection (`AdvectionRK4`) and diffusion (`smagdiff`) kernels.\n"
565+
"In the example, particles are released at one location and simulated for 2 days using advection (`AdvectionRK4`) and diffusion (`smagdiff`) kernels."
574566
]
575567
},
576568
{
@@ -579,11 +571,9 @@
579571
"metadata": {},
580572
"outputs": [],
581573
"source": [
582-
"time = np.repeat(\n",
583-
" fieldset.time_interval.left, 13\n",
584-
") # np.arange(fieldset.time_interval.left, fieldset.time_interval.left+np.timedelta64(13,\"h\"), np.timedelta64(1,'h'))\n",
574+
"time = np.repeat(fieldset.time_interval.left, 13)\n",
585575
"lon = [32] * len(time)\n",
586-
"lat = [-30.5] * len(time)\n",
576+
"lat = [-30.1] * len(time)\n",
587577
"z = [ds_fields.depth[0]] * len(time)\n",
588578
"pset = parcels.ParticleSet(\n",
589579
" fieldset=fieldset,\n",
@@ -602,7 +592,7 @@
602592
"\n",
603593
"pset.execute(\n",
604594
" [parcels.kernels.AdvectionRK4, smagdiff],\n",
605-
" runtime=np.timedelta64(3, \"D\"),\n",
595+
" runtime=np.timedelta64(2, \"D\"),\n",
606596
" dt=np.timedelta64(5, \"m\"),\n",
607597
" output_file=output_file,\n",
608598
")"
@@ -613,7 +603,7 @@
613603
"cell_type": "markdown",
614604
"metadata": {},
615605
"source": [
616-
"Visualize the trajectories using the trajan package\n"
606+
"When we visualize the trajectories using the trajan package, we can see that the particles released at the same time and location spread out over time:\n"
617607
]
618608
},
619609
{
@@ -623,7 +613,13 @@
623613
"outputs": [],
624614
"source": [
625615
"ds_particles = xr.open_zarr(\"smagdiff.zarr\")\n",
626-
"ds_particles.traj.plot()\n",
616+
"temperature = ds_fields.isel(time=0, depth=0).thetao.plot(cmap=\"magma\")\n",
617+
"velocity = ds_fields.isel(time=0, depth=0).plot.quiver(\n",
618+
" x=\"longitude\", y=\"latitude\", u=\"uo\", v=\"vo\"\n",
619+
")\n",
620+
"ds_particles.traj.plot(color=\"blue\")\n",
621+
"plt.ylim(-31, -30)\n",
622+
"plt.xlim(31, 32.1)\n",
627623
"plt.show()"
628624
]
629625
},
@@ -649,6 +645,11 @@
649645
"\n",
650646
"Smagorinsky, J. (1963). “General circulation experiments with primitive equations. 1. The basic experiment.” _Monthly Weather Review_, 91, 99–164. https://doi.org/10.1175/1520-0493(1963)091%3C0099:GCEWTP%3E2.3.CO;2\n"
651647
]
648+
},
649+
{
650+
"cell_type": "markdown",
651+
"metadata": {},
652+
"source": []
652653
}
653654
],
654655
"metadata": {

0 commit comments

Comments
 (0)