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:
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
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:
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.