This site contains a collection of Matlab scripts for environmental, atmospheric chemistry, BVOC emission modeling and micrometeorological problems.
(a) Scripts for eddy covariance and disjunct eddy covariance (DEC) flux calculations can be found here.
(b) These are basic scripts for wavelet analysis. Test data to calculate DEC fluxes collected on the NCAR HQ-C130 during the Mirage field project are provided. To test load loadwavelet.mat and run the script wavecrosmirage.m. More information on wavelet analysis can be found here. Information on this particular dataset is published by Karl et al., ACP, 2009. The original scripts were written by Torrence and Compo.
(c) These scripts calculate the source/sink distribution within a forest canopy from measured in-canopy concentration profiles based on the Inverse Lagrangian Transport (ILT) concept published by Raupach, Agr. For. Met., 1989. The ILT accounts for in-homogenous dispersion within the canopy (simple K-theory does not apply here) and splits the dispersion into a near (=non-diffusive) and far (=diffusive) field term. The result is a dispersion matrix D, that relates the source / sink distribution to the concentration gradient C according to: C = D x S. Technical note: In this script the number of source layers (sh) needs to be smaller than the number of concentration layers (zc). If the number of source layers is too small (e.g. 1-3), the calculated flux might be underestimated. For a concentration vector of size 10, I usually choose a source vector (sh) of size 4-7.
(d) Calculate approximate height of the planetary boundary layer (PBL) according to LCL (lifting condensation level: lcl.m). The routine calculates the LCL, which should coincide with the lowest level of a cumulus humilis cloud deck. During clear sky conditions this should be close to the PBL height. Additional scripts to calculate CAPE, CINE and plot a skew-T diagram based on radiosonde data can be downloaded here (; these scripts were translated and partially adapted from a public fortran code.
(e) Simple random walk model (randomwalkx.m) to illustrate the flux footprint concept. The model is mostly suitable for educational purposes. Takes about 40 s to run on Windows XP (Intel Duo Core, 2GHz). More information on flux footprints can be found here. The routine releases 1000 particles at four different locations (blue, red, yellow and green) along the x axis and lets them disperse / diffuse as they are transported by the horizontal wind. The script randomcount.m can be used to select an area on the plot and calculate the relative distribution of blue, red, yellow and green particles.
(f) The script (horst.m) calculates a differential and cumulative flux footprint according to Horst and Weil, BLM, 1992. The script also calculates the differential footprint as a function of stability class expressed as Obhukov length scale (L). You can download the package (horst.m; horst1.m; horst2.m; footp1.m) here. To run start horst.m. All calculations are done by the main routine (horst1.m) which uses the footprint function footp1.m.
(g) The function vdepRC.m calculates the canopy resistance (RC) according to Wesely, Parameterization of surface resistances to gaseous dry deposition in regional-scale numerical models, Atmospheric Environment 41 (2007) S52 - S63, 1989. A GUI interface is provided (canresistance.m and canresistance.fig). Unzip all files in the same directory and start the GUI by typing canresistance in the matlab command line. (files added 10/2009)
(h) BVOC Emission Modeling: meganwrapper.m is a function that combines a radiative transfer (CanopyRadopt.m) and an energy balance (CanopyEBopt.m) routine with a BVOC emission routine (meganall.m). The GUI meganguihist.m can be used to explore isoprene emissions as a function of different environmental and ecosystem parameters. Unzip all files in one directory and type meganguihist in the matlab command line. A description of the emission algorithms can be found in Guenther et al., Estimates of global terrestrial isoprene emissions using MEGAN (Model of Emissions of Gases and Aerosols from Nature), Atmos. Chem. Phys., 6, 3181 - 3210, 2006. (files added 10/2009; updated 03/2010).
Other useful routines (mostly 3rd party scripts found on the web - follow instructions and stipulations as outlined in each script)
(a) Positive Matrix Factorization tools.
(b) Calculate sensitivity of a differential equation system
(c) HDF tools
(d) NetCDF tools
(e) Non-linear peak fitting script ipf.m.
(a) Simple routine (isotopen.m) that calculates isotopic distribution (run using isotopen.m).
(b) Calculate longitudinal and lateral diffusion in SIFDT instrument (setup and run with runsifdt.m).
 last updated 08/2014
Tom Karl tomkarl Thomas Karl
Instrumentation - Mass Spectrometry
Please acknowledge by citing Karl, T., A. Guenther, R. J. Yokelson, J. Greenberg, M. Potosnak, D. R. Blake, and P. Artaxo, 2007: The tropical forest and fire emissions experiment: Emission, chemistry, and transport of biogenic volatile organic compounds in the lower atmosphere over Amazonia, J. Geophys. Res., 112, D18302, doi:10.1029/2007JD008539 in any publication using these scripts.
Please acknowledge by citing  Karl, T., Apel, E., Hodzic, A., Riemer, D.,

Blake, D., and C. Wiedinmyer, 2009: Emissions of volatile organic

compounds inferred from airborne flux measurements over a megacity.

Atmos. Chem. Phys., 9, 271-285 and Torrence, C. and Compo, G. P.: A practical guide to wavelet analysis, B. Am. Meteorol. Soc., 79, 61-78, 1998

in any publication using these scripts.

Please acknowledge by citing Karl, T., Guenther, A., Turnipseed, A., Patton, E.G., and K. Jardine, 2008: Chemical sensing of plant stress at the ecosystem scale, Biogeosciences, 5, 1287-1294 and Karl, T., Potosnak, M., Guenther, A., Clark, D., Walker, J., Herrick, J.D. and C. Geron, 2004: Exchange Processes of Volatile Organic Compounds above a Tropical Rainforest - Implications for Modeling Tropospheric Chemistry above Dense Vegetation, J. Geophys. Res., 109, D18306, 10.1029/2004JD004738 in any publication using these scripts.
Atmospheric Chemistry (in preparation 01/2012)
(a) Simple chemical boxmodel
(b) MOZART Chemistry Mechanism v4. Scripts can be used to run as diluting box model including emission, deposition and chemistry. As a simple test, run using runmozartcarbon.m. The script will calculate the carbon balance and reactivity for isoprene as a function of photochemical age. (
(c) Sequential reaction model: compare initial isoprene oxidation products in different mechanisms
Biosphere-Atmosphere Exchange / Micrometerology
(d) Sequential reaction model: new mechanism for inital oxidation of isoprene 
(c) TofTools: a data analysis GUI for analysing and extracting PTR-TOF-MS data (documentation)
Diese Seiten werden auf einem Server der Universitaet Innsbruck gehostet und unterstehen diesen Richtlinien.