Parcels

Latest version: v3.1.2

Safety actively analyzes 706267 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 5 of 7

2.1.0

1. Parcels has a parallel MPI version! While working on multiple processors, the particles are spread over the processors for an efficient integration. (625). See https://oceanparcels.org#parallel_install for instructions on how to install.
2. For an efficient loading of the `Fieldset`, the `Field` objects are now loaded by chunks, controlled by the parameter `field_chunksize` (632). This results in lower memory usage and faster simulation. It is also a fundamental part of the parallel implementation, since for low number of particles per processor, the computation time is dominated by the loading of the data. A more efficient parallel version will be dynamically balancing the particles between the processors such to minimise the number of chunks loaded per processor. See [this document](https://nbviewer.jupyter.org/github/OceanParcels/parcels/blob/master/parcels/examples/documentation_MPI.ipynb) for further background on the implementation.
3. An efficient writing of the particleset. For a quicker export of the data, particles are now dumped into npy files during simulation. The pickles are gathered into one single file at the end of the simulation. (614)
4. A proper management of `particle.dt` modified by the kernel. If the kernel modifies `particle.dt`, the kernel will automatically be restarted with the updated `dt`. If you want to simply updates the `dt` for next kernel call, use `particle.update_next_dt(new_dt)`. (657)
5. New particles can now be added to the `ParticleSet` only via a temporary `ParticleSet` object. This enables a proper control of the `particle.id` in parallel (629)
6. `Field.gradient()` function is not available anymore. This functionality was providing spurious results on curvilinear grids and was conflicting with the use of chunked fields. Users can still obtain easily an accurate field gradient (see example proposed in 633)
7. Using the `time_periodic` flag in `FieldSet` creation now requires the length of the period (659)
8. Numerous bug fixes


Note that Parcels v2.1.0 is the last version to officially support Python 2.7. While all functionalities currently work with both Python 2 and 3, new development and code dependencies will progressively lead to incompatibility with Python 2. We strongly advice the users to switch to Python 3.

2.0.0

Parcels v2.0.0 builds on previous versions v2.0.0.beta and v2.0.0.beta2. It's the release which is fully described in the paper [The Parcels v2.0 Lagrangian framework: new field interpolation schemes](https://doi.org/10.5194/gmd-2018-339), by Delandmeter and van Sebille, 2019, GMD.

The major changes of v2.0.0 compared to v1.1.1 are

1) The order of arguments for `Field` interpolation has changed. This is now `field[time, depth, lat, lon]`, which is consistent with the dimension order in which data is stored in the `field.data` numpy array (503 and 276).

2) The `dt` argument has been dropped from Kernel definitions, so that the only arguments allowed in a Kernel are `def kernelfunc(fieldset, particle, time)` (503)

3) Interpolation for C-grids is now done in a fluxes framework, instead of a velocity framework (499 and 494).

4) Interpolation for B-grids (573)

5) Support for `np.float64` accuracy of particle locations. This can be set using the `lonlatdepth_dtype` argument in ParticleSet construction. Default is `np.float64` for C-grids, and `np.float32` for all other grids (552 and 557)

Note also a number of other minor development:

2.0.0beta2

This is the second beta version of Parcels v2.0.0. It builds upon v2.0.0beta, and compared to that version has a few important fixes and improvements:
- Support for `np.float64` accuracy of particle locations. This can be set using the `lonlatdepth_dtype` argument in `ParticleSet` construction. Default is `np.float64` for C-grids, and `np.float32` for all other grids (552 and 557)
- Renaming of the `full_load` argument in `FieldSet.from_netcdf()` construction to `deferred_load`, where `deferred_load = not full_load`, for consistency with how we normally call this mode. Default for netcdf files with more than three snapshots is `deferred_load=True` (550)
- Support for Netcdf files without a `time` dimension, by using the `timestamps` argument in `FieldSet` construction (540)
- New tutorials on how to work with [3-dimensional C-grid data such as NEMO](https://nbviewer.jupyter.org/github/OceanParcels/parcels/blob/master/parcels/examples/tutorial_nemo_3D.ipynb) (#531) and the [`UnitConverter` classes](https://nbviewer.jupyter.org/github/OceanParcels/parcels/blob/master/parcels/examples/tutorial_unitconverters.ipynb) (#516)
- Check if the keys in the `dimensions` dictionary are only `lon`, `lat`, `depth` and `time` (545)
- Change in how variable name should be set in `Field.from_netcdf()`. Now use tuple `variable=(Field_name, variable_name_in_NetCDF_file)` (545)
- Numerous bugfixes

Note also that there is a problem with the latest release of the netCDF4 library, v1.4.2 (Issue 513). For the time being, we recommend downgrading to v1.4.1, using `conda install netcdf4=1.4.1`

2.0.0beta

This is the beta-release of Parcels v2. Compared to the last v1.1.1 release, there are three important changes

1) The order of arguments for Field interpolation has changed. This is now `field[time, depth, lat, lon]`, which is consistent with the dimension order in which data is stored in the `field.data` numpy array (503 and 276).

2) The `dt` argument has been dropped from Kernel definitions, so that the only arguments allowed in a Kernel are `def kernelfunc(fieldset, particle, time)` (503)

3) Interpolation for C-grids is now done in a fluxes framework, instead of a velocity framework. The details of this will be presented in a manuscript, to be submitted soon (499 and 494)

**Note that 1) and 2) above mean that Kernels written for Parcels v1 will break in this Parcels v2.** If you're updating to this v2.0.0beta, therefore please update your custom Kernels.

Other updates since v1.1.1 are:
- New `FieldSet.from_xarray_dataset()` method to directly read `xarray.DataSet` objects (476)
- An optional argument in `Field.show()` to control which depth level to plot (478)
- `ParticleSet.from_field()` now also implemented for Curvilinear Fields (496)
- And numerous small bug fixes

1.1.1

- In `Fieldset.from_netcdf()`, the format of `filenames` argument has been enriched (463).
As before, `filenames` can be:
- list of files
- dictionaries of list of files, where the dictionary keys are field names

On top of that, `filenames` can now be:
- dictionaries of lists of files, where the dictionary keys are dimension names: `filenames[dimension_name] = [files]`
- dictionaries of dictionaries of lists of files: `filenames[field_name][dimension_name] = [files]`

This particularly affects the function `Fieldset.from_nemo()`:

New `filenames` looks like:

filenames = {'U': {'lon': data_path + 'mesh_mask.nc4',
'lat': data_path + 'mesh_mask.nc4',
'data': data_path + 'U_purely_zonal-ORCA025_grid_U.nc4'},
'V': {'lon': data_path + 'mesh_mask.nc4',
'lat': data_path + 'mesh_mask.nc4',
'data': data_path + 'V_purely_zonal-ORCA025_grid_V.nc4'}}

instead of:


filenames = {'U': data_path + 'U_purely_zonal-ORCA025_grid_U.nc4',
'V': data_path + 'V_purely_zonal-ORCA025_grid_V.nc4',
'mesh_mask': data_path + 'mesh_mask.nc4'}

This modification enables to easily read 3d curvilinear NEMO fields, when the depth dimension is in the data-files.

- A new `TimeConverter` class converts between dates and the number of seconds that Parcels uses under the hood. This enables to read netcdf files with less common time formats, such as NOLEAP. (456)
- New `netcdf_engine` as argument for `Fieldset.from_netcdf()`, enables to open netcdf files with a different engine when the default netcdf4 engine does not work. (460)
- Improved error messages for C-kernel generator (457)
- Minor bug fixes

Note that it is now recommended to use a recent version of xarray (>=0.10.8) together with Parcels, since it better parses some netcdf files used by common OGCMs.

1.1

- A renaming of the `FieldList` class to `SummedFields`, so that Fields can be summed by `fieldAB = fieldA + fieldB` (435)
- Implement way to do computations on defer-loaded FieldSets (430). Useful for on-the-fly computing of e.g. relative vorticity.
- Adding of metadata, including by default the Parcels version, to the ParticleFile (438)
- Support for `ParticleSet.from_field()` for Curvilinear Grids (429)
- A few bug fixes, including for rotated grids (440), for `indices` across 2D and 3D Fields (437) and for Fields without time dimension (431)

As always, please let us know if anything isn't working as expected.

Page 5 of 7

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.