The most natural and basic way to describe and model a fluid is to divide it into mesoscopic parcels, i.e., material systems contain a large amount of (microscopic) molecules but with dimensions much smaller than the smallest characteristic scale of the macroscopic flow. So, one can assume that a mesoscopic parcel is a close system governed by the fundamental laws of physics (the fundamental principles of mechanics and thermodynamics).
Such a parcel will be hereafter referred to as a Lagrangian parcel. The Lagrangian description of an evolving fluid (flow) consists in specifying for each Lagrangian parcel, and at any time, its location and any dynamical, thermodynamical, chemical, etc. , quantities that are of interest (hereafter fields with the generic notation ).
This requires that each Lagrangian parcel has to be labelled so that its
identity is unambiguous. A possible way is to label each
parcel with its location, say , at an arbitrary reference
time, .
The field is thus written in Lagrangian description as a function of the initial location of the considered parcel and time
, namely
In particular, if the field is the current location of the
Lagrangian parcels, the trajectory of parcel is simply
given by
The Eulerian description consists in specifying the quantity for the
Lagrangian parcel coincidentally present at at the arbitrary location
. The field is thus written in Eulerian description as a
function of space coordinates, , and time , namely
It should be stressed that the time evolution of do not refer to a given Lagrangian parcel but to an ensemble of parcels which have passed at the fixed place (i.e., gives the quantity for another parcel than does).
An interesting particular case of Eulerian field is when is
the initial location of the coincidental Lagrangian parcels, namely
In other words, the knowledge of at any time since is sufficient to track any Lagrangian parcel along its trajectory, since this only requires at any time to make a general "identity control" in the whole space in order to find out where is the parcel that has a given value of .
In effect, the value of at any () is the Lagrangian value
of for the parcel coincidentally present at (). The latter
had the initial location
. Hence
Conversely, the value of at for parcel can be known by
reading at the Eulerian field at the current point of the
parcel trajectory, i.e., at
. Hence
The latter expression in particular shows that the knowledge of the Eulerian field at any time since , together with an inversion method yielding , are sufficient to retrieve the full Lagrangian information from merely the Eulerian fields. The latter statement is the key of the Lagrangian analysis method presented in this document.
The evolution of the physical variables (e.g., in atmosphere sciences: water
vapour content, potential temperature, potential vorticity, concentrations
etc.) attached to Lagrangian parcels can be easily
known by comparing the actual (Eulerian) value at given location and time, to
the initial value for the parcel under consideration, i.e., the value read
at the time origin and at the initial location of the parcel. More precisely,
let us consider any physical quantity . The value of at
for the parcel located at at time is given by
This calculation can be easily carried out since it is only based on the transport of passive scalar variables  which is a very common task in numerical modelling. The method consists, at an arbitrary reference time of the model run ( can be either at the model start or also later during the run), in initializing three fields of passive scalars with the three space coordinates, then driving them along the modelled flow.
More precisely, if Cartesian coordinates are chosen, three scalar fields ,
, (hereafter referred to as initial coordinates)
are defined this way at :
Since these fields are passive scalars driven by the flow, their
evolution is governed by the equation
At the lateral boundaries of the model, the initial coordinates are prescribed depending on the out or inflow condition. Where outflow occurs, parcels are definitively eliminated from the model. In the inflow case, new parcels enter the model. The initial coordinates of the inflowing parcels are set according to table 1.1. With such values, any parcel which has entered the model during the simulation can be easily identified since one of its horizontal initial coordinates exceeds the modeldomain dimension. Moreover, for such a parcel one is able to know where and when it has entered the model. For example, for a model gridpoint let , , . We can conclude that the parcel has entered the model at the point and at the time (where is the velocitylike constant defined in table 1.1).

The previous considerations are valid in continuous formulation. However numerical models cannot be formulated this way but rather operate on space and timediscretized fields (actually 3D matrices). In discretized formulation, the initial coordinates , , , are initialized at with the coordinates of the model gridpoints then experience all the modelled transport processes:
Subgrid processes as well as numerical diffusion have the general effect to mix the distributions of passive scalars. In the considered special case, where passive scalars are not chemical stuff concentrations (or any other additive quantity) but rather are used to transport the initial coordinates, the mixing has to be interpreted to some extent as a progressive loss of identity for the Lagrangian parcels. For example, the equal mixing of two parcels '1' and '2' originating from altitudes and does not result in a parcel from the altitude , although this is what is produced by the model.
The mixing of the initial coordinates makes nevertheless sense. While using partial derivative equations (even in discrete form) we indeed implicitly assume that any field, including the initial coordinates tracers, remains continuous. For the example considered, the mixing of parcels 1 and 2 in the same grid cell thus implies that an infinity of parcels with all the intermediate values of the initial altitude between and have also been transported into the considered grid cell. Thus, the information for this grid cell is correct, since the mean value of the initial altitude for the parcels present within the grid cell is actually . However the most precise information for this grid cell should be "parcels from everywhere between and ", or equivalently "parcels from everywhere around within a radius ".
This suggest that the information given by the initial coordinates in the context of a discretized formulation should be ideally completed by some kind of accuracy radius indicating the dispersion of the initial locations of all the parcels contained in a grid cell, around the barycenter of these initial locations. This radius would have as initial value the halfsize of the grid cell, then increase during the model run, especially in regions of active mixing such as in deep vertical transports, boundary layers, etc. It is also clear that the accuracy radius would be all the greater that the mixed parcels are initially remote. Unfortunately the growth of such an accuracy radius is not so easy to quantify and the authors' reflexion still remain at the stage of this qualitative discussion^{1.1}.
It must be however stressed that this progressive loss of identity is not specific of the initiallocation method for Lagrangian analyses, but also exists with any trajectorybased method  in a more hidden way. Any inaccuracy in the integration process of a trajectory path make that the considered parcel actually changes every integration step. Hence the parcel considered at the end of the calculated trajectory might be quite remote from the parcel considered at the start, although the calculated trajectory has the appearance of a single, welldefined, parcel path.
Moreover most trajectory methods have the further drawback to ignore the subgrid transports whereas they are taken into account with the initial coordinates method  as well as parametrizations can do.
As discussed above, there may be a great uncertainty on the identity of parcels after they have experienced strong mixing processes. Nevertheless one could be interested in the later evolution of these parcels. For example in the atmosphere, deep convection may transport pollutants from the boundary layer which then chemically evolve in the upper troposphere.
In such cases a possible way to restore a reliable information on parcel identity is to reinitialize the tracer fields , , along Eq (1.31.5) once or more during the model run. This has the added advantage to let the user have the choice in the timeorigin of the studied evolution among the various reinitialization times.
Periodically reinitialized tracers will thus give a certain amount of evolution fragments over whiles shorter than the whole run. In fact the Lagrangian information over longer periods than the reinitialization frequency is actually not lost and can be retrieved by simple postprocessing (this will be shown in the next paragraph). Therefore reinitializations can be done as often as needed to keep the tracers fields "clean" enough (i.e., not too mixed).
Let be the times when the initial coordinate fields are reinitialized during the model run ( corresponding to the model start). Hereafter denotes the 'initial' location at reinitialization time of the parcel currently present at (i.e., the subscript refers to the time origin)^{1.2}.
Let us consider as the time origin for the Lagrangian evolution that is under interest. For , the initial coordinate fields have been reinitialised at least once since the time . can however be retrieved by joining together fragments of Lagrangian motions. With , the method consists in reading at time and location , then at time and location , and so on, until reading at time and location . This is sketched in figure 1.1.
More precisely, let us consider the Lagrangian parcel at time at the
location and denote (
) the
successive locations of the parcel at times
. If
is known, the previous location of the parcel
can be
retrieved by reading, at time and location , the initial
location vector transported with the parcel since , that is:
If with (or if ), the location of the parcel at time can thus be retrieved along the following algorithm:
The algorithm (Eq 1.71.9) can be directly used for
the computation of individual backward trajectories, since it gives the
successive locations of a chosen Lagrangian parcel. Further, the value of any
physical quantity along the Lagrangian parcel trajectory can be
immediately obtained from the Eulerian field of as
ini_lg.f90
called
by ini_modeln.f90
). This initialization occurs at least at the simulation
START, and also possibly at every RESTART of a new simulation segment (see
option "LINIT_LG=.TRUE.
" in chapter2). For that purpose
the horizontal conformal coordinates , and the true altitude
are interpolated at the masspoints (see MesoNH's Scientific
Documentation  Book 1, §3.1 and 4.2).
During the model run, these fields are treated exactly as any other passive
scalar variables by the model dynamics (i.e., they experience all explicit as well
as parametrized transports)^{1.4}.
Distinction is only made in order to render the turbulent mixing of the
Lagrangian scalars desactivable independently from that of the scalar variables
(see option LNOMIXLG
in chapter2). Other dynamical options
are common for all scalar variables.
At the lateral boundaries under inflow condition, , , are
prescribed according to Table 1.1 where: , are again replaced
by the model coordinates , ; is the true altitude of
the masspoint; is the while since the last (re)initialization of the
Lagrangian tracers. The inflow velocitylike constant is set to 10 m/s
(parameter XLGSPEED
set in modd_lg.f90
). The lateral inflow
prescription is made in routine setlb_lg.f90
.
The initial coordinates at the boundaries of inner models are given by the "father"^{1.5}model for inflow conditions, and evacuated into the father model for outflow conditions. The boundaries of the inner models are thus fully "twoway permeable" for the Lagrangian variables (as well as for any other scalar variable).
The process (compute_r00.f90
, called by diag.f90
) simply consists
in reading data in earlier FM files at locations given by the 's.
In general these do not coincide with grid points. The discretized
formulation of the algorithm therefore requires spatial interpolations between
the grid points. A simple linear interpolation scheme is used in the present
version of the system. The numerical code has been tested by
comparing catenated and noncatenated Lagrangian tracers fields covering
evolutions over the same while, with an excellent agreement found.
It also may occur during the process that one of the 's is located
outside the model domain. In that case, the process is stopped and we have
adopted, for simplicity, to flag the value
as
"parcel not present in the model domain at " without any other
information (the point will appear as data empty in plots
of the fields , and , or in any other plots
requiring this information). The flag value is 1.E+11 (ZSPVAL
in
compute_r00.f90
).
For plots on iso surfaces or other isosurfaces, the same algorithm is used as for plots on isobars, isentropes, isoPV, etc. . In case of multivaluation over a given vertical, the point of highest altitude is retained.
The computation of backtrajectories is performed with the algorithm Eq.1.71.9 as in DIAG. For a given trajectory, the iteration is stopped as soon as a parcel is found to originate from outside the model domain at the previous step (or of course as soon as the information of the earliest MesoNH file is used).
For the computation of streamlines (case of a stationary flow) the same algorithm is used recursively with the initial coordinate fields of a single MesoNH file (since these fields are assumed to be stationary). The backward computation of the streamline is stopped after 100 iterations or as soon as as the parcel exits the model domain.
For details, please contact Jacqueline Duron (durj@aero.obsmip.fr) or Joël
Stein
(Joel.Stein@meteo.fr).