Skip to content

Commit 56e3048

Browse files
Simplifying fieldset creation (no U and V needed)
1 parent d104573 commit 56e3048

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

docs/user_guide/examples_v3/tutorial_interaction.ipynb

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@
6060
"\n",
6161
"plt.rcParams[\"animation.html\"] = \"jshtml\"\n",
6262
"\n",
63-
"import parcels\n",
64-
"from parcels._datasets.structured.generated import simple_UV_dataset"
63+
"import parcels"
6564
]
6665
},
6766
{
@@ -121,15 +120,8 @@
121120
"outputs": [],
122121
"source": [
123122
"def DiffusionFieldSet():\n",
124-
" \"\"\"Define a fieldset without flow but with diffusion\"\"\"\n",
125-
" ds = simple_UV_dataset(dims=(1, 1, 1, 1), mesh=\"flat\")\n",
126-
" ds = ds.assign_coords(time=ds.time - ds.time[0]) # set time to timedelta\n",
127-
" ds[\"time\"].attrs.update({\"axis\": \"T\"})\n",
128-
" grid = parcels.XGrid.from_dataset(ds, mesh=\"flat\")\n",
129-
" U = parcels.Field(\"U\", ds[\"U\"], grid, interp_method=parcels.interpolators.XLinear)\n",
130-
" V = parcels.Field(\"V\", ds[\"V\"], grid, interp_method=parcels.interpolators.XLinear)\n",
131-
" UV = parcels.VectorField(\"UV\", U, V)\n",
132-
" fieldset = parcels.FieldSet([U, V, UV])\n",
123+
" \"\"\"Define a fieldset with only diffusion\"\"\"\n",
124+
" fieldset = parcels.FieldSet([])\n",
133125
" fieldset.add_constant_field(\"Kh_zonal\", 0.0005, mesh=\"flat\")\n",
134126
" fieldset.add_constant_field(\"Kh_meridional\", 0.0005, mesh=\"flat\")\n",
135127
" return fieldset"

0 commit comments

Comments
 (0)