AtmoData 1.4 - user's guide version 1
Introduction
AtmoData is a C++ library mainly written by Vivien Mallet at the Ecole des Ponts ParisTech (ENPC), in CEREA, a joint ENPC / EDF R&D laboratory. AtmoData provides parameterizations for atmospheric sciences, in particular for air quality. Contributions to increase the number and the quality of parameterizations are welcome.
Requirements
AtmoData is based on SeldonData (see http://spacetown.free.fr/lib/seldondata/). AtmoData and SeldonData have the same requirements. Install SeldonData and AtmoData will work with it.
Design
AtmoData is mainly a set of functions. Its functions provide
parameterizations. There are also a few classes for coordinates transformations
and to read MM5 files (FormatMM5
).
AtmoData functions take Data
instances as
input. Data
is a convenient class provided by SeldonData. Refer
to SeldonData user's guide for details about Data
.
All AtmoData functions are described in the documentation. The following example explains the way those functions should be used.
Example
// Includes SeldonData and sets the debug level.
// Refer to SeldonData documentation for details/
#define SELDONDATA_DEBUG_LEVEL_4
#include "AtmoData.hxx"
using namespace AtmoData;
int main()
{
TRY;
Data<double, 3> Temperature(2, 2, 2), Pressure(2, 2, 2),
PotentialTemperature(2, 2, 2);
// Fills Temperature and Pressure with fictitious data.
Temperature.Fill(280.0);
Pressure.Fill(90000.0);
ComputePotentialTemperature(Temperature, Pressure, PotentialTemperature);
// One may set the reference pressure to 100000.
ComputePotentialTemperature(Temperature, Pressure, PotentialTemperature, 100000.);
END;
return 0;
}
The makefile:
CC = g++
# Put the paths to Blitz++, Talos, SeldonData and AtmoData.
INCPATH = -I/home/vivien/codes/MyBlitz++-0.7 \
-I/home/vivien/codes/Talos-0.3 \
-I/home/vivien/codes/SeldonData-1.4 \
-I/home/vivien/codes/AtmoData
LINK = g++
TARGETS = example
all: $(TARGETS)
$(TARGETS): % : %.o
$(LINK) -o $@ $<
%.o : %.cpp
$(CC) $(INCPATH) -c -o $@ $<
clean:
rm -f $(TARGETS) $(TARGETS:%=%.o)
ComputePotentialTemperature
is a basic function that computes
the potential temperature from the temperature and the pressure. Obviously the
use of AtmoData is easy, even with more complex functions. There are only a
few points to know:
- The argument list starts with input arguments and ends with output
arguments. In example.cpp,
Temperature
andPressure
are input arguments ofComputePotentialTemperature
and the last argument,PotentialTemperature
, is the output argument. - All functions and their arguments are described in the documentation (section "Namespace Members").
- Arguments are mainly
Data
instances. Usually, those instances are assumed to be defined on the same grids. In example.cpp,Temperature
,Pressure
andPotentialTemperature
are defined on the same three-dimensional grid.