The LAGRANTO Lagrangian analysis tool – version 2.0

Lagrangian trajectories are widely used in the atmospheric sciences, for instance to identify flow structures in extratropical cyclones (e.g., warm conveyor belts) and long-range transport pathways of moisture and trace substances. Here a new version of the Lagrangian analysis tool LAGRANTO (Wernli and Davies, 1997) is introduced, which offers considerably enhanced functionalities. Trajectory starting positions can be defined easily and flexibly based on different geometrical and/or meteorological conditions, e.g., equidistantly spaced within a prescribed region and on a stack of pressure (or isentropic) levels. After the computation of the trajectories, a versatile selection of trajectories is offered based on single or combined criteria. These criteria are passed to LAGRANTO with a simple command language (e.g., “GT:PV:2” readily translates into a selection of all trajectories with potential vorticity, PV, greater than 2 PVU; 1 PVU = 10 K m kg s). Full versions of this new version of LAGRANTO are available for global ECMWF and regional COSMO data, and core functionality is provided for the regional WRF and MetUM models and the global 20th Century Reanalysis data set. The paper first presents the intuitive application of LAGRANTO for the identification of a warm conveyor belt in the North Atlantic. A further case study then shows how LAGRANTO can be used to quasi-operationally diagnose stratosphere– troposphere exchange events. Whereas these examples rely on the ECMWF version, the COSMO version and input fields with 7 km horizontal resolution serve to resolve the rather complex flow structure associated with orographic blocking due to the Alps, as shown in a third example. A final example illustrates the tool’s application in source–receptor analysis studies. The new distribution of LAGRANTO is publicly available and includes auxiliary tools, e.g., to visualize trajectories. A detailed user guide describes all LAGRANTO capabilities.


Introduction
The calculation of air parcel trajectories has become a widely used approach in different areas of atmospheric research. Several trajectory tools have been developed and are currently available to the community for computing backward and forward trajectories using gridded wind fields, typically from (re-)analysis fields or numerical model simulations. Examples of such trajectory tools are FLEXTRA (Stohl et al., 1995), the NASA Goddard trajectory model , HYSPLIT, the Hybrid Single Particle Lagrangian Integrated Trajectory model (Draxler and Hess, 1998), the UGAMP offline trajectory model (Methven, 1997;Methven et al., 2001), and LAGRANTO, the Lagrangian analysis tool (Wernli and Davies, 1997). They all solve numerically the same trajectory equation where x = (λ, φ, p) is the position vector in geographical coordinates and u = (u, v, ω) the 3-D wind vector. The tools differ mainly in terms of spatial interpolation (e.g., Seibert, 1993;Stohl et al., 2001), the number of iterations used for one time step, the handling of the lower boundary, and, an important aspect for the user, in terms of their functionality and the details of the output. For instance, HYSPLIT can be operated directly on the web, which makes it extremely straightforward to obtain trajectory information. LA-GRANTO, in contrast, allows trajectories to easily be selected based on objective criteria. In this paper, a new version of this well-established trajectory tool is presented, which significantly generalizes and extends the possibilities in determining starting points, selecting trajectories using combinations of criteria, and tracing a comprehensive set of information along the selected trajectories. This new version 2.0 of LAGRANTO enables novel options for research with air parcel trajectories, and aims at achieving a level of flexibility for the user that goes beyond the options of previously available trajectory tools. Before we describe in detail the functionality of this new version of LAGRANTO and present potential applications, we first summarize some highlights of historical research using trajectories, and then a selection of applications of LA-GRANTO 1.0 during the last almost 20 years. This summary should put the calculation of trajectories in a historical context and illustrate the very broad range of research questions, for which a Lagrangian analysis with simple air parcel trajectories can be useful. Shaw and Lempfert (1906) were probably the first who used surface trajectories, calculated based upon surface weather charts, to analyze and visualize the airflow in extratropical cyclones. Decades later, Reed (1955) and Danielsen (1961) pioneered the calculation of isentropic trajectories from radiosonde data for studying the descent of stratospheric intrusions associated with upper-level fronts. Kleinschmidt (1950) estimated the pathway of trajectories ascending in the warm sector of extratropical cyclones and the diabatic potential vorticity modification along this flow. These are three very early examples of the usefulness of air parcel trajectories in studies on the structure and dynamics of extratropical weather systems. Since the late 1970s -now using wind fields from reanalyses or model simulations -trajectories have been frequently used for investigating different types of atmospheric flow phenomena including extratropical cyclones (e.g., Whitaker et al., 1988;Kuo et al., 1992), orographic flows (e.g., Buzzi and Tibaldi, 1978;Steinacker, 1984), stratosphere-troposphere exchange (e.g., Buzzi et al., 1984;Vaughan et al., 1994;Newman and Schoeberl, 1995), and transport and mixing in the stratosphere (e.g., Austin and Tuck, 1985;Schoeberl et al., 1992;Bowman, 1993).
When developing LAGRANTO in the early 1990s, it was the major objective to develop a versatile tool for the Lagrangian analysis of weather systems and their dynamics. But clearly, at that time trajectories have been also successfully used in other areas of the atmospheric sciences, for instance for transport studies of pollution (Tyson et al., 1996) and Saharan dust (Swap et al., 1992) -see also the review by Stohl (1998).
LAGRANTO was first used to identify objectively coherent airstreams in case studies of extratropical cyclones, in particular warm conveyor belts (WCBs; see also Sect. 2) and dry intrusions (Wernli and Davies, 1997;Wernli, 1997), and later also sting jets (Gray et al., 2011) and cold conveyor belts (Schemm and Wernli, 2014). Recently, WCBs have been calculated for the ECMWF ensemble prediction system for producing WCB probability forecasts (Schäfler et al., 2014;Rautenhaus et al., 2015) and for the entire ERA-Interim data set, leading to a comprehensive global climatology of WCBs (Madonna et al., 2014;. Also, LA-GRANTO trajectories helped analyze how the moist outflow of tropical cyclones modifies the downstream midlatitude jet (Grams et al., 2013).
Other important research areas for the application of LAGRANTO were (i) the identification of stratospheretroposphere exchange events (e.g., Wernli and Davies, 1997;Sprenger and Wernli, 2003;Škerlak et al., 2014), (ii) the quantitative analysis of moisture sources and transport (e.g., Sodemann et al., 2008;Knippertz and Wernli, 2010), (iii) the interpretation of trace gas and isotope measurements from in situ and remote sensing instruments (e.g., Prévôt et al., 1997;Calisesi et al., 2001;Koch et al., 2002;Pfahl and Wernli, 2008), (iv) cloud microphysics (e.g., Fueglistaler et al., 2003;Joos and Wernli, 2012;Brabec et al., 2012), and last but not least (v) orographic flows (e.g., Kljun et al., 2001;Miltenberger et al., 2013;Würsch and Sprenger, 2015). This short list clearly illustrates the very broad range of research themes for which a versatile Lagrangian analysis tool can be highly valuable. These possibilities are further increased due to the novel features of LAGRANTO version 2.0, as illustrated in the following section and the examples given in Sect. 4.

An introductory example: identification of a warm conveyor belt
Warm conveyor belts (WCBs) are coherent flow structures, which transport moist near-surface air from the warm sector of an extratropical cyclone upward to near-tropopause levels (e.g., Browning, 1990). Typically this transport occurs during a 48 h ascent period and is accompanied by a poleward movement of the strongly precipitating air parcels. Here we take this atmospheric flow feature as a first example to illustrate the application of LAGRANTO. Our aim is to detect a WCB in the North Atlantic associated with an extratropical cyclone in January 2009, investigated in detail by Joos and Wernli (2012).
We start with the formal definition of the problem: first, starting positions are initialized within a suitable domain over the North Atlantic and Europe at 12:00 UTC on 29 January 2009. For this case we choose the domain from 60 • W to 20 • E and 30 to 80 • N, which encloses the overall cyclone evolution. We choose starting positions in this domain that are horizontally equidistant with 80 km horizontal spacing and extend vertically from 1030 to 790 hPa with 30 hPa vertical spacing. Second, trajectories are calculated from all starting positions 48 h forward in time and then the trajectories are selected that ascend at least 600 hPa, i.e., whose pressure decreases by at least 600 hPa. And finally, for this introductory example, potential temperature is traced along the selected WCB trajectories. Note the somewhat brute-force approach taken: first, many trajectories are calculated (here about 26 700), and then the few ones (here 76) fulfilling the imposed WCB characteristics are selected and further studied.
To accomplish the proposed aim, the wind and potential temperature fields must be available in netCDF files for the time period from 12:00 UTC on 29 January to 12:00 UTC on 31 January 2009 (see Sect. 3 for further details). Then the starting positions can be created with a command (all details can be found in the Supplement; see example 1): This command creates a file startf.2 with starting coordinates (longitude, latitude, pressure) covering the whole North Atlantic. The horizontal domain is specified in a text file regionf with a line entry "1 -60 20 30 80", where label 1 identifies the region and the other values define the rectangular longitude-latitude box as specified above. The suffix .eqd tells LAGRANTO that the starting positions in this example shall be equidistantly distributed within the box with a spacing of 80 km. The horizontal distribution of the starting positions is shown in Fig. 1. The vertical level of the starting points is specified by profile (1030,790,8) @ hPa, which intuitively translates to eight equidistant pressure levels between 1030 and 790 hPa. Many other options exist to create starting points, as discussed later.
In the next step, the forward trajectories are calculated with the LAGRANTO caltra command: The starting positions are taken from startf.2, the file created above, and the output of the trajectory calculation, i.e., the 6-hourly trajectory positions, is written to the traj.4 file. The output interval is set by default to the interval of the input files (6 h for ERA-Interim). Note that different file formats can be specified according to the suffix of the filenames: suffix 2 refers to a text file, whereas suffix 4 (equivalently "du") refers to a Fortran binary dump. The latter is very compact (reduced disk space needed) and can be quickly read by other LAGRANTO commands. The order of the two dates in the call, 20090129_12 followed by 20090131_12, defines the direction of the trajectory calculation (here forward, since the second date is after the first one) and the duration (here 48 h). Note that the format to specify dates is YYYYMMDD_HH(mm), where YYYY, MM, DD, HH, and mm refer to the year, month, day, hour, and minutes, respectively. If no value is given for the minutes mm, then 00 is used as the default. LAGRANTO is able to handle a high frequency of input files; in principle, they could be available every minute. A special option is the so-called "jump flag" -j to handle trajectories crossing the lower boundary due to numerical deficiencies (as discussed further in Sect. 3.3).
Note that so far trajectories have been calculated for the whole North Atlantic, and it is only now that an objective selection criterion is used to extract WCB trajectories from this large set. The LAGRANTO command to do this is called select, and an appropriate call for the present purpose, corresponding to the requirement mentioned above, is  The criterion selects all trajectories for which the pressure (p) difference (DIFF) between time 0 and time 48 h is greater (GT) than 600 hPa. The selected trajectories, i.e., their 6hourly positions, are written to a new trajectory file wcb.1, which is now in ASCII format sorted by trajectory; i.e., the whole first trajectory is listed in the ASCII file, followed by an empty line, after which the second trajectory is listed, and so on.
The final step is accomplished with the trace command, which allows meteorological fields to be traced along trajectories. Here, we already have selected the WCB trajectories and would like to know the evolution of potential temperature (TH) along each trajectory. The appropriate LAGRANTO call is trace wcb.1 wcb.1 -f TH 1 which adds a column with potential temperature values to the existing trajectory file wcb.1. The last parameter 1 defines a scaling factor, which applies to TH before it is written to the output file. Note that, if several fields shall be traced along the trajectories, they can be listed in an external file (see Sect. 3.3). As a result, the file wcb.1 lists, for all the selected WCB trajectories, their position (λ, φ, p) and potential temperature, every 6 h from time 0 to 48. The first few lines from the resulting trajectory file are shown here as an example:  In the header the reference time, which corresponds to time 0.00, and the time range are given. Then, headings are provided for the five columns: time (in hour.min); longitude and latitude (in deg); pressure (in hPa) and potential temperature (in K). For each 48 h trajectory, information is provided on nine lines, followed by an empty line.
The selected WCB trajectories are shown in Fig. 1, colored with potential temperature. A well-established WCB can be discerned in the eastern North Atlantic, starting near the surface to the southwest of the Iberian peninsula and ascending rapidly while proceeding northward before finally being deflected to the east. A more detailed analysis of this WCB example follows in Sect. 4.1.

The structure of LAGRANTO
In this section additional, mainly technical, details about LAGRANTO are discussed. An overview of a typical LA-GRANTO call is shown in Fig. 2 as a flowchart. First, the input files must be prepared in netCDF format; then, the starting positions are defined from which the forward or backward trajectories are calculated. Depending on the application, a subsample of trajectories is selected based on their pathway, and/or additional meteorological and geometrical parameters are traced along the trajectories. Further selections of trajectories can then rely on these additional fields. Finally, the trajectories can be visualized as either individual trajectories or in the form of a trajectory density field. Note that modularity is a characteristic feature of LAGRANTO, which allows one at any time to select another trajectory subsample, trace additional fields, or even base new trajectory calculations on the output of previous ones. In the following, the key aspects of LAGRANTO are discussed in greater detail.  Figure 2. Flowchart showing the typical steps in a LAGRANTO trajectory calculation (LAGRANTO tools are written in bold). The input files include the 3-D wind fields at several time steps. Starting positions (longitude, latitude, pressure) are defined with startf. Then trajectories are calculated with caltra, and possibly subsamples of trajectories are selected with select. Along these trajectories additional fields are traced with trace, which might then ask for further select/trace iterations. The resulting trajectories can be further analyzed or visualized: quickview shows individual trajectories; density calculates trajectory densities on a geographical grid, and profile allows one to study the air columns the trajectory is passing through. For further details, see text (Sect. 3).

Data structure
LAGRANTO calculations are based on netCDF files that contain 3-D wind fields on a regular longitude-latitude grid, either globally or for a limited domain. In the vertical, different level types are supported: (i) ECMWF hybrid sigma-p level type, (ii) constant pressure levels, and (iii) isentropic levels. All fields must be horizontally and vertically unstaggered; in particular, the vertical wind must be provided at the same grid points as the horizontal wind components. Since ECMWF disseminates its products in GRIB format (formerly GRIB1, now GRIB2), a conversion into netCDF is necessary. To this aim, a conversion tool is provided together with LA-GRANTO. Alternatively, the conversion can be done using the CDO tools (https://code.zmaw.de/projects/cdo), which requires a subsequent adjustment of the CDO-netCDF files to the needs of LAGRANTO. Specific information for using LAGRANTO with data not from ECMWF is given in Sect. 4.3 and 5.1.
LAGRANTO expects a specific file and filename convention: the zonal wind U (in m s −1 ), the meridional wind V (in m s −1 ) and the vertical wind OMEGA (in Pa s −1 ) must be available in a primary file named P{date}, where the date format is YYYYMMDD_HH(mm), as mentioned above. If the unit of the vertical wind is in hPa s −1 instead of Pa s −1 , a scaling factor of 100 is automatically applied. Note that LA-GRANTO does not recognize whether the wind fields originate from ECMWF analyses or forecasts. In addition to the three wind components, surface pressure PS (in hPa) must be provided in the P files for level type (i) for calculating the full 3-D pressure field on the model levels and identifying trajectories intersecting the topography. For the calculation of secondary files, which accordingly are named S{date}, an additional tool p2s is available. It allows, for instance, potential vorticity or potential temperature to be calculated on the ECMWF hybrid grid. LAGRANTO will automatically check whether S files are available in addition to the P files. When starting positions are specified on isentropic levels, LAGRANTO assumes that potential temperature is found in the S file.
Trajectory position information can be written in different formats: (i) ASCII, (ii) netCDF, or (iii) Fortran dumps. Whereas (i) is generally favored for the final results, (ii) and (iii) are preferable for inter-module communication, e.g., when the trajectory information is passed from the calculation to the selection tool. Of course, LAGRANTO comes with a suite of auxiliary tools (see Sect. 5.2), which among other things allow trajectory files to be converted between the different output formats.

The specification of starting points (startf)
Starting positions for trajectory calculations are provided most easily as a text file with three entries per line: longitude (from −180 to +180), latitude (from −90 to +90), and pressure (in hPa). Every line then specifies a trajectory starting point. All air parcels specified in one so-called starting file will have the same start and end time of the trajectory calculation, as later described in Sect. 3.3.
As an alternative to manually constructing such a list of starting positions, LAGRANTO offers a tool (startf) to create more sophisticated starting files, e.g., when the manual listing would be too cumbersome either because of its length or the involved calculations. Basically, startf allows starting positions to be described based on geometrical and/or meteorological criteria. For instance, the specification box.eqd [-20,30,-30,30,10] defines horizontal starting positions in a box in the tropical Atlantic, extending from 20 • W to 30 • E and from 30 • S to 30 • N. The positions are equidistantly distributed in this box (every 10 km, specified by the fifth parameter). In addition to a simple rectangular box, startf offers several other options to define the starting points in the horizontal (see Table 1), e.g., on the model grid or within an arbitrary polygon.
The choice of the vertical position of the starting points is passed to startf with two further arguments, separated by @, where the first defines the "heights" of the starting points and the second the vertical unit. As an example, profile[300,400,10] @ hPa defines 10 equidistant starting levels between 300 and 400 hPa. If the second parameter was changed to K, the 10 levels would be between the 300 and 400 K isentropic levels. For instance, profile[300,400,3] @ K would set the three vertical levels to 300, 350 and 400 K. A comprehensive list of possibilities to define the vertical positions is given in the LAGRANTO reference guide (www.lagranto.ethz.ch; see Sect. 5.4), and a few examples are listed in Table 1.
In addition, starting positions can be defined based on meteorological criteria. For instance, with an additional argument PV:GT:2 passed to startf, only starting points with potential vorticity larger than 2 PVU will be selected. Of course, such a criterion only makes sense if a specific date is given because the PV field varies strongly in time. In fact, a date has to be passed to startf as a first parameter and only becomes relevant if a vertical coordinate other than hPa is applied.
Note that the applicability of meteorological selection criteria originates directly from two characteristics of LA-GRANTO: (i) starting files created with startf are themselves trajectory files, and (ii) the selection tool select (see Sect. 3.4) operates on any trajectory file.

Trajectory calculation
Given a file with starting positions, the LAGRANTO caltra tool calculates forward or backward trajectories, where an intuitive syntax defines the direction: e.g., caltra 20130719_06 20130720_06 calculates 24 h forward trajectories starting at 06:00 UTC on 19 July 2013, and caltra 20130720_06 20130719_06 correspondingly calculates 24 h backward trajectories starting at 06:00 UTC on 20 July 2013. LA-GRANTO correctly handles global and hemispheric domains; i.e., the crossing of the poles and the date line is fully supported. If wind fields are available only within a limited domain, trajectories crossing the lateral boundary are marked to do so with a missing value flag.
A trajectory, x(t), is obtained from the numerical integration of Eq. (1). The key elements of any numerical trajectory calculation are the temporal discretization and spatial interpolation. For the numerical time step, LAGRANTO uses a variant of the approach outlined by Petterssen (1956), which has also been used by, e.g., Whitaker et al. (1988) and Kuo Table 1. Some examples of the creation of starting files (see Sect. 3.2). A typical call would be of the form startf YYYYMMDD_HH startf criterion, where the first argument defines the starting date of the calculation, startf is the name of the file with the starting positions, and the criterion, as given in the left column, specifies the positions. Only the part in bold font of the specification is explained in the right column.
450, 500, 550 hPa above ground level box.grid(-10,-5,40,50) @ level(300) @ hPa All grid points in box 10-5 • W, 40-50 • N box.grid (-10,-5,40,50) @ level(320) @ K On 320 K isentrope polygon.eqd(greenland,20) @ level(100) @ hPa,agl Equidistant (20 km) points within polygon "greenland" point(-10,50) @ profile(100,900,10) @ hPa Vertical profile (10 values) from 100 to 900 hPa et al. (1992). Starting at time t at the position x, and taking the wind at this position u(x, t), the first iteration of the new position x * at time t + t is obtained from the following "forward" time step: where t denotes the time step. This first iteration only uses wind information at the starting position. For further iterations, the wind vector is averaged between the starting position and the previously estimated ending position, i.e., and the second iteration of the new position then reads This simple scheme is also shown schematically in Fig. 3. With LAGRANTO, three iterative steps are applied per default. On request the number of iterations can be changed. The time step, t, is either determined automatically as 1/12 of the data time interval, or it can be set manually. For the spatial interpolation, LAGRANTO uses a bilinear interpolation in the horizontal and a linear interpolation in the vertical. The stability of the numerical scheme was tested in a rotational flow setting (see Seibert, 1993) for 648 h forward trajectories. No hint of any numerical instability could be discerned for these rather long trajectories. Special attention must be given to trajectories approaching the surface. If a trajectory crosses the lower boundary, i.e., if its pressure exceeds the surface pressure PS, LAGRANTO stops the integration of this trajectory and its coordinates remain fixed at the last position before hitting the surface. To allow the air parcel to proceed on its course, LAGRANTO offers an option (the so-called "jump flag") to artificially relaunch the air parcel 10 hPa above the surface whenever it crosses the lower boundary (i.e., the integration is continued from the pressure level PS−10 hPa). The rationale for this very pragmatic procedure is that the accuracy of trajectories in the turbulent planetary boundary layer, given the typically very limited temporal resolution of the wind field, is anyway However, a simple Euler forward step is not numerically accurate. Therefore, in a next iteration a new velocity u * is computed as the average of the velocities at the initial position and at the forward projected position. A new air parcel position x * * is then calculated based on this refined guess of the velocity. In LAGRANTO, three such iterative steps are repeated to obtain the final new position of the air parcel. not critical, and care must be taken when interpreting individual trajectories that travel through the boundary layer. 1

Tracing fields
Whereas caltra delivers the coordinates of the air parcel's path, trace allows one to trace additional 3-D and 2-D meteorological fields along the computed trajectory. The fields must be available either in the primary P or secondary S files, or they can be calculated (online) based on the meteorological and positional information already available in a trajectory file. Note, however, that the online calculation of meteorological fields is typically much less efficient than if they are pre-computed in a secondary input file, and then can readily be traced along the trajectories.
Additionally, fields can be traced at positions offset from the air parcel's path. For instance, T:-100 hPa traces the temperature field 100 hPa above the trajectory. If this position was below the ground, then a missing data value is set. Such a calculation can be useful, for instance, to assess the static stability in the layer beneath the trajectory or to determine the horizontal temperature gradient along the trajectory (e.g., with T:-100 km [lon] and T:+100 km [lon]).
Note that LAGRANTO's modularity allows the list of fields traced along the trajectories to be easily extended; i.e., if an additional field turns out to be of interest, then no recalculation of the whole trajectory is necessary. A simple invocation of trace, e.g., in the form adds two columns to the trajectory file, with values of potential temperature 50 hPa below and 50 hPa above the air parcels' position, respectively. Furthermore, another option allows one to trace the average, maximum or minimum values of a variable in a circle around the air parcel, which is useful for characterizing the surroundings of the considered parcel.

Consistency with LAGRANTO 1.0
The new version of LAGRANTO uses the same bilinear interpolation and time-stepping scheme as LAGRANTO 1.0. Therefore, a perfect agreement is expected if the same starting positions and wind fields are used. Indeed, we performed such a comparison for 48 h forward and backward trajectories, started on a global grid at 500 hPa. All trajectories, 79 539 in total, agreed perfectly in position and differences for variables traced along the trajectories (e.g., PV and TH) remained negligible.

Objective selection criteria (select)
A powerful aspect of LAGRANTO is its capability to select subsets of trajectories from a pre-calculated set, using a large variety of selection criteria. Many (thousands to millions) trajectories can be calculated in a first step and then a selection can be applied according to geometrical and/or meteorological criteria. In essence, select takes an input trajectory file, applies a filter specified by simple commands, and then writes out the selected trajectories that fulfill the filter conditions. In the following, the selection criteria are further discussed. A glimpse at the possibilities can be inferred from Table 2, listing some common criteria.

General structure
Selection criteria are specified in the following way: {COM-MAND:FIELD: ARGUMENTS:TIME}. The first parameter describes the operator that will be applied to the field indicated by the second parameter. As a typical example, one might want to test whether the trajectory position falls within a certain band of latitudes, say between 20 and 30 • N. The corresponding criterion for select would be {IN:lat:20,30:ALL(ANY)}, where the time parameter needs some further explanations. ALL(ANY) means that the criterion is checked for all times of the trajectory, but the criterion has to hold only at least once, i.e., at any time. Instead, with ALL(ALL) one can ensure that the trajectories remain in the band at all times, or with ALL(NONE) trajectories can be selected that are never located in the latitude band. Furthermore, the list of times when the criterion is applied can be specified in greater detail: FIRST and LAST refer to the first and last time steps of the trajectory, and, e.g., 6,12,18(ANY) applies the band criterion only at the times 6, 12, and 18 h (where time 0 h corresponds to the starting time of the trajectory).

Difference and integral criteria
A more detailed specification of the {FIELD} parameter allows more refined selection criteria to be applied. Often, temporal changes of a certain variable along the trajectory are used to select interesting subsets. select supports this with the DIFF field extension: for instance, GT:TH(DIFF):10:LAST,FIRST computes the difference in potential temperature between the last and first trajectory positions and checks whether it is larger than 10. In addition, trajectories can be selected based upon the integral of a certain variable (e.g., total precipitation RTOT) along the trajectory path. 2 In this case, the criterion GT:RTOT(SUM):10:ALL integrates the field RTOT over all time steps of the trajectory (indicated by the ALL time parameter) and then checks whether the sum is greater (GT) than 10. Note that no unit is specified with the command; therefore, the valid unit is determined by the unit of this field in the trajectory file. Similarly, one can imagine that the minimum RTOT(MIN) or maximum RTOT(MAX) of this field are of interest for the selection process or its average RTOT(MEAN) or temporal variance along the trajectory RTOT(VAR).

Positional criteria
There are many criteria that are based only on the air parcels' positions. For these types of criteria, select offers "built-in fields" that can be given as the second parameter even if they are not listed in the trajectory file. Examples of such pa-

Logical combinations
LAGRANTO's modularity guarantees that select can be invoked iteratively; e.g., the user can do a pre-selection of trajectories and later do more refined selections. If two select calls are invoked subsequently, this corresponds to a logical AND combination. Logical OR can be applied within a single call of select. If trajectories should be selected that experienced either a lot of diabatic heating (e.g., an increase in potential temperature 3 The INPOLYGON field relies on spherical polygons, i.e., closed geometric figures on the sphere formed by arcs of great circles. For LAGRANTO they are specified as a list of longitudelatitude vertices and a single latitude-longitude point inside the polygon. The vertices define the boundary of the polygon, and the single point's aim is only to specify which region is inside and which outside. Then use is made of the algorithm by Bevis and Chatelain (1989) to decide whether a trajectory point falls within or outside of the given spherical polygon. of more than 10 K) or a strong ascent (e.g., a pressure decrease of more than 500 hPa), the following command can be used: Combining selection criteria comes with a pitfall: when for instance testing that an air parcel has a PV value greater than 2 PVU and is located above 300 hPa, a naive call would be GT:PV:2:ALL(ANY) & LT:p:300:ALL(ANY). However, this call only guarantees that the trajectory has once reached a PV value above 2 PVU and surpassed the 300 hPa surface; however, the two conditions might be met at different times. To enable a coincident combination of conditions, a special feature of select can be used, namely, the definition of label fields.

Label fields
To ensure that the two criteria in the previous example are met at the same time, a two-step procedure can be used. First, GT:PV:2:1(LABEL) & LT:p:300:2(LABEL) sets labels at all trajectory times when one or both of the conditions are met: label 1 if only the PV condition applies, 2 if only the pressure condition applies, and both labels if both criteria apply. Then, in a second step, the trajectories can be selected using these labels: ALL:LABEL:1,2:ALL(ANY) will select all trajectories for which labels 1 and 2 are both set simultaneously at any time along the trajectory, i.e., if PV > 2 PVU and p < 300 hPa. Note the special command ALL, which can only be applied for the LABEL feature of select. Two other specific commands are ANY and NONE, which accept trajectories for which any or none of the labels are set. The labeling of trajectory times can be used also in a different way. Suppose that all trajectory times are marked when the air parcel stays in a certain domain, e.g., over Iceland. Then we would like to select trajectories associated with precipitation (RTOT) at exactly these times, i.e., when the trajectories are above Iceland. This can be achieved by first setting a label 1 when the air parcel is located over Iceland. Then the criterion GT:RTOT:0:LABEL(ANY) selects all trajectories that are associated with precipitation (RTOT > 0) at any time over Iceland. Note, since in this example only one single label is set, that LABEL(ANY) will select all trajectory times when this label is set (air parcel over Iceland).

Illustrative examples
In this section, a selection of possible applications of LA-GRANTO 2.0 is briefly presented to further illustrate the versatility of the tool. They relate to airflows in extratropical cyclones (Sect. 4.1), stratosphere-troposphere exchange (Sect. 4.2), orographic flows (Sect. 4.3), and the analysis of the air mass origin at a hypothetical measurement site (Sect. 4.4).

Refined analysis of a WCB
In Sect. 2, a warm conveyor belt (WCB) has been identified in the North Atlantic. Here, we extend the analysis of this WCB and thereby illustrate the exploratory application of different selection criteria. The starting point is the trajectory file wcb.1 created in Sect. 2, which contains trajectories with an ascent of at least 600 hPa within 48 h and starting from between 1050 and 790 hPa.
A first refined analysis could look at WCB trajectories that experience a different ascent, e.g., at least 500 hPa. The corresponding selection can be achieved for instance with the following criterion: The p(CHANGE) field specification considers the pressure at the first and final trajectory times and checks whether the modulus of the pressure change exceeds 500 hPa. Note that this criterion would also identify trajectories that descend more than 500 hPa. However, if we apply the selection criterion to wcb.1, it is clear that only ascending air parcels are captured.
Whereas the selection criteria applied so far only rely on the path of the air parcels, the full power of explorative analysis comes into play if meteorological fields are also considered. For instance, one can consider only trajectories that experience extensive diabatic heating, as manifest in an increase in potential temperature: GT:TH(DIFF):10:48,0 selects trajectories with more than 10 K diabatic heating between 0 and 48 h; i.e., the difference between the potential temperature value at the end of the ascent minus the one at the beginning is larger than 10 K.
The next two examples are more complicated. The first one looks at trajectories with a non-zero ice water content (IWC) during a period longer than 12 h. We assume that IWC has been traced along the trajectories. First we mark all trajectory times with IWC > 0 with the label 1, and then we determine for each trajectory the time period during which the label is set and compare it to the required minimal time. This two-step approach translates into two corresponding selection criteria: determine for each trajectory the time period during which the label is set and compare it to the required minimal time. This two-step approach translates directly into two corresponding LAGRANTO calls: The second command counts the number of trajectory time steps for which a label is set, considering all times (ALL), and compares this to the required minimum number of time steps (GT), which here is two (corresponding to 6 h for 6-hourly input data). Note that LAGRANTO does not allow the user to specify for which label the comparison applies.
Also, the second, more complicated, example relies on label setting. We would like to select all trajectories that lose at least 1.5 g kg −1 water in a certain domain, e.g., to assess whether the WCB trajectories significantly contribute to the precipitation in this domain. Let us assume that the region is specified by a list of longitude-latitude vertices of a spherical polygon in a file named ireland. The first step would be to mark (with label 1) all trajectories crossing this region; then, the change in specific humidity (Q) is considered during the time interval when the air parcel is within the marked region. The translation into selection commands is again straightforward: i.e., the change in specific humidity, Q(CHANGE), is determined between the times for which the label is set. Hence, the last argument LABEL in the criterion specifies again a list of trajectory times, more specifically those for which a LA-BEL is set. Of course, these times depend on the trajectory considered; i.e., it is not a fixed set of times.

Stratosphere-troposphere exchange
Air mass transport across the tropopause has been often quantified using Lagrangian techniques (see introduction). In this context, deep stratospheric intrusions are of particular interest, for instance, because they can transport ozone-rich air to low-tropospheric levels. In this example we show how a quasi-operational forecasting system of stratospheric intrusions over Europe has been set up with LAGRANTO, used for more than a decade to inform measurement sites about potentially interesting episodes (e.g., Trickl et al., 2010). The setup is as follows: (i) ECMWF operational forecasts provide the meteorological fields for the trajectory calculations; (ii) every 12 h, 4-day forward trajectories are calculated, starting in the entire region covering the North Atlantic and western Europe (80 • W to 20 • E, 40 to 80 • N) and with starting heights between 250 and 600 hPa; (iii) from this large set of trajectories a subset is selected. The selected trajectories must initially reside in the stratosphere (i.e., their initial PV value must be larger than 2 PVU), and they must descend within 4 days by more than 300 hPa. (iv) It will be verified whether these "stratospheric intrusion trajectories" pass nearby over a measurement site, hence providing "hit tables" specific to each site. The procedure described above can readily be transformed into a corresponding sequence of LAGRANTO calls, once the required input netCDF files are ready. The first step with LAGRANTO is to define the starting positions once (we take the same for all trajectory calculations), with the following criterion applied in startf (the complete call can be found in the Supplement): box.eqd [-80,20,40,80,50] @ ... ... profile(250,600,20) @ hPa This specifies the equidistant (50 km) starting points in the desired box and 20 vertical levels between 250 and 600 hPa. In principle, it would be possible to first calculate all forward trajectories and then select the ones that are within the stratosphere at the starting time. However, this approach is resource demanding. It is a better strategy to reduce the start-ing points to those with a PV value larger than 2 PVU before calculating the trajectories. Hence, we apply select to the starting file. The selection criterion is GT:PV:2:FIRST Figure 4a shows the starting positions at 250 hPa after this criterion is applied on a particular day. The descent criterion can only be applied once the forward trajectories have been calculated, i.e., after the caltra 20090118_00 20090122_00 startf.2 traj.1 call. Now, it is possible to select the trajectories that descend more than 300 hPa within 4 days because all positional information is ready in the trajectory file. The selection criterion is Here, the first part guarantees that the maximum minus the minimum pressure exceeds the requested 300 hPa, and the second part makes sure that the air parcel is at a lower altitude at the end of the 4-day period than at the beginning. The selected trajectories are shown in Fig. 4b.
Next, we might assess whether one of these stratospheric intrusion trajectories passes near a surface measurement site, e.g., the Jungfraujoch (JFJ) in the Swiss Alps at a height of 3471 m a.s.l and at 7.985 • E, 46.547 • N. To test whether a trajectory passes this point within a certain distance in the horizontal (here 100 km), the function INCIRCLE can be used, which has been described in Sect. 3.4: TRUE:INCIRCLE:7.985,46.5474,100:ALL(ANY) From the large number of descending trajectories shown in Fig. 4b, six fulfill this geometric criterion (Fig. 4c). They split into two clusters, both originating in the western Atlantic, but exhibiting a very different evolution in the vertical (Fig. 4d).

Orographic flows
Orographic flows pose a particular challenge for trajectory analyses due to the complex topography, which influences the wind field on small scales. Here we consider an example where the flow is blocked by the Alps, a mountain chain with about 1000 km west-east and 100 km north-south extension. The horizontal resolution of the ECMWF model is not fully sufficient to accurately model the fine-scale flow. Therefore, we here use the LAGRANTO version adapted to the COSMO limited-area model (see Sect. 5.1 for further details). The horizontal resolution of the meteorological fields is 7 km, the model has 60 vertical levels and the wind fields are available every hour from the operational COSMO analyses provided by the Swiss national weather service.
Here, we consider the case of a northwesterly flow approaching the Alps. The trajectories are started at 750, 1500, 2250, and 3000 m a.s.l every hour during the period from 09:00 UTC on 28 January 2009 to 09:00 UTC on 30 January 2009. First, the starting positions are defined along a line well upstream of the Alpine barrier (Fig. 5a). The corresponding specification for startf is (for, e.g., the 1500 m starting height) line(0,16,49,52,100) @ level(1500) @ m where 100 equidistant points are defined along a line between the points 0 • E, 49 • N and 16 • E, 52 • N, all at a height of 1500 m. The initial distance from the Alps was chosen to be larger than the Rossby radius of deformation, which roughly determines how far mountains influence the upstream flow (Pierrehumbert and Wyman, 1985). Note that in the COSMO version of LAGRANTO, starting heights are given in m, in accordance with the model's vertical coordinate. If pressure is also available on the P files, of course the starting height can also be given in hPa. Internally, LA-GRANTO will then convert the pressure heights into geometrical heights and will do all the further calculations with these latter vertical coordinate. It is one of the main features of startf to offer this versatility to the user.
The trajectories are then calculated with the following call, where the starting positions are in the file startf_1500m.2 and the trajectories are written to a file traj_1500m.1: Note that the jump flag (-j) is set; hence, all trajectories crossing the lower boundary are artificially lifted to 10 m above the surface and allowed to move on. Figure 5a shows the resulting trajectories, indicating a nice example of orographically blocked flow: the air parcels are horizontally deflected around the Alpine barrier.
We next consider the question of whether air parcels pass over the Gotthard Pass (8.56 • E, 46.57 • N) in the Swiss Alps: TRUE:INCIRCLE:8.5608,46.5726,18:ALL(ANY) Here, all trajectories are selected that pass through a circle with 18 km radius around the Gotthard Pass. For the previously calculated trajectories, this is the case for a single trajectory. To check whether the flow of this air parcel is adiabatic or whether it is influenced by diabatic processes, one can consider the potential temperature evolution in the trajectory file. In case that this field is not available in the primary and secondary input files, LAGRANTO still allows fields to be traced along the trajectories, provided that temperature and pressure are already available in the trajectory file or are found in the input files. A call trace gotthard.1 gotthard.1 -f TH 1., assuming that the single trajectory is saved in file gotthard.1, will automatically decide whether the field is ready for tracing in an input file or whether it can be computed online from existing fields in the trajectory file. In our case potential temperature changes from 289.6 K at the beginning to 292.2 K at time 43 h, when the air parcel crosses the lateral boundary of the COSMO domain. Therefore this particular flow is almost isentropic.
Sometimes it is very interesting to investigate the vertical structure of the atmosphere along a specific trajectory, for instance, the mountain-crossing air parcel discussed above. To this end, LAGRANTO's profile tool can be used. At each trajectory time and position, it extracts not only the value of a meteorological field at the air parcel's position, but also a complete vertical profile starting from the surface to the upper troposphere. The resulting field can then be visualized as a time-height plot (see Fig. 5c), and this allows processes to be studied that occur above or below the considered trajectory (e.g., the evolution of the boundary layer height underneath the trajectory, the vertical extension of a cloud, or the potential occurrence of gravity wave activity). The example shown in Fig. 5c was created by the call timeres gotthard.1 gotthard.1 -min 15 profile gotthard.1 profile.nc which takes the trajectory in the gotthard.1 input file and creates a netCDF file with the corresponding vertical profiles of all meteorological fields listed in tracevars (see Sect. 3.3). In order to increase the time resolution of the trajectory from 1 h to 15 min, the LAGRANTO timeres tool was called before profile. Between model output times a linear (or on demand cubic spline) interpolation is applied. Note that the vertical range of the pseudo profile and/or the meteorological fields included can all be passed as options to the tool (for details, see the LAGRANTO reference guide available at www.lagranto.ethz.ch). As a second example, we would like to find all trajectories that reach 90% relative humidity (RH) in a region "around the Alps", more precisely when they are less than 300 km away from the 1500 m height contour of the Alps. Such a criterion might be of interest in assessing whether and how moist air parcels are affected by the Alps. The region of interest is saved as a spherical polygon in a file (alps_300km.txt), which lists first one point within the polygon and then all points along its boundary. In Fig. 5d the spherical polygon is shown by filled yellow circles. Shown are also the trajectories reaching at least 90 % relative humidity within this polygon and the position where this happens (filled magenta circles). They are selected by a three-step selection criterion: where the first marks (with label 1) all trajectory positions and times inside the spherical polygon. Analogously, the second criterion marks (with label 2) instances where the relative humidity exceeds the 90 % threshold. Finally, it is checked whether the two labels are set simultaneously, and if so the trajectory is selected. In total, 72 of the 100 trajectories fulfill this sophisticated criterion: they are shown in Fig. 5d.

Origin of air masses at observational site
In the previous examples, only forward trajectories were considered. Here, we are interested in the origin of air masses arriving at a measurement site. This asks for backward trajectories that are released into the surroundings of the measurement site.
As an illustrative example, we consider here the origin of air masses arriving at the ABC-Pyramid Atmospheric Research Observatory in the Himalayas (Bonasoni et al., 2008). This station, situated at 5079 m a.s.l., has monitored ozone and other atmospheric constituents since March 2006. LA-GRANTO is used to provide daily a quasi-operational air mass source diagnostic (http://evk2.isac.cnr.it). The forecast trajectories help predict whether the air masses arriving at the Pyramid station are, for instance, stratospheric or originate from the planetary boundary layer. Figure 6a shows as an example, 120 h backward trajectories started in a circle around the ABC-Pyramid site from the 500 hPa level. Note that the starting points are equidistantly distributed, with a spacing of 10 km, in a circle of radius 100 km around the measurement site (86.80 • E, 27.95 • N). This approach allows one to quantify the degree of horizontal coherence of the air arriving at the station and to identify different airstreams that are potentially involved. LAGRANTO offers an easy way to create starting positions displaced from the actual point of interest. In the present example, the following option for startf: circle.eqd(86.80,27.95,100,10) @ ... ... list(500) @ hPa defines equidistant grid points in a circle, given by (λ, φ) of the center and the radius 100 km. The distance between starting points is given by the last parameter 10 km for circle.eqd. As a starting height, we choose 500 hPa only.
Given the start file startf.  Fig. 6a, colored with pressure to show the height evolution of the different airstreams.
Different aspects of the backward trajectories can now be studied in more detail. For instance, it is possible to separate long-range transport from local transport by using the intrinsic LAGRANTO field DISTO, which measures the great circle distance between an air parcel's position at a specific time and its initial position: GT:DIST0:1000:LAST selects a trajectory if the distance between the initial and final time (indicated by LAST) exceeds 1000 km. Or, it might be of interest to select only the trajectories that descend more than 250 hPa. Again, an intrinsic field can be used: Finally, the origin of the air masses at the Pyramid station might be assessed on a climatological basis. Here, we take 1 year (2007) of backward trajectories arriving at the Pyramid station at 500 hPa. The basic strategy of the trajectory calculation is the same as the one outlined before. However, only one single starting position at "exactly" the Pyramid station's coordinates is set and the backward trajectories are calculated based on the ERA-Interim re-analysis of ECMWF. All backward trajectories are merged into one large trajectory file using LAGRANTO tool mergetra, comprising 4 × 365 trajectories. This large number of trajectories can no longer be visualized in the way that each single trajectory is shown: the figure would be completely filled with trajectories, not allowing any structure to be seen. Instead, trajectory densities can be used; i.e., all trajectories are gridded onto a regular latitude-longitude grid and then for each grid point the number of trajectories associated with this grid point is shown (Fig. 6b). If all trajectories are merged into one single file alltraj.1 with mergetra, it is very easy to get the trajectory density with LAGRANTO's density tool: density alltraj.1 alltraj.nc The gridded trajectory density is then available in the netCDF file alltraj.nc and can readily be visualized.

LAGRANTO for other models
LAGRANTO was initially developed for ECMWF analysis and forecast data, but meanwhile several other models are supported. In particular, a fully functional version exists for the COSMO non-hydrostatic regional model (Baldauf et al., 2011). The COSMO and ECMWF versions differ mainly because of differences in the model grid: COSMO operates on a rotated longitude-latitude grid and its vertical levels are based on geometrical height instead of pressure. Another important difference, of course, is the higher spatial and temporal resolution of COSMO, and the limited domain. Currently, COSMO is run operationally by the German and Swiss weather services with horizontal resolutions of about 7 and 2 km, and output is archived at 1 h time steps. A COSMO version of LAGRANTO is run operationally at MeteoSwiss to provide short-term forecasts of the dispersion of pollutants and radioactive emissions. Recent research applications of COSMO trajectories include the calculation of moisture origins for measurements of stable water isotopes (Aemisegger et al., 2014) and for heavy precipitation events (Winschall et al., 2014), the Lagrangian analysis of cirrus cloud observations (Cirisan et al., 2014), and the detailed analysis of foehn flows (Miltenberger et al., 2013). It is noteworthy that the last of these studies also describes the implementation of an online trajectory module within COSMO, which is based on the LAGRANTO algorithms but calculates the trajectories during the model integration using wind fields at every model time step.
Preliminary LAGRANTO versions, for which not all functionalities have been implemented and tested yet, are also available for the UK Met office Unified Model (MetUM), the Weather Research and Forecasting (WRF) modeling system and the 20CR re-analysis data set (Compo et al., 2011). Whereas versions of MetUM are based on a rotated longitude-latitude grid, WRF uses a different horizontal grid structure. For an example of a MetUM model study using LAGRANTO, see Elvidge et al. (2015).
When working with data from COSMO or the MetUM, additional tools can be used to facilitate the conversion between equatorial and rotated coordinates. For instance, geo2rotlonlat -170 45 followed by geo2rot trainp traout first defines a coordinate system with the rotated north pole at 170 • W, 45 • N (used for the grid of the COSMO or MetUM model simulation), and then the equatorial coordinates in the input trajectory file trainp are converted to rotated ones and written to traout. This is particularly helpful if the COSMO trajectories are to be shown together with COSMO model output, i.e., if the air parcel positions are overlaid directly on meteorological fields from the COSMO model.

Tools
LAGRANTO comes with a set of auxiliary programs that facilitate working with trajectories. Some of them have already been mentioned in the preceding sections. A full list of these tools can be found in the reference guide (www.lagranto. ethz.ch) and a few are briefly introduced here. First, trainfo file gives some meta information about the trajectory file. For instance, trainfo file dim provides the dimensions, i.e., the number of trajectories, time steps and fields (columns) in the trajectory file, and trainfo file list lists all trajectories irrespective of the format in which they are stored.
A second tool, reformat, allows the format of the trajectory file to be changed. The different file formats have a different compression level, which can be essential if large trajectory files have to be archived or passed from one LA-GRANTO program (e.g., caltra) to another (e.g., trace). A typical conversion is reformat file.nc file.ls, which converts from netCDF to ASCII format. The most compact and fastest format is a Fortran dump reformat file.ls file.du, at the cost of losing human readability. Furthermore, a small number of trajectories can be converted to KML format for visualization with Google Earth (see below).
Often, it is of interest to combine different trajectory files or to extract certain features from a single file. For instance, two trajectory files file1 and file2 cover the same time period and the trajectories are started from the same positions, but contain complementary meteorological fields along the trajectories. Then mergetra file1 file2 file will merge the two trajectory files to write a new one. mergetra can also merge forward and backward trajectories starting at the same time and position. In contrast, the extract tool allows pieces of information to be extracted from a trajectory file. In particular, specified columns or times can be extracted, selected trajectories given by their index number, or extract file -startf writes all starting positions of a trajectory file to a list.

Trajectory visualization
Different tools are provided for trajectory visualization, based on (i) Matlab 4 , (ii) NCL, and (iii) Python. Example scripts show how LAGRANTO trajectory files can be imported and the trajectories displayed on geographical maps. The trajectories can be color-coded according to meteorological fields. For instance, pressure can be used to reveal the height evolution of the trajectories. The most convenient visualization relies on Python, for which LAGRANTO comes with a quickview tool to instantly visualize trajectories. For instance, coming back to the example of Sect. 4.3, the call quickview traj_750m.1 reads the traj_750m.1 trajectory file and shows all trajectories on a equidistant cylindrical projection (Fig. 7a). The geographical domain is automatically chosen to include all trajectories. On request it can be set manually. Furthermore, it is possible to select a field in the trajectory file that is used for coloring them; for instance, quickview -v RH -d nh traj_750m.1 displays the trajectories in the Northern Hemisphere (nh) and colors them according to their relative humidity (RH). Two different geographical projections are supported: equidistant cylindrical and polar stereographic.
Finally, LAGRANTO can write a KML file for a limited number of trajectories, which then can be loaded into Google Earth for visualization and further study (see example in Fig. 7b). A KML file essentially needs the latitude-longitude position of the air parcels and the geometrical height above sea level. Whereas the horizontal position is part of all valid trajectory files, the height needs special consideration. If the geopotential height is available in the file, as is the case for every LAGRANTO trajectory based on the COSMO model, this will be inserted into the KML file when invoking the file conversion to the KML format. However, since ECMWF uses pressure as the vertical coordinate, the height is not available in a typical ECMWF trajectory file. In this case, LAGRANTO assumes a US standard atmosphere to scale from pressure to height a.s.l. when converting to the KML format.

Conclusions
This article described in some detail a new version of the Lagrangian analysis tool LAGRANTO and presented some illustrative examples of its application. Compared to the original version of LAGRANTO, which has been in use for almost 20 years, many important parts of the code have been completely rewritten. LAGRANTO allows forward and backward trajectories to be calculated based on fields from different NWP models (ECMWF, COSMO, MetUM, WRF), to trace meteorological fields along these trajectories, and to select subsamples based on kinematic, geographical and meteorological criteria. The very special features of LA-GRANTO, compared to other trajectory tools, are 1. the highly flexible definition of trajectory starting positions, 2. the versatile and iterative selection of subsets of trajectories from a previously calculated larger ensemble, and 3. availability of the tool for global data sets (e.g., ECMWF analyses) and very high-resolution numerical models (e.g., convection-permitting COSMO simulations).
Also thanks to these characteristics, which facilitate exploratory research with trajectories, LAGRANTO is already well established as a useful research tool for atmospheric dynamics, air chemistry, and cloud microphysics. It is run either online during the integration of an NWP model (Miltenberger et al., 2013) or, in most cases, as a stand-alone offline Lagrangian analysis tool (as described in this article). With the improved new release of offline LAGRANTO, new capabilities are introduced that further increase the options for trajectory-based research. Since the access to highquality data from the NWP model might be limited for potential users, we also plan to develop a web-based version of LAGRANTO, which will allow trajectory calculations to be performed over a web interface, similar to the already existing HYSPLIT model. This step will complete the triad of LAGRANTO trajectory models available to the research community: (i) COSMO-based online trajectories; (ii) offline trajectories using input fields from different models calculated by the user on-site; and (iii) offline trajectories pro-vided by web-LAGRANTO, which can be invoked from a user-friendly web GUI.

Code availability
LAGRANTO source code and documentation can be downloaded from URL www.lagranto.ethz.ch, where the different versions (ECMWF, MetUM, COSMO, WRF) are available as distinct releases. LAGRANTO has been successfully installed on Linux platforms, using different Fortran compilers (PGI, Intel, gfortran). The installation is controlled with a shell script and details of the installation are listed in a Readme file. In addition to Fortran, several other software tools are needed, in particular Unix csh and Perl. Furthermore, for the visualization tool (see Sect. 5.3), Python is needed.
Finally, a first-step user guide and a detailed reference guide are provided. The latter describes in detail all options for all LAGRANTO programs (e.g., for the trajectory selection).
The Supplement related to this article is available online at doi:10.5194/gmd-8-2569-2015-supplement.