Zgurasti Ice Cave, Romania
Reading Offline Trajectory Code (ROTRAJ)
Author: John Methven , University of Reading
Version 1 - 1995
Version 3 - 07/04/2000
Latest version 3 with ERA5 updates: 17/03/2021
University of Reading

ROTRAJ is a code to calculate air mass trajectories using input data from global models or analyses. The trajectories are 3-D, following the full flow resolved in the model and can be calculated forwards or backwards in time. The input data is expected at regular time intervals with a separate file for each time (as is typical for re-analysis data). Primarily this tool has been used with model data from the ECMWF, including re-analyses, operational analyses and forecasts. The input data can be spectral harmonics (on model levels) or gridded (model or pressure levels), although in specific formats. The current version works with ECMWF or Reading IGCM data. Some code editing would be required to set it working with other global gridded data. The code is written in FORTRAN and linking with the ECCODES (or predecessor GRIB_API) library is required to read the GRIB format used for ECMWF global data.

References for the code itself and papers establishing its accuracy

The primary reference for the code.
UK Universities Global Atmospheric Modelling Project (UGAMP) Technical Report 44: UGAMP_tech44.pdf

Methven, J. (1997) Offline trajectories: Calculation and accuracy. Tech. Report 44, 18pp., U.K. Univ. Global Atmos. Modelling Programme, Dept. of Meteorol., Univ. of Reading, Reading, U.K.

Please cite this paper if you use the code to examine individual back trajectories and their origins (e.g., in atmospheric chemistry studies):
Methven, J., Evans, M., Simmonds, P. and Spain, G. (2001) Estimating relationships between air-mass origin and chemical composition. J. Geophys. Res., 106, 5005-5019, doi:10.1029/2000JD900694.

Please cite this paper if you use the code to calculate domain filling trajectories to examine atmospheric structure in terms of composition or weather systems:
Methven, J., Arnold, S.R., O'Connor, F.M., Barjat, H., Dewey, K., Kent, J., Brough, N. (2003) Estimating photochemically produced ozone throughout a domain using flight data and a Lagrangian model. J. Geophys. Res., 108(D9), 4271, doi:10.1029/2002JD002955.

See also John Methven publications on University of Reading repository for examples of papers using ROTRAJ in diverse applications.

Below are some brief guides on how to use the ROTRAJ code.
Please email me if you intend to use this trajectory code in your research and also notify me of any publications that incorporate results from this trajectory model. Please cite the code, as indicated above.

Follow this link to the code and some sample ERA5 data to test it on. Also some trajectory visualisation software written in IDL (language).

user_guide3_2001.pdf

A minimalist guide to using the code which describes the parameters of the model (changed before compilation) and the variables which can be changed after compilation through the use of FORTRAN NAMELISTs in the jobdecks. It was written in 2001 so the details about the filepaths for the code, jobdecks and programme library at CSAR, a decomissioned supercomputing facility in Manchester, are out of date.

codebase directory contains:

rotraj3_era5_rdf.job
A sample UNIX jobdeck which puts the program together using the "nupdate" function, creates the NAMELISTs, compiles the program and then executes it. The nupdate function pulls together subroutines from a program library and applies some modifications by editting various lines. This is a good way to maintain the programme because the programme library remains fixed for all users (at version 3) and any user modifications or bug fixes are incorporated by nupdate. Otherwise use the jobdeck below.

rotraj3_nonup_test.job
A sample UNIX jobdeck which specifies filepaths, creates the NAMELISTs, compiles the program "rotraj3_era5_small.f" and executes it. You will need to change the filepaths and FORTRAN compilation line to be appropriate for your computer system.

rotraj3_era5_small.f
The FORTRAN source code which was put together by nupdate. It includes the latest standard updates including bug fixes and reading ERA5 data using the GRIB_API library.

rotraj3_nonup_rdf.job
A sample UNIX jobdeck which specifies filepaths, creates the NAMELISTs, compiles the program "rotraj3_era5_rdf3d.f" and executes it. This job calculates 53792 back trajectories from 3D grid (41 x 41 x 32) which is the only difference from the test job which only calculates 50 back trajectories.

visualisation is a directory containing IDL code for plotting simple trajectory outputs and also reverse domain filling trajectory calculations.

rdfplanner.pro uses IDL widgets to bring up a GUI window controlling plotting of reverse domain filling (or forwards domain filling) trajectory sets. This includes plotting maps on pressure and isentropic surfaces, as well as great circle cross-sections and the nearest set of trajectories from any point.

rdfplanner_guide.pdf

trajplot.pro
An IDL program to plot trajectories contained in one trajectory file. All you need to do is to edit the file and at the beginning of the main program set lcomputer=1 for running on a PC (Windows) or lcomputer=0 for running on a UNIX computer. Then start up IDL and enter: .run trajplot

Answer the questions and then a window should appear. You can plot trajectories on a map using the `traj' button or draw any two variables against each other using the `x vs y' button (for example height versus time along trajectory). You can change the variables on the x and y axes using the drop down menus on the top row of buttons.

You can change the limits of the map by editting the four values on the second row down corresponding to: min(latitude), min(longitude), max(latitude), max(longitude).

You can change the x-axis using the first two values on the third row. The first number refers to the starting value for the axis and the second number corresponds approximately to the range/30. Finally you can also select different colour scales and reverse them if desired.

rdftread.pro
An IDL procedure (function) that reads the trajectory data files. You can edit this to select filepaths for the location of trajectory data on your computer. Different values of IDATA can be used to specify different directories. The default (IDATA=1) expects the trajectory data to be in the current directory.

utraj-rf_uki2016100500
A sample RDF3D (reverse domain filling in 3-D) trajectory file output by executing "rotraj3_rdf_sample.job". In this example the trajectories are 1 day long. The trajectories are integrated backwards in time from the "release date" 00UTC 5 October 2016 from a 41 x 41 x 32 release grid centred over the UK and Ireland.

utraj-rf_rdg2016100500
A sample trajectory file output by executing "rotraj3_rdf_nonup_eg.job". In this example the trajectories are 1 day long. The trajectories are integrated backwards in time from the "release date" 00UTC 5 October 2016 from the 250 and 850 hPa levels on a small 5 x 5 grid of points near Reading.

ERA5_datafiles is a directory containing one day of sample ERA5 global data at 6 hourly intervals (one file per record).

siuaYYYYMMDDHH
The spectral analyses on ECMWF model eta-levels at T255L137 resolution (full model level set for ERA5 but reduced spectral trunction relative to the native T639 used for ERA5) for one time: year YYYY, month MM, day DD, hour HH (UTC). These are read and used by the ROTRAJ trajectory code as the calculation proceeds. Look in "user_guide3_2001.pdf" for ways in which you could use other input data to drive the trajectory model.

giuaYYYYMMDDHH
Note that if you request specific humidity as a trajectory attribute then you will also need the ECMWF giuaYYYYMMDDHH data files (since q is always a grid-point field in the current ECMWF analysis system). Here this is stored on the F128 grid (full Gaussian grid with 128 latitudes between pole and equator) which is consistent "linear grid" for T255 spectral truncation. Note that ROTRAJ requires data on the full Gaussian grid if running with spectral prognostic variable data. If running with gridded prognostic variable data, then all variables need to be on the same global grid (Gaussian or regular lat-lon is expected).

sfamYYYYMMDDHH
You can request certain single level "surface" fields as trajectory attributes but you will also need the ECMWF sfamYYYYMMDDHH data files. Here a single field, boundary layer height, is stored on the F128 grid.


Dr. John Methven,
Department of Meteorology,

University of Reading,
Earley Gate, Reading, RG6 6ET, UK.
Tel: +44 (0) 118 378 6015
Questions to J.Methven@reading.ac.uk