Fandom

Documentation

Flowchart (METRo)

133pages on
this wiki
Add New Page
Talk0 Share

This article shows the flowchart of METRo. You might also want to look at the schema of I/O as a complement to the comprehension of METRo source code.

This article aims the METRo developers. You do not need to understand it if you only want to install and to use METRo.

Flowchart Edit

  • Green: code in python;
  • Cyan: code in fortran;
  • Red: code in C;
  • Orange: data in XML format;
Metro 3 schema couleur resize

You can view the image in full resolution.

ModulesEdit

The fortran code contains the physic model of METRo. The code is located in the directory model.

All the python code is locate in the directory under the one named frontend. All the modules of METRo, except for the physic model, is coded in this language.

ConfigurationEdit

The configuration module is the file named metro_config.py and contains all the methods that METRo needs to access the configuration all along his execution. It is why it can be called by any modules of METRo.

This files also contains the order of which the METRo modules are invoked. See the dictionnary value of INIT_MODULE_EXECUTION_SEQUENCE in this file to see the default order. One as only to write a module and add is name when it would be runs.

Input readingEdit

Pre-processingEdit

ModelEdit

The physical model of METRo is coded in fortran. It corresponds to the central part of the flowchart, the part that contains red and cyan block. The model is called by the python module named metro_model.py, by the method called macadam.Do_Metro(...).

The physics and other constants used in METRo are in the file metro_constant.py and constPhys.f.

C wrapperEdit

Macadam is the name of the project that contains the wrapper for the fortran code. The C file is unique and is named macadam.c. The fortran methods are called from this file in a determine order. There is some logic in this file but only to determine which fortran function to invoke, not to perform computation.

For each list or array that one wants to retrieve from the C code, a function must be implemented in the file macadam.h and written in the file macadam.i (see below). The function is a simple return of the structure containing the data. See the code for example.

The type of data that can be returned by the fortran up to the python code are in the file macadam.i. Unless you really, really know what you are doing, do not touch the functions already present in this file, as they are the SWIG wrapper of METRo. Arrays are also supported and are simply called by using the word Struct after the type of data (double array would be doubleStruct).

The following data are supported:

  • char;
  • double;
  • float;
  • long;
  • short;
  • int;

Post-processingEdit

Output writingEdit

Coding conventionEdit

The following code convention have been followed in the python code of METRo and some of it in the C and fortran code. As much as possible, all the code of METRo should respect it.

  1. All the python modules of METRo starts with the string metro_;
  2. Pre-process modules starts with the string metro_preprocess_"
  3. Post-process modules starts with the string metro_postprocess_"
  4. The Hungarian notation is used in METRo. This is the corresponding signification:
Letter(s) Variable type
n integer
f float
d double
t tuple
p pointer
l list
wf weather forecast (object)
c class
st structure
na numarray (deprecated)
np numpy


METRo I/O files
Station | Observation | Forecast | Roadcast | Configuration
METRo I/O specification
Schema | | Flowchart | Format | Date | Observation QA/QC | Road condition | Station type | Time zone | Layer type | Latitude and longitude
METRo I/O examples
Station | Observation | Forecast | Roadcast | Graphical display


Logo ec
This page is part of the documentation of the METRo software. Back to the table of content.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.