drifter

Trajectories of passive drifter particles using Euler's method with the option to use either forward or reverse particle tracking
57 Downloads
Updated 22 Sep 2022

View License

drifter.m was developed to track the trajectories of passive drifter particles at any location in the global oceans. The drifter.m function calculates the trajectories of drifters using either forward or reverse particle tracking using Euler's method.
Inputs to and outputs from the drifter.m function are as follows:
INPUTS
map_lon = vector of longitudes for the map extent (degE), must be equally spaced increments of degrees
map_lat = vector of latitudes for the map extent (degN), must be equally spaced increments of degrees
time = vector of continuous times for time series (datenum)
map_u = 3-d array (size of map_lon x map_lat x time) of east-west velocity vectors within the map extent (m/s positive east)
map_v = 3-d array (size of map_lon x map_lat x time) of north-south velocity vectors within the map extent (m/s positive north)
drifter_lon0 = vector of initial or final position longitudes of drifters (degE)
drifter_lat0 = vector of initial or final position latitudes of drifters (degN)
direction = either 'forward' or 'reverse' for particle tracking:
direction = 'forward' calculates future trajectories starting at drifter_lon0 and drifter_lat0 intial drifter locations
direction = 'reverse' calculates past trajectories leading to the final drifter locations at drifter_lon0 and drifter_lat0
OUTPUTS
drifter_lon = 2-d array (size of numel(time) x numel(drifter_lon0)) of time series of trajectoy longitudes for each drifter (degE)
drifter_lat = 2-d array (size of numel(time) x numel(drifter_lon0)) of time series of trajectory latitudes for each drifter (degN)
The required input arrays of velocity u and v vectors may be created by the user from the output of any available ocean model.
An example driver program called drifter_demo.m is also provided here, along with a function called drifter_animation.m that creates animated gif files showing the drifter trajectories. The example driver program uses an example input data set called kuroshio.mat that can be used to show the drifter trajectories in the Kuroshio Current starting from the southeast coast of Japan.
An optional companion package called soda_drifter.m is also available at the following link:
https://github.com/gjpelletier/soda_drifter
The soda_drifter.m package is capable of extracting and interpolating the velocity data required by drifter.m from the SODA3.12.2 ocean model reanalysis data for any location in the North Pacific Ocean for any time period between 1980-2017.

Cite As

Gregory Pelletier (2024). drifter (https://www.mathworks.com/matlabcentral/fileexchange/111140-drifter), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2022a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.2

updated kmperdeg.m to convert distance in kilometers to degrees longitude and latitude, no need for mapping toolbox, and includes kuroshio.mat for demo example

1.0.1

New function to convert drifter travel distance in kilometers to degree of latitude and longitude. Mapping toolbox is no longer needed in this new version

1.0.0