The Lagrangian Analysis Tool Lagranto – 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. Trajec5 tory 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 10 potential vorticity (PV) greater than 2 PVU). 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 quasi15 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 20 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 (Schoeberl and Newman, 1995), 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 of extratropical weather systems.Since the late 1970s -using now 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 1990ies, 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 section 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;Pfahl et al., 2014).Also, LAGRANTO 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 stratosphere-troposphere exchange events (e.g., Wernli and Davies, 1997;Sprenger and Wernli, 2003;Skerlak 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 et al., 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 possibilties are further increased due to the novel features of LAGRANTO version 2.0, as illustrated in the following section and the examples given in section 4.
2 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 UTC 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 hours 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 26700), 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 UTC 29 January to 12 UTC 31 January 2009 (see section 3 for further details).Then the starting positions can be created with a command (all details can be found in the supplementary material, see example 1) This command creates a file startf.2with 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 .eqdtells 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 8 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 command caltra: 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, are written to the file traj.4.The output interval is set by default to the interval of the input files (6 hours 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') 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 hours).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 section 3.3).
Note that so far trajectories are 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 select traj.4 wcb.1 'GT:p(DIFF):600:0,48' 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 6-hourly 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 command trace, 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.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, if several fields shall be traced along the trajectories, they can be listed in an external file (see section 3.3).As a result, the file wcb.1 lists, for all the selected WCB trajectories, their position (λ, φ, p) and potential temperature, every 6 hours 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-hour trajectory information is provided on 9 lines, followed by an empty line.
The selected WCB trajectories are shown in Fig. 1, colored with potential temperature.A wellestablished WCBs can be discerned in the eastern North Atlantic, starting near the surface to the south-west 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 section 4.1.
3 The structure of LAGRANTO In this section additional, mainly technical, details about LAGRANTO are discussed.An overview of a typical LAGRANTO 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.

Data structure
LAGRANTO calculations are based on netCDF files that contain three-dimensional 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 LAGRANTO.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 sections 4.3 and 5.1.
LAGRANTO expects a specific file and file name 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 on 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 LAGRANTO 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 on the P files for level type (i) for calculating the full 3D 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, and e.g. if starting positions are specified on isentropic levels assumes that potential temperature is found on 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 section 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 Section 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 section 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 LAGRANTO: (i) starting files created with startf are themselves trajectory files, and (ii) the selection tool select (see section 3.4) operates on any trajectory file.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 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 manually set.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 for 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 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 3D and 2D meteorological fields along the computed trajectory.The fields must be available either on the primary P or secondary S files, or they can be calculated (online) based on the meteorological and positional information already available on a trajectory file.Note, however that the online calculation of meteorological fields is typically much less efficient than if they are pre-computed on 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 re-calculation of the whole trajectory is necessary.A simple invocation of trace, e.g., in the form 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 trajecories, 79539 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 precalculated 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: {COMMAND:FIELD: ARGUMENTS:TIME}.The first parameter describes the operator that will be applied on 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 − 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) it can be enforced 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 parameter {FIELD} 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 field extension DIFF: for instance, GT:TH(DIFF):10:LAST,FIRST computes the difference of potential temperature between the last and first trajectory position 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 time parameter ALL) 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 on the trajectory file.Similarily, 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 this type of criteria, select offers "built-in fields" that can be given as the second parameter 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 of potential temperature 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: GT Combining selection criteria comes with a pitfall: If 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.For enabling a coincident combination of conditions, a special feature of select can be used, namely the definition of label fields.
Label fields: To enforce 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 accepts 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, 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 LAGRANTO 2.0 are briefly presented to further illustrate the versatility of the tool.They relate to airflows in extratropical cyclones (section 4.1), stratosphere-troposphere exchange (section 4.2), orographic flows (section 4.3), and the analysis of the air mass origin at a hypothetical measurement site (section 4.4).

Refined analysis of a WCB
In section 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 section 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 600 hPa.The corresponding selection can be achieved for instance with the following criterion: GT:p(CHANGE):600:FIRST,LAST The field specification p(CHANGE) considers the pressure at the first and final trajectory time and checks if the modulus of the pressure change exceeds 600 hPa.Note that this criterion would also identify trajectories that descend more than 600 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 also meteorological fields are considered.For instance, one can consider only trajectories that experience extensive diabatic heating, as manifest in an increase of potential temperature: GT:TH(DIFF):10:48,0 selects trajectories with more than 10 K diabatic heating between 0 h and 48 h, i.e., the difference of 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 nonzero 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: GT:IWC:0:1(LABEL) GT:LABEL(NONZERO):2:ALL The second command counts the number of trajectory timesteps 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 2 (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's 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 of 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: GT:Q(CHANGE):1.5:LABEL 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 LABEL 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 setup 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 hours, four-day forward trajectories are calculated, starting in the entire region covering the North Atlantic and western Europe (80 • W to 20 • E, 40 • N 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 four days by more than 300 hPa; and (iv) it will be verified if these 'stratospheric intrusion trajectories' pass nearby over a measurement site, hence providing 'hit tables' specific for each site.
The procedure described above can readily be transformed into a corresponding sequence of LA-GRANTO 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 supplementary material): 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 starting points to those with a PV value larger than 2 PVU before calculating the trajectories.Hence, we apply select to the starting file.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 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 limited-area model COSMO (see section 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 north-westerly 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 UTC 28 January 2009 to 09 UTC 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, 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, LAGRANTO 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 on 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 whether air parcels pass over the Gotthard pass (8.56 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 on the primary and secondary input files, LAGRANTO still allows fields to be traced along the trajectories, provided that temperature and pressure are already available on the trajectory file or are found on the input files.A call trace gotthard.1 gotthard.1 -f TH 1., assuming that the single trajectory is saved on file gotthard.1,will automatically decide whether the field is ready for tracing on an input file or whether it can be computed online from existing fields on 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, LA-GRANTO'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 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 which takes the trajectory in the input file gotthard.1 and creates a netCDF file with the corresponding vertical profiles of all meteorological fields listed in tracevars (see section 3.3).In order to increase the time resolution of the trajectory from 1 h to 15 min, the LAGRANTO tool timeres (see Table 3) was called before profile.Between model output times a linear (or on demand cubic spline) interpolation is applied.Note, 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 on 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 if 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 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 in the surrounding 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., monitors ozone and other atmospheric constituents since March 2006.LAGRANTO 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 Pyramid station are, for instance, stratospheric or originate from the planetary boundary layer.
Figure 6 shows as an example, 120-hour 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.2,backward trajectories can be calculated with caltra.For instance, if the date of interest is 00 UTC 26 Oct 2007, 5-day backward trajectories can be calculated with caltra 20071031 18 20071026 00 startf.2traj.1 -j, which writes the trajectories to traj.1.The resulting trajectories are shown in Fig. 6, 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: GT:VERT0:250:ALL(ANY) Here, VERTO considers the pressure difference between the initial time and any other time step along the trajectory.Note the difference to the call GT:p(DIFF):250:FIRST,LAST which would only consider the pressure difference between the initial and final time steps.
Finally, the origin of the air masses at Pyramid station might be assessed on a climatological basis.Here, we take one year (2007) of backward trajectories arriving at 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: The gridded trajectory density is then available on the netCDF file alltraj.ncand can readily be visualized.
5 Special features and special versions 5.1 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 non-hydrostatic regional model COSMO (Baldauf et al., 2011).The COSMO and the 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 MetUM is 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. (2014).
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, geo2rot -lonlat -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.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 tool extract allows pieces of information to be extracted from a trajectory file.In particular, specified columns or times can be extracted; or 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) Matlab4 , (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 section 4.3, the call quickview traj_750m.1 reads the trajectory file traj 750m.1 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 manually set.Furthermore, it is possible to select a field on 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 on 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 on 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.

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 document.In addition to Fortran, several other software tools are needed, in particular Unix csh and Perl.Furthermore, for the visualization tool (see section 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).Table 1: Some examples for the creation of starting files (see section 3.2).A typical call would be of the form: startf YYYYMMDD HH startf criterion, where the first argument defines the starting date 895 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.

3. 3
The calculation of trajectories (caltra and trace) Trajectory calculation: Given a file with starting positions, the LAGRANTO tool caltra 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 UTC 19 July 2013, and caltra 20130720 06 20130719 06 correspondingly calculates 24-h backward trajectories starting at 06 UTC 20 July 2013.LAGRANTO 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.
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 to characterize the surroundings of the considered parcel.
even if they are not listed in the trajectory file.Examples for such parameters are DIST, DIST0, INBOX, INPOLYGON 3 and INCIRCLE.If air parcel should be selected that have traveled a certain distance, a criterion like GT:DIST:1000:48 checks whether the total distance traveled by the air parcel until time 48 h exceeds 1000 km; or if DIST is replaced by DIST0 whether it has moved at least 1000 km away from its starting position, measured along a great circle.Of particular interest are criteria that rely on regions, which have to be crossed or avoided by the selected trajectories.Here select supports different types of region specifications.TRUE:INPOLYGON:file:ALL(ANY) tests whether the trajectory passes through (TRUE) a spherical polygon, e.g., a country border, which is specified as a list of coordinates in an external file.A simpler region specification is based on circles: for instance FALSE:INCIRCLE:-40,50,500:LAST excludes (FALSE) all trajectories that are located at their final time step (LAST) within the circle with a radius of 500 km centered at 40 • W, 50 • N. Finally, rectangular regions given by longitude and latitude coordinates can be set, either with the inline command INBOX (see an example in section 4.1) or by specifying the coordinates in an external file.
:TH(DIFF):10:LAST,FIRST | LT:p(DIFF):-500:FIRST,LAST.The second operator could also be written equivalently as GT:p(DIFF):500:LAST,FIRST. Note the logical OR operator |.The corresponding AND operator is &, and the order of operator execution follows standard Boolean algebra.

Fig
Fig. 5c was created by the call Fig.5dthe 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: 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 LA-GRANTO, 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 LAGRANTO, 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, 3. availability of the tool for global datasets (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, LA-GRANTO 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 a 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 high-quality data from 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 provided by web-LAGRANTO, which can be invoked from a user-friendly web-GUI.

Figure 2 :
Figure 2: Flowchart showing the typical steps in a LAGRANTO trajectory calculation (LAGRANTO tools are written in bold).The input files include the 3D 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 analysed 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 (section 3).

Figure 3 :
Figure 3: Schematic representation of the iterative Eulerian time step used in LAGRANTO.The air parcel's position at time t is given as x.The velocity field at this position is u(x).Based on the position, the velocity and the time step, a new air parcel position can be calculated with a simple Euler forward step: x * = x + ∆t • u(x, t).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.

Figure 4 :
Figure 4: Example of a a stratosphere-troposphere exchange (STE) forecast based on LAGRANTO trajectories.(a) Equidistant (50 km horizontal spacing) starting positions at 250 hPa in the stratosphere (PV>2 PVU), and in color PV at 00 UTC 18 January 2009; (b) Selection of 96-h forward trajectories that descend more than 300 hPa and start above 400 hPa (coloring according to pressure); (c) Refined selection of descending trajectories that pass the Jungfraujoch (JFJ) measurement site within 100 km horizontal distance.The color shading gives the averaged wind speed at 400 hPa during the four days and the dots mark the position of the air parcels at the given times; (d) vertical evolution of JFJ trajectories shown in (c), colored according to their PV value.The dots mark the time and pressure when geographically the air parcel is closest to JFJ.

Figure 5 :
Figure 5: (a) Starting positions (black dots) and 48-h forward trajectories (grey lines) started at 09 UTC 28 January 2009; additionally shown are the topography (in m) in color, and the wind arrows at 500 hPa at the trajectory starting time; (b) trajectory passing over the Gotthard pass (topography

Figure 6 :
Figure 6: (a) 120-h backward trajectories started within 100 km from the ABC-Pyramid Atmospheric Research Observatory in the Himalayas (see text) at 18 UTC 31 Oct 2007.The starting height is 500 hPa and the trajectories are colored according to their pressure (in hPa); the position of the air parcels 48 h and 96 h before arrival are marked with black dots; (b) density of 120-h backward trajectories from Pyramid station started at 500 hPa for the whole year 2007.In total 1460 backward trajectories are included and their 6-hourly positions then gridded onto a 1 • × 1 • latitude-longitude grid.The values give the total counts per grid cells (for details, see text).

Figure 7 :
Figure 7: (a) 48-h forward trajectories started at 09 UTC 28 January 2009 along a line north of the Alps (as in Fig. 5d).The individual trajectories are colored according to their height (in m).The figure was created with the visualization tool quickview included in LAGRANTO (see section 5.3).(b)The same trajectories as in (a), but converted into KML format, which can then be added as a separate layer to a Google Earth map.
Figure4ashows 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 call caltra 20090118 00 20090122 00 startf.2traj.1.Now, it is possible to select the trajectories 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 LAGRANTO program (e.g., caltra) to another (e.g., trace).A typical conversion is reformat file.ncfile.ls, which converts from netCDF to ASCII format.The most compact and fastest format is a Fortran dump reformat file.lsfile.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).

Table 2 :
Examples of selection criteria.A typical call of the LAGRANTO program select takes the following form: select inp.trajectory out.trajectorycriterion,where the first two arguments provide the input and output trajectory files and the third one defines the selection criterion, as exemplarily given in the left column.For a complete list of all options with examples, consider the reference guide at www.lagranto.ethz.ch.Lagrangian identification of a warm conveyor belt (WCB).Two-day forward trajectories are started at 12 UTC 29 Jan 2009 over the North Atlantic between 1030 and 790 hPa every 30 hPa.The starting points are equidistantly distributed (80 km horizontal spacing; blue dots).Trajectories ascending more than 600 hPa within 48 h are selected as WCB trajectories and colored according to potential temperature (in K).