Predefined Kernels#
parcels.application_kernels.advection module#
Collection of pre-built advection kernels.
- parcels.application_kernels.advection.AdvectionAnalytical(particle, fieldset, time)[source]#
Advection of particles using âanalytical advectionâ integration.
Based on Ariane/TRACMASS algorithm, as detailed in e.g. Doos et al (https://doi.org/10.5194/gmd-10-1733-2017). Note that the time-dependent scheme is currently implemented with âintermediate timestepsâ (default 10 per model timestep) and not yet with the full analytical time integration.
- parcels.application_kernels.advection.AdvectionEE(particle, fieldset, time)[source]#
Advection of particles using Explicit Euler (aka Euler Forward) integration.
- parcels.application_kernels.advection.AdvectionRK4(particle, fieldset, time)[source]#
Advection of particles using fourth-order Runge-Kutta integration.
- parcels.application_kernels.advection.AdvectionRK45(particle, fieldset, time)[source]#
Advection of particles using adaptive Runge-Kutta 4/5 integration.
Note that this kernel requires a Particle Class that has an extra Variable ânext_dtâ and a FieldSet with constants âRK45_tolâ (in meters), âRK45_min_dtâ (in seconds) and âRK45_max_dtâ (in seconds).
Time-step dt is halved if error is larger than fieldset.RK45_tol, and doubled if error is smaller than 1/10th of tolerance.
parcels.application_kernels.advectiondiffusion module#
Collection of pre-built advection-diffusion kernels.
See this tutorial for a detailed explanation.
- parcels.application_kernels.advectiondiffusion.AdvectionDiffusionEM(particle, fieldset, time)[source]#
Kernel for 2D advection-diffusion, solved using the Euler-Maruyama scheme (EM).
Assumes that fieldset has fields Kh_zonal and Kh_meridional and variable fieldset.dres, setting the resolution for the central difference gradient approximation. This should be (of the order of) the local gridsize.
The Euler-Maruyama scheme is of strong order 0.5 and weak order 1.
The Wiener increment dW is normally distributed with zero mean and a standard deviation of sqrt(dt).
- parcels.application_kernels.advectiondiffusion.AdvectionDiffusionM1(particle, fieldset, time)[source]#
Kernel for 2D advection-diffusion, solved using the Milstein scheme at first order (M1).
Assumes that fieldset has fields Kh_zonal and Kh_meridional and variable fieldset.dres, setting the resolution for the central difference gradient approximation. This should be (of the order of) the local gridsize.
This Milstein scheme is of strong and weak order 1, which is higher than the Euler-Maruyama scheme. It experiences less spurious diffusivity by including extra correction terms that are computationally cheap.
The Wiener increment dW is normally distributed with zero mean and a standard deviation of sqrt(dt).
- parcels.application_kernels.advectiondiffusion.DiffusionUniformKh(particle, fieldset, time)[source]#
Kernel for simple 2D diffusion where diffusivity (Kh) is assumed uniform.
Assumes that fieldset has constant fields Kh_zonal and Kh_meridional. These can be added via e.g. fieldset.add_constant_field(âKh_zonalâ, kh_zonal, mesh=mesh) or fieldset.add_constant_field(âKh_meridionalâ, kh_meridional, mesh=mesh) where mesh is either âflatâ or âsphericalâ
This kernel assumes diffusivity gradients are zero and is therefore more efficient. Since the perturbation due to diffusion is in this case isotropic independent, this kernel contains no advection and can be used in combination with a separate advection kernel.
The Wiener increment dW is normally distributed with zero mean and a standard deviation of sqrt(dt).
parcels.application_kernels.EOSseawaterproperties module#
Collection of pre-built eos sea water property kernels.
- parcels.application_kernels.EOSseawaterproperties.AdiabticTemperatureGradient(particle, fieldset, time)[source]#
Calculates adiabatic temperature gradient as per UNESCO 1983 routines.
- Parameters:
particle â
- The particle object with the following attributes:
- Sarray_like
Salinity in psu (PSS-78).
- Tarray_like
Temperature in â (ITS-90).
- pressurearray_like
Pressure in db.
fieldset â The fieldset object
- Returns:
Adiabatic temperature gradient in â dbâ»Âč.
- Return type:
array_like
References
Fofonoff, P. and Millard, R.C. Jr UNESCO 1983. Algorithms for computation of fundamental properties of seawater. UNESCO Tech. Pap. in Mar. Sci., No. 44, 53 pp. http://unesdoc.unesco.org/images/0005/000598/059832eb.pdf
Bryden, H. 1973. New Polynomials for thermal expansion, adiabatic temperature gradient and potential temperature of sea water. Deep-Sea Res. Vol20,401-408. doi:10.1016/0011-7471(73)90063-6
- parcels.application_kernels.EOSseawaterproperties.PressureFromLatDepth(particle, fieldset, time)[source]#
Calculates pressure in dbars from depth in meters and latitude.
- Returns:
p â pressure [db]
- Return type:
array_like
References
Saunders, Peter M., 1981: Practical Conversion of Pressure to Depth. J. Phys. Oceanogr., 11, 573-574. doi: 10.1175/1520-0485(1981)011<0573:PCOPTD>2.0.CO;2
- parcels.application_kernels.EOSseawaterproperties.PtempFromTemp(particle, fieldset, time)[source]#
Calculates potential temperature as per UNESCO 1983 report.
- Parameters:
particle â
- The particle object with the following attributes:
- Sarray_like
Salinity in psu (PSS-78).
- Tarray_like
Temperature in â (ITS-90).
- pressurearray_like
Pressure in db.
fieldset â
- The fieldset object with the following attributes:
- refpressurearray_like, optional
Reference pressure in db (default is 0).
time (float) â Simulation time (not used in this function but required for consistency with other kernels).
- Returns:
Potential temperature relative to reference pressure in â (ITS-90).
- Return type:
array_like
References
Fofonoff, P. and Millard, R.C. Jr UNESCO 1983. Algorithms for computation of fundamental properties of seawater. UNESCO Tech. Pap. in Mar. Sci., No. 44, 53 pp. Eqn.(31) p.39. http://unesdoc.unesco.org/images/0005/000598/059832eb.pdf
Bryden, H. 1973. New Polynomials for thermal expansion, adiabatic temperature gradient and potential temperature of sea water. Deep-Sea Res. Vol20,401-408. doi:10.1016/0011-7471(73)90063-6
- parcels.application_kernels.EOSseawaterproperties.TempFromPtemp(particle, fieldset, time)[source]#
Calculates temperature from potential temperature at the reference pressure PR and in situ pressure P.
- Parameters:
particle â
- The particle object with the following attributes:
- Sarray_like
Salinity in psu (PSS-78).
- Tarray_like
Potential temperature in â (ITS-90).
- pressurearray_like
Pressure in db.
fieldset â
- The fieldset object with the following attributes:
- refpressurearray_like, optional
Reference pressure in db (default is 0).
time (float) â Simulation time (not used in this function but required for consistency with other kernels).
- Returns:
Temperature in â (ITS-90).
- Return type:
array_like
References
Fofonoff, P. and Millard, R.C. Jr UNESCO 1983. Algorithms for computation of fundamental properties of seawater. UNESCO Tech. Pap. in Mar. Sci., No. 44, 53 pp. Eqn.(31) p.39. http://unesdoc.unesco.org/images/0005/000598/059832eb.pdf
Bryden, H. 1973. New Polynomials for thermal expansion, adiabatic temperature gradient and potential temperature of sea water. Deep-Sea Res. Vol20,401-408. doi:10.1016/0011-7471(73)90063-6
parcels.application_kernels.TEOSseawaterdensity module#
Collection of pre-built sea water density kernels.
- parcels.application_kernels.TEOSseawaterdensity.PolyTEOS10_bsq(particle, fieldset, time)[source]#
Calculates density based on the polyTEOS10-bsq algorithm from Appendix A.2 of https://www.sciencedirect.com/science/article/pii/S1463500315000566 requires fieldset.abs_salinity and fieldset.cons_temperature Fields in the fieldset and a particle.density Variable in the ParticleSet
References
Roquet, F., Madec, G., McDougall, T. J., Barker, P. M., 2014: Accurate polynomial expressions for the density and specific volume of seawater using the TEOS-10 standard. Ocean Modelling.
McDougall, T. J., D. R. Jackett, D. G. Wright and R. Feistel, 2003: Accurate and computationally efficient algorithms for potential temperature and density of seawater. Journal of Atmospheric and Oceanic Technology, 20, 730-741.