Contact: zeng  @  zegraph.com      Last update: 10 May 2011

METEX Library

METEX is a program I developed at the Centre for Global Environmental Research, Japan, for calculating air trajectory using several meteorological datasets.

Function Parameter Type Remark
metex(path,hour) string, integer Creates and returns a METEX object. The path must be the diretory name where data reside and the hour must be the time resolution of meteorological fields in the data..
.add(x, y, z[, flag]) numbers, boolean Adds a particle to METEX with the given longitude (deg-E), latitude (deg-N), and height (meter). If the optional flag is true, the height refers to the surface; otherwise to the mean sea level.
.callback(fname) string Sets a callback function to handle output. The function will be called with a string.
.clear()   Clears all particles in a METEX object.
.isentropic(flag) boolean Uses isentropic model (flag=true) or kinematic model (flag=false). The default is kinematic.
.nest(object) user Set netsed modelling. The object must be a METEX object that uses a global dataset and the caller uses a regional dataset.
.output(fname) string Set the file for saving results.
.start(mode, length, count, interval) integers Starts trajectory calculation in forward (mode>1) or backward (mode < 0) mode. The trajectory length is in hour; the count controls the number of times to run METEX; and the interval controls the next initialization time (current date and time plus hours of interval).
.utc(yy, mm, dd, hh[, mi]) integers Sets initial year, month, day, hour, and minute.
.vname(oname, nname[, oname, nname...]) strings Sets input variable name, i.e., replacing the old name oname by the new name nname. Note: if an oname does not exist, all avaibale onames will be shown.

Example

// Load METEX library
load("metex.dll");

// Create object
mx = metex("d:/data/",6);

// Uncomment the following line to use isentropic model
//mx.isentropic(true);

// Specify the file for saving results
mx.output("trajectory.csv");

// Initialize year, month, day, and hour
mx.utc(2006, 7, 4, 3);

// Add a starting position (x-y-z or longitude-latitude-height) for a parcel.
// You can add as many parcels as you want.
mx.add(135, 30, 500);

// start calculation
mx.start(-1, 72, 1, 24);