Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explaining statuscode kernel order #1508

Merged
merged 2 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/examples/tutorial_kernelloop.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Kernel functions such as the ones above can then be added to the list of kernels in `pset.execute()`."
"Kernel functions such as the ones above can then be added to the list of kernels in `pset.execute()`. \n",
"\n",
"Note that these Kernels that control what to do with `particle.state` should typically be added at the _end_ of the Kernel list, because otherwise later Kernels may overwrite the `particle.state` or the `particle_dlon` variables."
]
}
],
Expand Down
5 changes: 3 additions & 2 deletions parcels/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,8 +510,9 @@ def from_netcdf(cls, filenames, variable, dimensions, indices=None, grid=None,
filebuffer.name = filebuffer.parse_name(variable[1])
buffer_data = filebuffer.data
if len(buffer_data.shape) == 4:
errormessage = (f'Field {filebuffer.name} expecting a data shape of [tdim, zdim, ydim, xdim]. '
'Flag transpose=True could help to reorder the data.')
errormessage = (f'Field {filebuffer.name} expecting a data shape of [tdim={grid.tdim}, zdim={grid.zdim}, '
f'ydim={grid.ydim - 2 * grid.meridional_halo}, xdim={grid.xdim - 2 * grid.zonal_halo}] '
f'but got shape {buffer_data.shape}. Flag transpose=True could help to reorder the data.')
assert buffer_data.shape[0] == grid.tdim, errormessage
assert buffer_data.shape[2] == grid.ydim - 2 * grid.meridional_halo, errormessage
assert buffer_data.shape[3] == grid.xdim - 2 * grid.zonal_halo, errormessage
Expand Down
Loading