Three different trajectory schemes for oceanic and atmospheric general circulation models are compared in two different experiments. The theories of the trajectory schemes are presented showing the differential equations they solve and why they are mass conserving. One scheme assumes that the velocity fields are stationary for set intervals of time between saved model outputs and solves the trajectory path from a differential equation only as a function of space, i.e. “stepwise stationary”. The second scheme is a special case of the stepwise-stationary scheme, where velocities are assumed constant between general circulation model (GCM) outputs; it uses hence a “fixed GCM time step”. The third scheme uses a continuous linear interpolation of the fields in time and solves the trajectory path from a differential equation as a function of both space and time, i.e. a “time-dependent” scheme. The trajectory schemes are tested “offline”, i.e. using the already integrated and stored velocity fields from a GCM. The first comparison of the schemes uses trajectories calculated using the velocity fields from a high-resolution ocean general circulation model in the Agulhas region. The second comparison uses trajectories calculated using the wind fields from an atmospheric reanalysis. The study shows that using the time-dependent scheme over the stepwise-stationary scheme greatly improves accuracy with only a small increase in computational time. It is also found that with decreasing time steps the stepwise-stationary scheme becomes increasingly more accurate but at increased computational cost. The time-dependent scheme is therefore preferred over the stepwise-stationary scheme. However, when averaging over large ensembles of trajectories, the two schemes are comparable, as intrinsic variability dominates over numerical errors. The fixed GCM time step scheme is found to be less accurate than the stepwise-stationary scheme, even when considering averages over large ensembles.

The Lagrangian view of the ocean and atmospheric circulation describes fluid
pathways and the connectivity of different regions, which are not readily
obtained from a Eulerian perspective. Lagrangian studies often require
trajectory calculations using some algorithm that transforms the Eulerian
velocity fields, e.g. winds or currents, into trajectories. Although observed
velocities can be used, it is much more common to use velocities simulated by
a general circulation model (GCM). The purpose of this work is to test the
different schemes used in the TRACMASS trajectory model (version 6.0), here
named the fixed GCM time step

The TRACMASS trajectory model

The original feature of TRACMASS and the related Ariane model

The first trajectory scheme tested here, the fixed GCM time step, is strictly only valid for stationary velocity fields. It can, however, be used with time-varying velocity fields by dividing the time between GCM outputs into intermediate steps and assuming velocities are stationary during the step. The velocities in an intermediate step are found by linear interpolation between two GCM outputs and hence named stepwise stationary. However, using intermediate steps increases the computational cost. The time-dependent scheme does not assume that the fields are stationary and uses instead continuous bilinear interpolation both in space and time.

The fact that the stepwise-stationary scheme uses stepwise-stationary velocities is logical when the scheme is used online, i.e. integrated into a GCM and thus having the same time step as the GCM itself. When the scheme is used offline, i.e. separately from the GCM and after the velocity fields have been stored, the time step is the time between two GCM outputs, which typically is a much longer period than the GCM time step. As the stepwise-stationary scheme assumes that velocities are constant during the time step of the trajectory scheme, processes faster than the GCM output frequency are lost.

An alternative to the stepwise-stationary scheme was introduced by

In Sect. 2, we describe the three different trajectory schemes and how they are integrated in time in both ocean general circulation models (OGCMs) and atmospheric general circulation models (AGCMs). In Sect. 3, we test the three trajectory schemes with two different velocity fields, one from an OGCM and one from an AGCM, using various statistics. This study is concluded in Sect. 4 with a summary and discussion of the main results of the trajectory schemes and their tests.

The trajectory schemes used in TRACMASS are all mass conserving but make
different assumptions regarding the time evolution of the Eulerian velocity
and pressure fields. The schemes rely on the assumption that, within a grid
cell, the three velocities' components are only linear functions of their
corresponding directions, i.e.

The trajectory schemes integrate the trajectories from the volume or mass transports through the grid-box faces in contrast to many other trajectory schemes that only use the velocity fields. We will first describe how these fluxes are computed and then the three different trajectory schemes.

The TRACMASS trajectory schemes are mass conserving as they, like the GCM, deal with the transport across the grid faces and the transport is only interpolated linearly between the two opposite faces in a grid box. The trajectories will hence never cross a grid boundary.

A GCM mesh is generally spherical or curvilinear. The longitudinal (

Note that the mass transport can be replaced by the volume transport in
models that assume the fluid to be incompressible, which is the case for most
OGCMs. In other models (most AGCMs), we may use the hydrostatic approximation
to write

The vertical mass transport can similarly be computed from the vertical velocity

The continuity equation, which expresses conservation of mass, states that

The mass of the grid box is

The vertical mass transport through the top of the grid box is obtained by
discretising Eq. (

In many OGCMs, the fluid is considered to be incompressible, and thus the
density is constant and

This scheme assumes that the velocity and pressure fields are in a steady state.
It was introduced by

To calculate the zonal position,

For a trajectory reaching the grid face

The above procedure is repeated for meridional and vertical displacements,
where now

Note that Eqs. (

If

The trajectory scheme above is, strictly speaking, only valid for stationary fields. The scheme is, however, possible to use for time-dependent fields by assuming that the velocity and surface-elevation fields are stationary during a limited time interval. The stepwise-stationary method presented here consists of assuming that the fields are stationary during intermediate time steps between two GCM outputs and then updated successively as new fields become available. If this is undertaken online, i.e. in the same time as the GCM is integrated, this time interval will simply be the same as the time step the GCM is integrated by, which is typically between several minutes and a few hours in a global GCM. If instead the trajectories are calculated offline, the time intervals between GCM fields will be at least as often as the fields have been stored by the GCM, at intervals that can be days or even months.

A linear time interpolation of the velocity fields between two GCM velocity
fields permits a simple way to have shorter time steps by which the fields
are updated in time. The time interval between two GCM velocity fields is

Schematic illustration of how the transport
fields

The coefficients

The stepwise-stationary integration method presented in the previous
section assumes that the velocity and the grid-box thicknesses remain
constant throughout the time step, and only spatial variations of velocity
are accounted for. Another approach is to interpolate the velocity fields
not only in space within the grid box but also in time between the GCM
outputs. This approach, introduced in TRACMASS by

The time-dependent scheme can be derived in the same way as
Eq. (

Connecting the local transport to the time derivative of the position with

For this case, we define the time-like variable

When

The solution of Eq. (

This case would normally not occur in a realistic GCM integration since it
would correspond to a field constant in time or space, where

If instead

Examples of how trajectories calculated with the time-dependent
scheme evolve as a function of the transport

A major difference between the time-dependent and the
stepwise-stationary schemes is that in the time-dependent scheme, the
transit times

We now determine the roots

The roots of Eq. (

An efficient way of proceeding is as follows: first, consider the grid face at

The sign of

The sign of

The four different cases of how trajectories might reach the grid
face at

For case 1, we evaluate

If case 2 applies and

For case 3, we follow the procedure given by case 1. If there is a root for

For case 4, no solution of Eq. (

All these considerations are applied to each of the three spatial directions in order to determine through which of the six grid faces the trajectory will exit and at which position on the corresponding grid face.

Since the trajectories are unique solutions to Eq. (

Example of how the trajectories differ when computed with the
fixed GCM time step method in orange, the stepwise-stationary method
in blue, purple and green as well as the time-dependent method in red.
They all start at the same time

An example of the evolution of trajectories calculated with the three
different schemes within a time–space cell for

The results obtained from the stepwise-stationary scheme are now compared
with those from the time-dependent trajectory schemes using two different
sets of velocity fields. The first uses a high-resolution OGCM with

Oceanic velocity fields for this case were obtained from a simulation with
version 3.6 of the NEMO ocean model

TRACMASS has been applied to this specific model integration already by

Agulhas trajectories started evenly distributed in a square of four grid cells and followed for 50 days. Colouring is used to separate the trajectories from each other.

Example of ocean trajectory paths due to different trajectory
schemes and number of intermediate time steps. The time-dependent method
results are in red as well as those obtained with the stepwise-stationary method
with

In order to test the trajectory schemes in the atmosphere, we have used the
ERA-Interim reanalysis

Example of atmospheric trajectory paths starting form the
Eyjafjallajökull volcano during its eruption calculated with different
trajectory schemes and number of intermediate time steps. The same colour coding
of the trajectories as in Fig.

The table shows the average distance between the time-dependent
integrated trajectories and the stepwise-stationary integrated ones at
the end of simulations, which is 50 days for the OGCM and 10 days for the
AGCM.

The average distance between the trajectories obtained with the
time-dependent scheme and the five different stepwise-stationary
cases as well as the fixed GCM time step case are shown in
Fig.

Average distance between the time-dependent trajectories and the
stepwise-stationary ones for the different time steps with

Standard Lagrangian statistics have also been computed for the ocean
trajectories (Fig.

Lagrangian statistics of the ocean Agulhas trajectories. The
relative dispersion

The Lagrangian decomposed barotropic stream function based on the
particles released as previously but followed until they left the Agulhas
region into the Atlantic

The Lagrangian velocity autocorrelation, which describes the
correlation of the velocity of the trajectories at one time with that of
previous times, shows in Fig.

The power spectra computed from the Lagrangian velocities show that the fixed GCM time step was more energetic than the other schemes, which all yielded nearly identical results. This is the case for all frequencies. There is also a weak maximum at four cycles per day (6 h), which remains unexplained, although it may be related to the fact that the OGCM uses 6-hourly atmospheric forcing.

The mass conservation properties of the used trajectory schemes make it
possible to calculate mass transports between different sections in the model
domain

The influence of the different trajectory schemes on the inter-ocean exchange
of water masses, which takes place in the Agulhas region, has been evaluated
by calculating Lagrangian stream functions. Figure

We have repeated the above ocean-trajectory experiment by releasing the particles in other time periods and increasing the ensemble size. The results only changed marginally.

In addition to the higher accuracy of the time-dependent scheme, it was
also shown to be computationally faster than the stepwise-stationary
scheme with intermediate time steps. In order to quantify this difference, we
compared the computational time for the different schemes using analytical
velocity fields describing inertia oscillations

The two trajectory schemes available in TRACMASS have here been intercompared by calculating Lagrangian statistics, transports and the distances between the trajectories. This has been done for both oceanic and atmospheric applications. The stepwise-stationary scheme assumed that the velocity fields were stationary for the duration of a user-defined intermediate time step between model output fields. These velocities are, however, updated with a linear interpolation in time when crossing a model grid face. The time-dependent scheme does not assume that the velocity is in steady state during any time interval since it solves the differential equations of the trajectory path not only in space but also in time. This continuous evolution of the time-dependent scheme makes it more accurate than the stepwise-stationary scheme without any significant increase in computational expense.

In addition to these two TRACMASS schemes, we have tested a fixed GCM time step scheme, which is in fact a special case of the stepwise-stationary
scheme but with velocity fields always remaining in steady state until a new
GCM data set is reloaded in order to mimic the Ariane trajectory model

The accuracy of the schemes has been evaluated by comparing the distance
between particles that have been started from the same positions but with
different trajectory schemes and how this distance evolves in time. This
distance was shown to depend on the scheme and the number of intermediate
time steps for the stepwise-stationary case. The average distance as a
function of time between the trajectories obtained from the different schemes
is shown in Fig.

The study has shown that the TRACMASS time-dependent scheme is likely to be more accurate as well as faster than the stepwise-stationary scheme with intermediate steps. It remains to be shown how the trajectory schemes used in the present study compare to other trajectory schemes, e.g. Runge–Kutta, which could be used where mass conservation is not important.

The stepwise-stationary scheme needed up to 12 000 intermediate time steps to give as accurate trajectory paths as the time-dependent scheme, which is more than a thousand times as computationally expensive when reading and writing are excluded. The distance between trajectories calculated with the time-dependent scheme and those obtained with the stepwise-stationary scheme decreased as the number of intermediate time steps is increased. The greatest distance was obtained when no temporal variations between GCM outputs at all were considered, i.e. with the fixed GCM time step scheme. We thus conclude that the time-dependent scheme is the most accurate of those tested here for two reasons. Firstly, for theoretical reasons since the time-dependent scheme does not assume stationary velocities during any period of time. Secondly, the trajectories computed with the stepwise-stationary scheme converge towards those computed with the time-dependent scheme for an increasing number of intermediate time steps. A future study could be to calculate trajectories first using fields stored at each GCM time step and then using fields stored at longer time intervals. In the first case, trajectories would be very accurate and could represent a “truth”, and the second case could be used to evaluate which scheme is the closest to the truth.

The Lagrangian statistics, such as relative and absolute dispersion as well as
Lagrangian velocity autocorrelation functions and power spectra, showed almost
identical results for the time-dependent and the stepwise-stationary
schemes. The fixed GCM time step showed, however, some differences from
the other two schemes. For example, the dispersion after 3–4 days was slightly
larger for using a fixed GCM time step, which might be explained by an
abrupt change every time the GCM velocities are updated compared to the
smoother transition of the two other schemes. The results show that the
fixed GCM time step method does not capture the same behaviour of
trajectories as the other schemes. The Lagrangian statistics are also clearly
affected by the model resolution and the time sampling of the GCM fields

The mass conservation of the trajectory schemes in the present study arises from that (1) mass transports across the grid faces are used in the same way as in the GCM itself instead of velocities as in most other trajectory schemes; (2) the mass transport is linearly interpolated within the grid box, where there is otherwise no information of the velocity from the GCM and this enables us to set up a differential equation which has an analytical solution of the trajectory within the grid box. The different trajectory schemes, although mass conserving, will not yield the same results in terms of transports between different sections. The mass transport was tested in the Agulhas experiment, where the fixed GCM time step scheme relatively favoured the Agulhas retroflection with more trajectories returning into the Indian compared to the time-dependent and stepwise-stationary schemes. This difference in mass transport can be explained by the delicate path of the Agulhas leakage, which requires an accurate temporal evolution so that particles can be retained in Agulhas rings. This was better achieved by the time-dependent and stepwise-stationary schemes than by the fixed GCM time step scheme.

The TRACMASS trajectory code with corresponding schemes has been improved and
has become more accurate and user friendly over the years. An outcome of the
present study is that we strongly recommend the use of the time-dependent
scheme based on

The TRACMASS strict requirement of mass conservation makes it, however, necessary to have complete velocity fields on the original GCM grid in order to use mass or volume transports in and out of each model grid box. This requirement of mass conservation will always be somewhat more demanding than for other trajectory codes, since it requires a total understanding of the various GCM coordinate systems as well as the incorporation of them in the TRACMASS framework. This state of affairs is in marked contrast to what holds true for various trajectory codes that only require velocity fields with no mass conservation.

TRACMASS version 6.0 is freely available for research
purposes at https://github.com/TRACMASS. In addition, the code is archived at

The Lagrangian statistics used in the present work (shown in
Figs.

The average distance between the different trajectory calculations,
as presented in Fig.

The mean position of the trajectory cluster is defined as

The mean displacement is defined as the displacement from the origin
as a function of time:

The Lagrangian velocity autocorrelation describes the correlation of the velocity at one time with that of previous times.
The definition is

The Lagrangian timescale is defined as

The authors declare that they have no conflict of interest.

The authors wish to thank Peter Lundberg for constructive comments. This work has been financially supported by the Bolin Centre for Climate Research and by the Swedish Research Council (Grant 2015-04442). Joakim Kjellsson is supported by the UK Natural Environment Research Council grant NE/K012150/1: “Poles apart: why has Antarctic sea ice increased, and why can't coupled climate models reproduce observations?”. The GCM integrations and the trajectory computations were performed using resources provided by the Swedish National Infrastructure for Computing (SNIC) at the National Supercomputer Centre at Linköping University (NSC).Edited by: R. Marsh Reviewed by: S. M. Griffies and two anonymous referees