Applications Programming in /AppMod

Data Generation Applications
----------------------------

The applications:

relhum.cc
totrain.cc

belong to a group called DataGen. They derive some meteorological
parameter from other parameters retrieved from Mars. Basically
they prepare a Mars request, send it to mars service, process
the data retrieved from Mars and send back a GRIB command.
They are based on functions that may be found in file Util/DataGen.cc.
These functions hide most of the common work necessary to this
application group.
These applications have the following basic structure :

void main(int argc,char **argv)
{
        InitDataGen (argc, argv, "totrain", "TOTRAIN");
}

void PrepareRequest (request *mars)
{
...
}

int ExecuteRequest (request *orig, request *mars)
{
...
}

- InitDataGen creates the service and register a callback for the
associated command.

- PrepareRequest is specific for each application and must prepare
the suitable Mars request. The incoming request "mars" is a RETRIEVE
command that contains the values defined by the user in GenApp or
in a macro.
If the application needs the parameter LNSP, function AskLNSP is
provided for the insertion of Mars parameters in request "mars".

- ExecuteRequest is also specific for each application and must
process the data retrieved from Mars and write the result into
a given file.
Request "orig" contains the original request received by the
application. A parameter PATH was included in this command and
contains the name of the temporary file where the result must
be written.
Request "mars" is a list of requests, where the first request
contains the request returned by Mars and the other requests
contain the description of each field, one field per request.


Data Visualisation Applications
-------------------------------

The applications:

xsect.cc
average.cc
vertprof.cc

belong to a group called DataVis. They process fields defined by the
subrequest contained in DATA parameter of incoming request, and generate
a specific output command.
These applications are based on functions that may be found in file 
Util/DataVis.cc. These functions hide most of the common work necessary
to this application group.
These applications have the following basic structure :

void main(int argc,char **argv)
{
        InitDataVis (argc, argv, "vertprof", "VPROF");
}


int ExecuteRequest (request *orig, request *mars, request* reply)
{
...
}

- InitDataVis creates the service and register a callback for the
associated command.

- ExecuteRequest is specific for each application and must process
the incoming data and generate the reply request.
Request "orig" contains the original request received by the
application. A parameter PATH was included in this command and
contains the name of the temporary file where the result must
be written.
Request "mars" is a list of requests, where the first request
contains the subrequest extracted from request "orig" (DATA parameter)
and the other requests contain the description of each field, one 
field per request.
Request "reply" must be filled with the data description generated
by the application. 
