FLEXTRA can be used to calculate different types of forward or backward trajectories, and has facilities to estimate the uncertainty of trajectories. It is specifically designed to compute long time sequences of trajectories for many receptor locations. FLEXTRA version 2.0 remained in use almost unchanged for several years now, and since the model got quite popular over the years, we decided to implement some improvements. This is also the first FLEXTRA manual in English language.
The new FLEXTRA version 3.0 has several additional attractive new features as compared to version 2.0:
FLEXTRA is currently based on model level data of the numerical weather prediction model of the European Centre for MediumRange Weather Forecasts (ECMWF). Gridded data of this model are available at various horizontal resolutions, 31 vertical levels, and with a frequency of 3 hours. At the time of this writing, the ECMWF model is operational at T319 L31 resolution, but an extension to L50 is planned. Different FLEXTRA versions, not described here, are available for the German/Swiss numerical weather prediction model (Wotawa, personal communication), and for the CALMET diagnostic wind field model (Pechinger, personal communication). With some changes, the model may be based on any other type of suitable model output. Since the model internally uses grid coordinates, such changes can be easily accomplished.
In this manual, no validation of FLEXTRA is presented, but there exist some papers on this issue. FLEXTRA was validated through comparison of model results to independent data using wind fields of varying spatial and temporal resolution (Stohl et al., 1995), the tracks of constant level balloons (Stohl et al., 1997, Stohl and Koffi, 1998), gas balloons (Baumann and Stohl, 1997) and hotair balloons (Baumann et al., 1996), and using potential vorticity and specific humidity (Stohl and Seibert, 1998) as tracers. Several other papers were presented at conferences. See the FLEXTRA homepage for a more complete listing of publications.
There also exists a sister model of FLEXTRA, FLEXPART, which is driven by the same (somewhat extended) input data. FLEXPART is a Lagrangian particle dispersion model, which, in contrast to FLEXTRA, fully accounts for turbulent dispersion. See http://www.forst.unimuenchen.de/LST/METEOR/stohl/flexpart.html for a description of this model.
FLEXTRA expects the threedimensional input data on ECMWF model (i.e. h) levels which are defined by a hybrid coordinate system. The conversion from h to pressure coordinates is given by p_{k} = A_{k}+B_{k}p_{s} and the heights of the h surfaces are defined by h_{k} = A_{k}/p_{0}+B_{k}, where h_{k} is the value of h at the k^{th} model level, p_{s} is the surface pressure and p_{0} is a pressure constant (101325 Pa). A_{k} and B_{k} are coefficients, chosen in such a way that the levels closest to the ground follow the topography, while the highest levels coincide with pressure surfaces. Intermediate levels show a gradual transition between topographyfollowing and pressure levels.
The vertical wind in hybrid coordinates is not directly available from the ECMWF archives, but is calculated by the preprocessor that extracts the data.
These data extraction routines to be used at ECMWF have been prepared by G. Wotawa.
The source code and an extensive documentation of these routines are available from:
http://www.boku.ac.at/imp/envmet/ecmwf_extr.html.
The data extracted with these routines, more than what is actually needed by FLEXTRA, can also serve as input to the FLEXPART particle dispersion model.
FLEXTRA automatically determines the wind field domain, resolution, etc., from the input wind fields, the only restriction being that the maximum field dimensions must not be exceeded. The fields can, but don't have to be, global. In FLEXTRA version 3.0, however, they have to be defined strictly on a latitude/longitude grid.
FLEXTRA may use several nested wind fields at the same time, in addition to one coarseresolution mother grid. These wind fields can be nested within each other (i.e, form a hierarchy of nests), or can cover different regions of interest. Typically, the resolution of these wind fields will be quite different. For instance, we routinely use global fields with 2 ^{°} ×2 ^{°} resolution, with a 1 ^{°} ×1 ^{°} nest covering the whole of Europe and large parts of the Northern Atlantic Ocean, and a 0.4 ^{°} ×0.4 ^{°} nest covering Central Europe. FLEXTRA treats nested grids differently from the mother grid. Thus, their field dimensions may be different from the mother grid.
Also the nested wind fields may differ from each other in their actual dimensions, but in contrast to the mother grid, they all occupy the same amount of storage space (i.e., they all have the same maximum field dimensions). If their actual dimensions are very different, computer memory is wasted because their FORTRAN field dimensions must be set to the maximum value.
Trajectories may freely move into or out of nests with higher resolution. For a given trajectory position, FLEXTRA automatically determines the highest nesting level (with the highest resolution) available for the trajectory position to interpolate the wind velocities. The internal grid coordinates accord to the coarseresolution mother domain, whereas positions with respect to the nested domains are calculated only when needed.
At the start of a model run, FLEXTRA automatically checks whether the mother domain is global or not. If it is not global, trajectories are terminated when leaving it. In contrast, if it is global, cyclic boundary conditions are used, i.e., if a trajectory leaves the domain at the eastern boundary, it reenters the domain at the western boundary (and vice versa). Special considerations have been given to the poles. Since, in a latitude/longitude grid, the wind direction at the poles is not defined, additional fields of the horizontal wind are created. They are defined on the same latitude/longitude grid, but contain the wind components transformed to a polar stereographic projection. For the trajectory calculations, north and south of some parallel of latitude (definable by the user via parameters switchnorth and switchsouth, e.g., ±75 ^{°}), FLEXTRA switches back and forth between the latitude/longitude grid and the polar stereographic one. That means, the latitude/longitude grid remains the reference grid, but for advecting the trajectory, the polar stereographic projection grid is used intermediately. For this, the wind is transformed to the polar stereographic coordinates, but is still given at their original positions on the latitude/longitude grid. ^{1} For the coordinate transformations, the FORTRAN routines described by Taylor (1997) are used.
The polar stereographic grid has priority over nested grids. Thus, whenever a trajectory is poleward of the userdefined parallel of latitude, the polar stereographic grid is used, no matter whether nested grids are available or not.
Important parameters, variables and fields related to the wind fields:
maxnests maximum number of nested wind fields nxmax, nymax maximum field dimensions in x and y of the mother grid nxmaxn, nymaxn same as above, but for the nested grids nuvzmax,nwzmax maximum number of vertical levels for the u and v wind components, and for the w component, respectively xglobal switch, that tells whether global fields (in longitude) are available sglobal, nglobal switchs, that tell whether south (north) pole is within domain nx, ny actual field dimensions of the mother grid nxn, nyn actual field dimensions of the nested grids dx, dy grid distances (in degrees) of the mother grid dxn, dyn same as above, but for the nested grids nuvz,nwz actual number of vertical levels for the u and v wind northpolemap, southpolemap variables that define the p.s. projection xlon0, ylat0 lower left long/lat of the mother grid xlon0n, ylat0n same as above, but for the nested grids uu, vv horizontal wind components (mother grid) uupol, vvpol horizontal wind components (mother grid) projected on p.s. grid uun, vvn horizontal wind components (nested grids) ww vertical wind (mother grid) wwn vertical wind (nested grids) tt temperature (mother grid) ttn temperature (nested grids) ps surface pressure (mother grid) psn surface pressure (nested grids) oro orography (mother grid) oron orography (nested grids) akm, bkm, akz, bkz define the vertical discretization of the grid (the eta levels) wftime times of wind fields (in seconds relative to starting time) wfname filenames of the wind fields memtime same as above, but only for the three wind fields kept in memory memind pointer shuffled in memory instead of the wind fields
FLEXTRA advances time in steps of 1 second (or 1 second in backward mode) and checks at each time step for each trajectory whether an integration time step is necessary. Furthermore, it checks whether the calculation of a trajectory is completed, or whether a new trajectory is to be started.
 (3.1) 
 (3.2) 

 (3.4) 
The scheme after Pudykiewicz et al. (1985), available in previous FLEXTRA versions, is no longer supported in version 3.0.
In addition to the CFL criterion, an equivalent criterion is applied according to the time resolution of the wind fields, Dt < [(DT)/ CFLT], where DT is the time interval between two subsequent wind fields, and CFLT, selectable by the user, must be larger than 1. A reasonable value is, again, 5.
Because of the flexible time steps, the number of time steps needed to complete one trajectory calculation is not known a priori. Since FLEXTRA always keeps a trajectory in its memory until its calculation is completed, the user must take care that enough storage space is assigned to the appropriate variables. The relevant parameter is maxtime, defined in the include file includepar. Under exceptional circumstances, in order not to exceed these field dimensions, FLEXTRA allows longer time steps than determined by the above criteria. In this case, a warning message "Warning: necessary time step exceeds CFL criterion" is issued. If this does not happen too often, the message may be ignored. However, it indicates that maxtime is too small and should be increased.
The user may select one of the above two methods. The second one is termed ïdeal" in the FLEXTRA input files.
 (4.5) 
PV is computed along each trajectory and written to the output files along with the position information and potential temperature.^{4} For upperlevel trajectories, it may serve as an indicator for trajectory accuracy. However, since PV is not conserved perfectly, not even under ideal conditions, it is a very rough indicator for trajectory accuracy. Often, nonconservation of PV is simply due to diabatic effects or mixing processes.
The computation of ensemble trajectories is based on two basic ideas. First, if a trajectory is started with some distance to another one, the growth of their separation in space gives some information about their uncertainty (Merrill, 1985). Thus, if one starts an ensemble of uncertainty trajectories around a reference trajectory, the spread of the ensemble is an indicator for the accuracy of the reference trajectory. Within FLEXTRA, it is possible to specify a circle (in grid coordinates) around the starting location of a reference trajectory along which uncertainty trajectories are automatically started (a reasonable radius would be 0.5 to 2 grid units).
Second, random errors may be added along each uncertainty trajectory. These random errors should be on an order typical for the errors of the wind used to advect the trajectory (for instance, caused by interpolation). It is assumed that the errors increase with wind speed; thus, they are given relative to the wind speed. Furthermore, the relative errors follow a Gaussian distribution with the standard deviation specified by the user (reasonable values are 0.02 to 0.2, with higher values for the vertical wind than for the horizontal one). From this distribution, errors are drawn with a random number generator. The errors in the individual wind components are assumed to be independent from each other.
It can also be expected that there is some "memory" of these errors, i.e., an error in the wind at one time step is not completely independent from the error occurring during the previous time step. The user may thus specify a time period for this "memory" (i.e, a decorrelation time scale) (reasonable values 0.5 to 2). This period is scaled by the interval of the wind fields, since it may be assumed that errors in the individual wind fields are (almost) independent. Furthermore, it may be assumed that the errors in neighboring grid cells are also (almost) independent from each other. Thus, the decorrelation timescale is scaled by the time it takes a trajectory to cross one grid cell (x_{i}/v_{i}), if this time is shorter than the interval between the wind fields.
FLEXTRA facilitates the computation of an ensemble of üncertainty" trajectories in an easy way. The user must select
Then FLEXTRA calculates the appropriate uncertainty trajectories. By setting either the radius or the standard deviations of the wind errors to zero, one can calculate ensemble trajectories based exclusively on one of the two methods described above. By setting the number of the uncertainty trajectories to zero, the ensemble is switched off.
In the CET mode, trajectories are initialized on a uniform grid in a threedimensional domain as specified by the user. Because many trajectories starting at the same time are required for this, the whole FLEXTRA trajectory storage space is assigned to a single CET. It is thus not possible to calculate time sequences of CETs. Also no uncertainty trajectories can be calculated in the CET mode.
In the FLIGHT mode, the starting location and starting time can be specified for each trajectory individually. For this, a complete list of all trajectories to be calculated is needed. This mode is useful to calculate, for instance, trajectories along the flight leg of an aircraft. It may also be helpful to start trajectories at the ending points of trajectories calculated with a different (e.g., finerscale) model.
Important parameters, variables and fields related to the trajectories:
PARAMETERS: maxpoint maximum number of trajectory starting points maxtra maximum number of trajectories (>maxpoint) maxtime maximum number of (flexible) time steps along one trajectory itermax maximum number of iterations used for integration GENERAL VARIABLES: numpoint actual number of starting points numtra actual number of trajectories (currently in memory) ibdate, ibtime beginning date and time of calculation iedate, ietime ending date and time of calculation lentra desired trajectory length in seconds interv interval in seconds at which trajectories are started ideltas duration of the whole model run (seconds) itime "clock" of FLEXTRA (i.e. time in seconds) cfl, cflt cfl criteria in space and time ldirect direction of trajectories (1 forward, 1 backward) inpolkind switch between two interpolation methods modecet switch between normal and CET mode runcomment comment identifying a model run epsu, epsv, epsw relative wind errors that are assumed to occur at each time step relaxtime time constant (in units of the wind field interval) at which the above errors are relaxed VARIABLES DIRECTLY CONNECTED TO TRAJECTORIES: nttra number of time steps that are already computed npoint identification of startpoint of trajectory kind index for kind of trajectories (e.g. isobaric, 3d,..) randerroru,randerrorv, Random errors added to the trajectory during randerrorw the last time step kindz indicates the unit of the z coordinate (1: masl, 2: magl, 3: hPa) xtra,ytra,ztra spatial positions htra,ptra height in meters and in hPa ittra temporal position pottem potential temperature vorttra potential vorticity
/home/atmos1/as/flextra3.0/options/ /home/atmos1/as/flextra3.0/output/ /daten2/ecfields/2.0/ /daten2/ecfields/2.0/AVAILABLE /daten2/ecfields/1.0/ /daten2/ecfields/1.0/AVAILABLE /daten2/ecfields/0.5/ /daten2/ecfields/0.5/AVAILABLE ============================================ Line 1: path where control files "COMMAND" and "STARTPOINTS" are available Line 2: name of directory where output files are generated Line 3: path where meteorological fields are available (mother grid) Line 4: full filename of "AVAILABLE"file (mother grid) Subsequent lines: Line 2n+3: path where meteorological fields are available (nested grid n) Line 2n+4: full filename of "AVAILABLE"file (nested grid n) Line below last pathname must be: ============================================ The grids must be arranged such as that the coarsescale nests come before the finescale nests. Multiple nests of the same nesting level are allowed. In that case, the order is arbitrary.
DATE TIME FILENAME SPECIFICATIONS YYYYMMDD HHMISS ________ ______ __________ __________ 19980401 000000 EN98040100 ON DISC 19980401 060000 EN98040106 ON DISC 19980401 120000 EN98040112 ON DISC 19980401 180000 EN98040118 ON DISC 19980402 000000 EN98040200 ON DISC 19980402 060000 EN98040206 ON DISC 19980402 120000 EN98040212 ON DISC 19980402 180000 EN98040218 ON DISC 19980403 000000 EN98040300 ON DISC 19980403 060000 EN98040306 ON DISC 19980403 120000 EN98040312 ON DISC 19980403 180000 EN98040318 ON DISC 19980404 000000 EN98040400 ON DISC 19980404 060000 EN98040406 ON DISC 19980404 120000 EN98040412 ON DISC 19980404 180000 EN98040418 ON DISC 19980405 000000 EN98040500 ON DISC 19980405 060000 EN98040506 ON DISC 19980405 120000 EN98040512 ON DISC 19980405 180000 EN98040518 ON DISC 19980406 000000 EN98040600 ON DISC 19980406 060000 EN98040606 ON DISC 19980406 120000 EN98040612 ON DISC 19980406 180000 EN98040618 ON DISC 19980407 000000 EN98040700 ON DISC 19980407 060000 EN98040706 ON DISC 19980407 120000 EN98040712 ON DISC 19980407 180000 EN98040718 ON DISC 19980408 000000 EN98040800 ON DISC 19980408 060000 EN98040806 ON DISC 19980408 120000 EN98040812 ON DISC 19980408 180000 EN98040818 ON DISC 19980409 000000 EN98040900 ON DISC 19980409 060000 EN98040906 ON DISC
AVAILABLE EN98040218 EN98040500 EN98040706 a.out* EN98040300 EN98040506 EN98040712 EN98040100 EN98040306 EN98040512 EN98040718 EN98040106 EN98040312 EN98040518 EN98040800 EN98040112 EN98040318 EN98040600 EN98040806 EN98040118 EN98040400 EN98040606 EN98040812 EN98040200 EN98040406 EN98040612 EN98040818 EN98040206 EN98040412 EN98040618 EN98040900 EN98040212 EN98040418 EN98040700 EN98040906
Only the ENFiles (i.e, the wind fields) are really necessary. However, in the above example, the AVAILABLE file is stored in the same directory. The directories containing the nested wind fields have the same structure. They must contain the same number of files (valid at the same time) as the mother grid, but the filenames can be different, as indicated in the respective AVAILABLE files.
Wind fields may be available at irregular intervals. However, if the interval between two wind fields is large (in the standard configuration more than 3 hours (10800 seconds), parameter idiffnorm in file includepar), a warning message is issued. If the interval is even larger (in the standard configuration more than 6 hours, parameter idiffmax in file includepar), all trajectories that are followed in the respective time interval are stopped.
This is the form version of the COMMAND file:
******************************************************************************** * * * Input file for the trajectory model FLEXTRA: Please select your options * * * ******************************************************************************** 1. __________________________________________________ 3X, A50 Test run #1 LABEL FOR THE MODEL RUN 2. __ 3X, I2 1 DIRECTION 1 FORWARD, 1 BACKWARD TRAJECTORIES 3. _______ 3X, I7 960000 HHHMISS LENGTH OF AN INDIVIDUAL TRAJECTORY 4. ________ ______ 3X, I8, 1X, I6 19980402 180000 YYYYMMDD HHMISS BEGINNING DATE 5. ________ ______ 3X, I8, 1X, I6 19980405 120000 YYYYMMDD HHMISS ENDING DATE 6. _______ 3X, I7 0060000 HHHMISS TIME INTERVAL BETWEEN STARTING TIMES OF TRAJECTORIES 7. _ _____ 3X, I1, 2X, I5 2 03600 i SSSSS i>0: INTERPOLATED OUTPUT OF TRAJECTORY EVERY SSSSS SECONDS 8. _____ ___.___ _.___ _.___ _.___ _.___ 3X, I5, 2X, F7.3 4(2X,F5.3) 00000 000.500 2.000 0.080 0.080 0.200 NUMBER NUMBER, DISTANCE (GRID UNITS), TIME CONSTANT (WIND FIELD INTERVAL UNITS) AND INTERPOLATION ERRORS (IN U, V AND W) OF UNCERTAINTY TRAJECT. 9. _ 3X, I1 1 INTERPOLATION 1 = IDEAL INTERPOLATION >1 = LINEAR INTERPOLATION 10. . 4X, F6.4 5.0 CFL TIMESTEP CRITERION HORIZONTAL AND VERTICAL 11. . 4X, F6.4 5.0 CFLT TIMESTEP CRITERION TIME GAP BETWEEN INPUT WIND FIELDS 12.  4X, I1 1 MODE 1 NORMAL MODE, 2 CET MODE, 3 FLIGHT MODE =================================================================== 1. Comment to identify the current model run 2. Direction of trajectories (1 means forward trajectories, 1 backward) 3. Temporal lengths of the trajectories in the format HHHMISS, where HHH is HOUR, MI is MINUTE and SS is SECOND 4. Beginning date and time of trajectory calculation. Must be given in format YYYYMMDD HHMISS, where YYYY is YEAR, MM is MONTH, DD is DAY, HH is HOUR, MI is MINUTE and SS is SECOND. All times are in UTC. 5. Ending date and time of trajectory calculation. Same format as 4. 6. Time interval between two trajectory calculations. Same format as 3. 7. Options for the trajectory output: 0 = original data in irregular time intervals 1 = constant time intervals, interpolated output every SSSSS seconds 2 = 0 plus 1 8. Six parameters have to be inputted. The first is the number of uncertainty trajectories. They are starting in a distance from the starting point of the reference trajectory as given by the second parameter (in grid units). Additionally, random errors may be added at each time step of the trajectory calculation. Using a Langevin equation, they are relaxed with a time constant (in units of the wind field interval, third parameter) specified by the user. These random errors are thought to reflect typical wind errors caused, for instance, by interpolation. The magnitude of these errors (in relative units, relative to the wind velocity) must be specified by the user for the three wind components u, v and w (last three parameters). 9. Kind of interpolation 1  horizontal interpolation bicubic vertical interpolation polynomial temporal interpolation linear >1  horizontal interpolation bilinear vertical interpolation linear temporal interpolation linear 10.cfl criterion horizontal/vertical factor by which time step must be shorter than that determined from the CFL criterion, i.e. delta_t1=delta x/u/cfl delta_t2=delta y/v/cfl delta_t3=delta z/w/cfl delta_t(space) = min(delta_t1,delta_t2,delta_t3) 11. cfl criterion time factor by wich time is shorter than time interval of the wind fields delta_t(time) = delta_T(input wind)/cflt The time step used for trajectory calculation is the minimum of delta_t(space) and delta_t(time) cfl and cflt must not be less than 1! 12. 1 NORMAL mode > read file STARTPOINTS and calculate a time series of trajectories starting all from the same starting points 2 CET mode > read file STARTCET and calculate trajectories starting uniformly spaced from a userdefined domain (for a single starting time) 3 FLIGHT mode > read file STARTFLIGHT and calculate trajectories starting neither uniformly spaced nor with constant time intervals (as needed, for instance, to start trajectories along an aircraft leg)
Alternatively, the compact version of the COMMAND file looks like this:
******************************************************************************** * * * Input file for the trajectory model FLEXTRA: Please select your options * * * ******************************************************************************** 'Test run #1' LABEL FOR THE MODEL RUN 1 DIRECTION (1 FORWARD, 1 BACKWARD TRAJECT.) 960000 HHHMISS LENGTH OF AN INDIVIDUAL TRAJECTORY 19980402 180000 YYYYMMDD HHMISS BEGINNING DATE 19980405 120000 YYYYMMDD HHMISS ENDING DATE 060000 HHHMISS TIME INTERVAL BETWEEN STARTING TIMES OF TRAJECTORIES 2 3600 i SSSSS i>0: INTERPOLATED OUTPUT OF TRAJECTORY EVERY SSSSS SECONDS 0 0.5 2.0 0.08 0.08 0.20 NUMBER, DISTANCE (GRID UNITS), TIME CONSTANT (WIND FIELD INTERVAL UNITS) AND INTERPOLATION ERRORS (IN U, V AND W) OF UNCERTAINTY TRAJECT. 1 INTERPOLATION 1 = IDEAL INTERPOLATION >1 = LINEAR INTERPOLATION 5.0 CFL TIMESTEP CRITERION HORIZONTAL AND VERTICAL 5.0 CFLT TIMESTEP CRITERION TIME GAP BETWEEN INPUT WIND FIELDS 1 MODE 1 NORMAL MODE, 2 CET MODE, 3 FLIGHT MODE ==================================================================================
With the above options, the user makes a FLEXTRA run labeled "Test run #1", computing 96 hours backward trajectories starting between April 2, 18 UTC and April 5, 12 UTC, at intervals of 6 hours. ^{6} Furthermore, output files are generated for both the flexible trajectory time steps and for the constant time steps with position invormation given every 1 hour (3600 seconds). No uncertainty trajectories are calculated, ideal interpolation is used, and both CFL and CFLT are set to 5. In the last line, it is specified that normal trajectories are to be calculated. Their starting points must be given in the file STARTPOINTS. If the CET mode is selected, a file STARTCET is expected instead, specifying the starting domain of the CET. In CET mode, trajectories are started only at a single time, specified by "BEGINNING TIME". Thus, for CETs, ËNDING DATE" and "TIME INTERVAL" are ignored.
The STARTPOINTS file contains the information on starting locations and trajectory types used. For specifying the vertical starting position of a trajectory, the user has three options: height in metres above sea level (m asl), height in metres above (model) ground level (m agl), and the pressure level (hPa). Each trajectory may be of a different type. The file may contain an arbitrarily long list of starting points, the number of starting points being only limited by the parameter maxpoint, as specified in the file includepar. If too many starting points are specified, FLEXTRA issues a message and stops. The STARTPOINTS file, in the form version, contains the following information:
********************************************************************** * * * TRAJECTORY MODEL * * DEFINITION OF STARTING/ENDING POINTS * * * * The first 7 characters of the comment are also used as filenames. * * Therefore, they cannot be blank and they must be different for * * each starting point. * * * * Kind of trajectory: 1 = 3 dimensional * * 2 = on model layers * * 3 = mixing layer * * 4 = isobaric * * 5 = isentropic * * * ********************************************************************** * * * Unit of z coordinate: 1 = Meters above sea level * * 2 = Meters above ground * * 3 = Hectopascal * * * * For mixing layer trajectories (kind 3), the z coordinate must be * * given in m.a.g.l. (option 2) * * * ********************************************************************** ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 10.0 ____.____ f9.4 Longitude [DEG] 48.0 ____.____ f9.4 Latitude [DEG] 1 _ 1X,I1 Kind of trajectory (see file header) 1 _ 1X,I1, Unit of z coordinate 3000.0 _____.___ f10.3 zcoordinate (see file header) TEST1 ________________________________________ character*40 comment ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 15.0 ____.____ f9.4 Longitude [DEG] 48.0 ____.____ f9.4 Latitude [DEG] 5 _ 1X,I1 Kind of trajectory (see file header) 2 _ 1X,I1, Unit of z coordinate 2000.0 _____.___ f10.3 zcoordinate (see file header) TEST2 ________________________________________ character*40 comment ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This is the alternative compact version of the STARTPOINTS file:
********************************************************************** * * * TRAJECTORY MODEL * * DEFINITION OF STARTING/ENDING POINTS * * * * The first 7 characters of the comment are also used as filenames. * * Therefore, they cannot be blank and they must be different for * * each starting point. * * * * Kind of trajectory: 1 = 3 dimensional * * 2 = on model layers * * 3 = mixing layer * * 4 = isobaric * * 5 = isentropic * * * ********************************************************************** * * * Unit of z coordinate: 1 = Meters above sea level * * 2 = Meters above ground * * 3 = Hectopascal * * * * For mixing layer trajectories (kind 3), the z coordinate must be * * given in m.a.g.l. (option 2) * * * ********************************************************************** ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 10.0 F Longitude [DEG] 48.0 F Latitude [DEG] 1 I Kind of trajectory (see file header) 1 I Unit of z coordinate 3000.0 F zcoordinate (see file header) 'TEST1' A Name of starting point ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 15.0 F Longitude [DEG] 48.0 F Latitude [DEG] 5 I Kind of trajectory (see file header) 2 I Unit of z coordinate 2000.0 F zcoordinate (see file header) 'TEST2' A Name of starting point ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
In both of the above files, two starting locations are specified, at (10 ^{°}E, 48 ^{°}N) and at (15 ^{°}W, 48 ^{°}N). From the first location, threedimensional trajectories are starting at a height of 3000 m asl. From the second location, isentropic trajectories are starting at 2000 m agl. The names of the starting locations are TEST1 and TEST2. These names are also used for the filenames of the output files.
If the CET mode is selected in the COMMAND file, a file STARTCET must be in the options directory instead of the STARTPOINTS file. This file defines the starting domain by its lower left and upper right coordinates, and the resolution of the starting grid superimposed on this domain. All trajectories of a CET are of the same type. This is the form version of STARTCET:
********************************************************************** * * * TRAJECTORY MODEL * * DEFINITION OF THE CET DOMAIN * * A CET STARTING DOMAIN IS DEFINED BY THE LOWER LEFT AND UPPER RIGHT* * CORNER IN A LATITUDE/LONGITUDE COORDINATE SYSTEM, AND BY A LOWER * * AND UPPER LEVEL. TRAJECTORIES ARE STARTED AT DISTANCES DX, DY AND * * DZ WITHIN THIS DOMAIN. * * * * Kind of trajectory: 1 = 3 dimensional * * 2 = on model layers * * 3 = not allowed in CET mode * * 4 = isobaric * * 5 = isentropic * * * ********************************************************************** * * * Unit of z coordinate: 1 = Meters above sea level * * 2 = Meters above ground * * 3 = Hectopascal * * * * The vertical distance DZ between the trajectories must be * * given in the same units. * * * ********************************************************************** ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 10.0 ____.____ f9.4 Lower left longitude [DEG] 48.0 ____.____ f9.4 Lower left latitude [DEG] 15.0 ____.____ f9.4 Upper right longitude [DEG] 50.0 ____.____ f9.4 Upper right latitude [DEG] 0.5 ____.____ f9.4 DX: Longitudinal distance between trajectories [DEG] 0.5 ____.____ f9.4 DY: Latitudinal distance between trajectories [DEG] 1 _ 1X,I1 Kind of trajectory (see file header) 1 _ 1X,I1, Unit of z coordinate 2000.0 _____.___ f10.3 Lower zcoordinate (see file header) 3000.0 _____.___ f10.3 Upper zcoordinate (see file header) 500.0 _____.___ f10.3 DZ: Vertical interval of trajectories (see file header) TEST ________________________________________ character*40 comment ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
And this is the compact version of STARTCET:
********************************************************************** * * * TRAJECTORY MODEL * * DEFINITION OF THE CET DOMAIN * * A CET STARTING DOMAIN IS DEFINED BY THE LOWER LEFT AND UPPER RIGHT* * CORNER IN A LATITUDE/LONGITUDE COORDINATE SYSTEM, AND BY A LOWER * * AND UPPER LEVEL. TRAJECTORIES ARE STARTED AT DISTANCES DX, DY AND * * DZ WITHIN THIS DOMAIN. * * * * Kind of trajectory: 1 = 3 dimensional * * 2 = on model layers * * 3 = not allowed in CET mode * * 4 = isobaric * * 5 = isentropic * * * ********************************************************************** * * * Unit of z coordinate: 1 = Meters above sea level * * 2 = Meters above ground * * 3 = Hectopascal * * * * The vertical distance DZ between the trajectories must be * * given in the same units. * * * ********************************************************************** ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 10.0 F Lower left longitude [DEG] 48.0 F Lower left latitude [DEG] 15.0 F Upper right longitude [DEG] 50.0 F Upper right latitude [DEG] 0.5 F DX: Longitudinal distance between trajectories [DEG] 0.5 F DY: Latitudinal distance between trajectories [DEG] 1 I Kind of trajectory (see file header) 1 I Unit of z coordinate 2000.0 F Lower zcoordinate (see file header) 3000.0 F Upper zcoordinate (see file header) 500.0 F DZ: Vertical interval of trajectories (see file header) 'TEST' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
If the FLIGHT mode is selected in the COMMAND file, a file STARTFLIGHT must be in the options directory instead of the STARTPOINTS file. This file provides a list of trajectory starting points, to be strictly in temporal order (reverse temporal order for backward trajectories). The trajectory type and the unit of the vertical coordinate is the same for all trajectories, but both starting times and coordinates may be different for all trajectories. Her is an example of this file:
********************************************************************** * TRAJECTORY MODEL * * DEFINITION OF STARTING/ENDING POINTS IN FLIGHT MODE * * This file defines starting points separated nonuniformly in * * space as well as in time. Thus, both starting times AND starting * * coordinates must be given. * * The starting times must be strictly in temporal order. * * For backward trajectories, the temporal order must be reversed. * * In line #28 of this file, the name of the output file must be * * indicated. Lines #29 and #30 must contain kind of trajectory and * * the unit of the z coordinate to be used. Line #31 is arbitrary, * * then follows a sequence of points. * * Kind of trajectory: 1 = 3 dimensional * * 2 = on model layers * * 3 = mixing layer * * 4 = isobaric * * 5 = isentropic * ********************************************************************** * * * Unit of z coordinate: 1 = Meters above sea level * * 2 = Meters above ground * * 3 = Hectopascal * * * * For mixing layer trajectories (kind 3), the z coordinate must be * * given in m.a.g.l. (option 2) * * * ********************************************************************** 'Flight#7' 1 I Kind of trajectory (see file header) 1 I Unit of z coordinate ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 19980404 000000 2I Starting date and time 34.0 F Longitude [DEG] 72.0 F Latitude [DEG] 1000.0 F zcoordinate (see file header) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 19980404 140000 2I Starting date and time 15.0 F Longitude [DEG] 48.0 F Latitude [DEG] 2000.0 F zcoordinate (see file header) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 19980405 130000 2I Starting date and time 10.0 F Longitude [DEG] 48.0 F Latitude [DEG] 3500.0 F zcoordinate (see file header) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 19980406 130000 2I Starting date and time 10.0 F Longitude [DEG] 48.0 F Latitude [DEG] 3000.0 F zcoordinate (see file header) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
An example TI_name file may look like this:
********************************************************************* * * * FLEXTRA MODEL OUTPUT * * FOR ECMWF WINDFIELDS * * * ********************************************************************* * * * TIME OF COMPUTATION: 19990114 14:22:23.2 * * * ********************************************************************* * * * TYPE OF TRAJECTORIES: ISENTROPIC * * * ********************************************************************* * * * INTEGRATION SCHEME: PETTERSSEN * * INTEPOLATION METHOD: IDEAL * * * * SPATIAL CFL CRITERION: 5.00 * * TEMPORAL CFL CRITERION: 5.00 * * * ********************************************************************* * * * START POINT COMMENT: TEST * * MODEL RUN COMMENT: Test run #1 * * * ********************************************************************* DATE: 19980402 TIME: 180000 STOP INDEX: 1 # OF POINTS: 9 SECS LONGIT LATIT ETA PRESS Z ZORO PV THETA 0 10.0000 48.0000 .7809 772.4 2001. 2000. .556 288.4 10800 13.8437 46.8852 .7797 770.1 2010. 2010. .576 288.7 21600 18.0137 46.1880 .7539 746.1 2271. 2271. .514 288.5 32400 22.2734 46.0866 .7454 738.7 2352. 2352. .586 288.6 43200 26.1761 46.3039 .7060 701.1 2760. 2760. .668 288.8 54000 29.4075 46.6924 .6882 685.6 2950. 2950. .761 289.3 64800 32.0994 47.0156 .6683 666.8 3166. 3166. .745 289.4 75600 34.7240 47.2701 .6693 668.1 3150. 3150. .864 289.9 86400 37.5549 47.5151 .6511 650.5 3338. 3337. 1.160 291.0 DATE: 19980403 TIME: 180000 STOP INDEX: 1 # OF POINTS: 9 SECS LONGIT LATIT ETA PRESS Z ZORO PV THETA 0 10.0000 48.0000 .7804 765.3 2001. 2000. .849 289.1 10800 13.0518 48.4605 .7796 760.8 2004. 2003. .837 288.9 21600 15.2082 49.7889 .7599 741.2 2198. 2198. .830 289.1 32400 15.6836 51.3854 .7606 739.2 2186. 2187. .856 288.6 43200 14.3157 52.5602 .7614 738.5 2175. 2175. .953 288.9 54000 12.2525 52.9209 .7630 742.0 2160. 2159. .991 289.1 64800 10.8281 52.5667 .7489 729.8 2310. 2302. .940 288.7 75600 10.2955 51.5967 .7604 739.8 2221. 2190. .847 288.3 86400 11.2324 50.3553 .7322 716.9 2485. 2485. .668 289.0
The file header gives the relevant information concerning trajectory type, interpolation method, comments, etc. The time of computation is only available if the system call in routine openoutput.f is enabled. Following the header is a time sequence of trajectories. In the first line, general information about the trajectory is given: starting date and time, an index which gives information why a trajectory was stopped (normally 1, 2 if the trajectory left the computation domain, 3 if time difference between two wind fields was too large, 4 if no wind fields were available) and the number of positions available. The second line contains subheader information. This is followed by the required number of lines, each containing: the travel time of the trajectory in seconds (negative for backward trajectories), the longitude and latitude, and the vertical position given in h, pressure and Cartesian (in m asl and m agl) coordinates, PV and potential temperature.
The filenames containing uncertainty trajectories follow this syntax: TI_name_Unumber, where number is a fourdigit number. Uncertainty trajectories are numbered consecutively. An example file name may be TI_TEST1_U0001. The same syntax is used for uncertainty trajectories with flexible time steps (e.g. T_TEST1_U0001). They contain the same information except that the positions are given at irregular intervals.
The structure of the CET_name, CETI_name, FLIGHT_name and FLIGHTI_name files is the same, except that the files contain the information of all starting points, but only for one starting time (for the CET files) or at varying intervals (for the FLIGHT files).
____________________________________________________________________ caldate.f compute calendar date from julian date checklimits.f Check, if the user specifications exceed dimensional settings cmapf1.0.f Program package for coordinate transformations between latitude/longitude grid and polar stereographic projection coordtrafo.f transformation of trajectory starting points to grid coordinates eta.ecmwf.f computes eta coordinate for a given air pressure etatrafo.f transformation from zcoordinate in metres to eta coordinate FLEXTRA.f main program geteta.f calculates eta for a given potential temperature getfields.f management of windfields, calls readwind when needed getheight.f calculates height of trajectories in metres and hPa getpv.f calculates potential vorticity at trajectory position getwind.f according to trajectory type, calls the appropriate interpolation routines and wind retrieval procedure gridcheck.f checks the wind field domain available and establishes the computation grid gridcheck_nests.f same as above, but for nested wind fields includecom includefile containing globally used variables includepar includefile containing globally used parameters: this is were you can change field dimensions and other important parameters inter3d.f manages interpolation of wind data for 3d trajectories interisentrop.f manages interpolation of wind data for isentropic trajectories interisobar.f manages interpolation of wind data for isobaric trajectories intermix.f manages interpolation of wind data for mixing layer trajectories intermod.f manages interpolation of wind data for model layer trajectories interpol.f ideal interpolation of fields to a trajectory point in space and time interpol_nests.f same as above, but for nested wind fields juldate.f compute julian date from calendar date lamphi.ecmwf.f transformation from ECMWF coordinates to geographical coordinates lastprocessor.f reverses the trajectory output files for backward trajectories levinterpol.f ideal interpolation of fields to a point on a layer and in time levinterpol_nests.f same as above, but for nested wind fields levlininterpol.f linear interpolation of fields to a point on a layer and in time levlininterpol_nests.f same as above, but for nested wind fields lininterpol.f linear interpolation of fields to a trajectory point in space and time lininterpol_nests.f same as above, but for nested wind fields numerical.f modified interpolation procedures taken from Press et al. opencetoutput.f opens the output files for the CET output openflightoutput.f opens the output files for the CET output openoutput.f opens the output files for the trajectory output orolininterpol.f linear interpolation of the topography to a given point orolininterpol_nests.f same as above, but for nested wind fields petters.f petterssen scheme for trajectory integration potlininterpol.f linear interpolation of potential temperature to a point in space and time pp.ecmwf.f calculates the pressure as a function of eta pvinterpol.f Interpolation of potential vorticity on a small subgrid readavailable.f read, which wind fields are available within the modelling period readcet.f read CET definitions (domain, etc.) from file STARTCET readcommand.f read user commands, e.g. start times of trajectories readflight.f read FLIGHT definitions (i.e. a list of starting times AND starting locations) from file STARTFLIGHT readoro.f read ECMWF model orography from file OROGRAPHY readpaths.f read pathnames, where input/output files are stored readpoints.f read trajectory starting/ending points from file STARTPOINTS readwind.f reads the wind fields, temperature fields and surface pressure from data files readwind_nests.f same as above, but for nested wind fields skplin.f skips a number of lines in a given file subtractoro.f subtraction of ECMWF orography from trajectory starting/ending point height timemanager.f manages the temporal scheme of the computation and checks wich trajectories are to be held in memory trajinterpol.f interpolation of flexible trajectory time step to constant one trajout.f writes trajectories to output file uncertcoor.f determines the starting points for the uncertainty trajectories utransform.f transformation of u [m/s] to dx/dt [grid units/s] vtransform.f transformation of v [m/s] to dy/dt [grid units/s] wtransform.f transformation of w [m/s] to dz/dt [units/s] zztrafo.f calculation of geometric height above model orography as a function of eta, temperature and pressure
This is a flux diagram of the source code:
****************************************************************************** * FLEXTRA model structure * ****************************************************************************** FLEXTRA > readpaths > readcommand > skplin > juldate > readavailable > juldate > gridcheck > GRIB DECODING CALLS > POLAR STEREOGRAPHIC PROJECTION CALLS > gridcheck_nests > GRIB DECODING CALLS (> readoro) > readpoints > skplin > readcet > skplin > readflight > skplin > checklimits > coordtrafo > uncertcoor > subtractoro > orolininterpol > orolininterpoln > openoutput > (date and time system call) > opencetoutput > (date and time system call) > openflightoutput > (date and time system call) > timemanager > trajout > orolininterpol > orolininterpoln > lamphi_ecmwf > trajinterpol > caldate > coordtrafo > subtractoro > petters > getwind > getfields > readwind > readwind_nests > inter3d   > intermod   > intermix   > interisobar   > interisentrop > utransform > vtransform > POLAR STEREOGRAPHIC PROJECTION CALLS > gasdev > ran1 > getheight > levlininterpol > levlininterpoln > pp > zztrafo >levlininterpoln >levlininterpol > getpv > pvinterpol > lastprocessor ______________________________________________________________________________  > levlininterpoln  > levlininterpol   > etatrafo > levlininterpol   > pp   > eta   > potlininterpoln  > potlininterpol   > geteta > levlininterpoln  > levlininterpol   > interpol > bicubic > bcucof  > polynom   lininterpol  levinterpol > bicubic > bcucof  > polynom  levlininterpol  interpoln > bicubic > bcucof  > polynom  lininterpoln  levinterpoln > bicubic > bcucof  > polynom  levlininterpoln   > wtransform (only inter3d) ______________________________________________________________________________
^{1} Actually, the wind is transformed for (almost) the whole grid immediately after having been read in.
^{2} In contrast to Eulerian models, the CFL criterion is not needed for stability, but it ensures optimum use of the available wind information.
^{3} Trajectory types differ in their treatment of the vertical wind component and coordinate system.
^{4} Potential temperature and potential vorticity are always taken from the coarseresolution mother grid.
^{5} If a trajectory is terminated before its nominal end, for instance because it leaves the computational domain, it is kept in memory until its nominal completion (in the above example, 96 hours). This is done in order to have the trajectories sorted (in the output files) according to their starting time.
^{6} Actually, for backward trajectories, the whole computation is reversed in time, i.e. it starts on April 5, 12 UTC and proceeds toward April 2, 18 UTC.