Index: for_developers/Sphinx/source/Documentation/Input/control.rst
===================================================================
--- for_developers/Sphinx/source/Documentation/Input/control.rst	(revision 41c9dbc9816a48a73dd439140ea7f56de10d8f43)
+++ for_developers/Sphinx/source/Documentation/Input/control.rst	(revision 41c9dbc9816a48a73dd439140ea7f56de10d8f43)
@@ -0,0 +1,63 @@
+================
+The CONTROL file
+================
+    
+  
+
+.. MARS user documentation				https://confluence.ecmwf.int/display/UDOC/MARS+user+documentation
+.. MARS keywords and explanation				https://confluence.ecmwf.int/display/UDOC/MARS+keywords
+ 
+ 
+This file is an input file for :literal:`flex_extract's` main script :literal:`submit.py`.
+It contains the controlling parameters :literal:`flex_extract` needs to decide on dataset specifications,
+handling of the retrieved data and general bahaviour. The naming convention is usually (but not necessary):
+
+   :literal:`CONTROL_<Dataset>[.optionalIndications]`
+
+The tested datasets are the operational dataset and the re-analysis datasets CERA-20C, ERA5 and ERA-Interim.
+The optional extra indications for the re-analysis datasets mark the files for *public users* 
+and *global* domain. For the operational datasets (*OD*) the file names contain also information of
+the stream, the field type for forecasts, the method for extracting the vertical coordinate and other 
+things like time or horizontal resolution.
+
+
+Format of CONTROL files
+----------------------------------
+
+The parameters can be sorted in any order with one parameter per line. 
+Comments are started with a '#' - sign. Some of these parameters can be overruled by the command line
+parameters given to the :literal:`submit.py` script. 
+All parameters have default values. Only those parameters which have to be changed
+must be listed in the :literal:`CONTROL` files. 
+
+Example CONTROL files
+--------------------------------
+
+A number of example files can be found in the directory :literal:`flex_extract_vX.X/run/control/`.
+They can be used as a template for adaptations and understand what's possible to 
+retrieve from ECMWF's archive.
+For each main dataset there is an example and additionally some variances in resolution, type of field
+or type of retrieving the vertical coordinate. 
+
+
+ 
+ 
+CONTROL file
+------------
+The file :literal:`CONTROL.documentation` documents the available parameters
+in grouped sections with their default values. In :doc:`control_params` you can find a more
+detailed description with additional hints, possible values and some useful information about
+the setting of these parameters.
+
+.. literalinclude:: ../../../../../run/control/CONTROL.documentation 
+   :language: bash
+   :caption: CONTROL.documentation
+    
+
+
+
+    
+.. toctree::
+    :hidden:
+    :maxdepth: 2
+    
Index: for_developers/Sphinx/source/Documentation/Input/control_params.rst
===================================================================
--- for_developers/Sphinx/source/Documentation/Input/control_params.rst	(revision 41c9dbc9816a48a73dd439140ea7f56de10d8f43)
+++ for_developers/Sphinx/source/Documentation/Input/control_params.rst	(revision 41c9dbc9816a48a73dd439140ea7f56de10d8f43)
@@ -0,0 +1,122 @@
+======================
+The CONTROL parameters
+======================
+    
+    
+.. _ref-control-user:
+
+User Section
+************
+    
+.. csv-table::
+   :file: ../../_files/CONTROLparameter-user.csv
+   :header-rows: 1
+   :widths: auto 
+
+.. _ref-control-general:
+    
+General Section
+***************
+
+.. csv-table::
+   :file: ../../_files/CONTROLparameter-general.csv
+   :header-rows: 1
+   :widths: auto 
+   
+.. _ref-control-time:
+   
+Time Section
+************
+   
+.. csv-table:: 
+   :file: ../../_files/CONTROLparameter-time.csv
+   :header-rows: 1
+   :widths: auto        
+    
+
+.. _ref-control-data:
+   
+Data Section
+************
+   
+.. csv-table:: 
+   :file: ../../_files/CONTROLparameter-data.csv
+   :header-rows: 1
+   :widths: auto   
+   
+   
+.. _ref-control-datafield:
+   
+Data field Section
+******************
+    
+.. csv-table:: 
+   :file: ../../_files/CONTROLparameter-datafields.csv
+   :header-rows: 1
+   :widths: auto     
+   
+   
+.. _ref-control-fluxdata:
+   
+Flux data Section
+*****************
+
+.. csv-table:: 
+   :file: ../../_files/CONTROLparameter-fluxdata.csv
+   :header-rows: 1
+   :widths: auto
+
+ 
+ .. _ref-control-domain:
+   
+Domain Section
+**************
+   
+.. csv-table:: 
+   :file: ../../_files/CONTROLparameter-domain.csv
+   :header-rows: 1
+   :widths: auto     
+   
+   
+         
+ .. _ref-control-verticalwind:
+   
+Vertical wind Section
+*********************
+   
+.. csv-table:: 
+   :file: ../../_files/CONTROLparameter-verticalwind.csv
+   :header-rows: 1
+   :widths: auto  
+ 
+ 
+.. _ref-control-adddata:
+   
+Additional data Section
+***********************
+   
+.. csv-table:: 
+   :file: ../../_files/CONTROLparameter-adddata.csv
+   :header-rows: 1
+   :widths: auto   
+ 
+  
+.. _ref-control-flexpart:
+   
+Flexpart Section
+****************
+   
+.. csv-table:: 
+   :file: ../../_files/CONTROLparameter-flexpart.csv
+   :header-rows: 1
+   :widths: auto  
+   
+   
+   
+   
+   
+       
+    
+.. toctree::
+    :hidden:
+    :maxdepth: 2
Index: for_developers/Sphinx/source/Documentation/Input/fortran_makefile.rst
===================================================================
--- for_developers/Sphinx/source/Documentation/Input/fortran_makefile.rst	(revision 41c9dbc9816a48a73dd439140ea7f56de10d8f43)
+++ for_developers/Sphinx/source/Documentation/Input/fortran_makefile.rst	(revision 41c9dbc9816a48a73dd439140ea7f56de10d8f43)
@@ -0,0 +1,71 @@
+**********************************
+The Fortran Program - ``CONVERT2``
+**********************************
+
+.. _ref-convert:
+
+One of ``flex_extract``'s components is a Fortran program called ``CONVERT2``.
+This will be compiled during the installation process to get an executable. ``flex_extract`` 
+has a couple of makefiles prepared which are listed in the following. 
+
+
+| **Remote/Gateway mode**: 
+| Files to be used as they are!
+    
+    | **Makefile.gfortran**
+    | For the use on ECMWF's server **ecgate**.
+
+    | **Makefile.CRAY**
+    | For the use on ECMWF's server **cca/ccb**. 
+    
+| **Local mode**
+| It is necessary to adapt **ECCODES_INCLUDE_DIR** and **ECCODES_LIB**
+ 
+    | **Makefile.local.gfortran**
+    | For the use with gfortran compiler.
+
+    | **Makefile.local.ifort**
+    | For the use with ifort compiler.
+
+They can be found in the path ``flex_extract_vX.X/source/fortran``, where
+``vX.X`` should be substituted with the current version number.
+
+So starting from the root directory of ``flex_extract``, 
+go to the ``Fortran`` source directory and open the ``Makefile`` of your 
+choice to modify with an editor of your choice. We use the ``nedit`` in this case.
+So far, we tested ``flex_extract`` with a ``gfortran`` and an ``ifort`` compiler.  
+
+.. code-block:: bash 
+
+   $ cd flex_extract_vX.X/source/fortran
+   $ nedit Makefile.local.gfortran
+
+
+Edit the pathes to the ``eccodes`` library on your local machine. 
+
+.. caution::
+   This can vary from system to system. 
+   It is suggested to use a command like 
+
+   .. code-block:: bash
+
+      # for the ECCODES_INCLUDE_DIR path do:
+      $ dpkg -L libeccodes-dev | grep eccodes.mod
+      # for the ECCODES_LIB path do:
+      $ dpkg -L libeccodes-dev | grep libeccodes.so
+      
+   to find out the path to the ``eccodes`` library.
+   
+Substitute these paths in the ``Makefile`` for parameters **ECCODES_INCLUDE_DIR**
+and **ECCODES_LIB** and save it.
+
+.. code-block:: bash
+
+   # these are the paths on a current Debian Testing system (May 2019)
+   ECCODES_INCLUDE_DIR=/usr/lib/x86_64-linux-gnu/fortran/gfortran-mod-15/
+   ECCODES_LIB= -L/usr/lib -leccodes_f90 -leccodes -lm  
+   
+   
+.. toctree::
+    :hidden:
+    :maxdepth: 2
Index: for_developers/Sphinx/source/Documentation/Input/setup.rst
===================================================================
--- for_developers/Sphinx/source/Documentation/Input/setup.rst	(revision 41c9dbc9816a48a73dd439140ea7f56de10d8f43)
+++ for_developers/Sphinx/source/Documentation/Input/setup.rst	(revision 41c9dbc9816a48a73dd439140ea7f56de10d8f43)
@@ -0,0 +1,27 @@
+**************************************
+The Installation Script - ``setup.sh``
+**************************************
+
+.. _ref-setup:
+
+
+The installation script ``setup.sh`` prepares the call of the Python 
+installation script (``install.py``) with its necessary command line arguments. 
+The ``setup.sh`` script is located in the root directory of ``flex_extract`` and has a 
+section labelled with "AVAILABLE COMMANDLINE ARGUMENTS TO SET" which
+contains the available command line parameters for ``install.py``. The user has to adapt these
+parameters for his personal use. The parameters are listed and described in the following table.
+The script also does some checks to guarantee necessary parameters were set.
+   
+.. csv-table:: 
+   :file: ../../_files/InstallationParameters.csv
+   :header-rows: 1
+   :widths: auto   
+
+After the installation some tests can be conducted. 
+They are described in section :ref:`ref-testinstallfe`.
+
+
+.. toctree::
+    :hidden:
+    :maxdepth: 2
Index: for_developers/Sphinx/source/Documentation/Overview/app_modes.rst
===================================================================
--- for_developers/Sphinx/source/Documentation/Overview/app_modes.rst	(revision 41c9dbc9816a48a73dd439140ea7f56de10d8f43)
+++ for_developers/Sphinx/source/Documentation/Overview/app_modes.rst	(revision 41c9dbc9816a48a73dd439140ea7f56de10d8f43)
@@ -0,0 +1,47 @@
+*****************
+Application Modes
+*****************
+
+.. role:: underline
+    :class: underline
+        
+.. _member state: https://www.ecmwf.int/en/about/who-we-are/member-states 
+.. _instructions: https://apps.ecmwf.int/registration/
+
+    
+.. _ref-app-modes:
+
+Arising from the two user groups described in :doc:`../../Ecmwf/access`, ``flex_extract`` has 4 different :underline:`user application modes`:
+
+.. _ref-remote-des:
+
+  1. Remote (member)
+      In the **Remote mode** the user works directly on ECMWF Linux member state server, such as ``ecgate`` or ``cca``. The software will be installed in the ``$HOME`` directory. The user does not need to install any of the additional third-party libraries mentioned in :ref:`ref-requirements` as ECMWF provides everything with environment modules. The module selection will be done automatically in ``flex_extract``. 
+      
+.. _gateway:
+      
+  2. Gateway (member)
+      The **Gateway mode** can be used if a local member state gateway server is in place. Then the job scripts can be submitted to the ECMWF Linux member state server via the ECMWF web access tool ``ecaccess``. The installation script of ``flex_extract`` must be executed at the local gateway server such that the software will be installed in the ``$HOME`` directory at the ECMWF server and some extra setup is done in the local ``flex_extract`` directory at the local gateway server. For more information about establishing a gateway server please see section ???. For the **Gateway mode** the necessary environment has to be established which is described in :ref:`ref-local-prep`.
+
+.. _local:
+      
+  3. Local member
+      Scripts are installed and executed on a local machine, either in the current ``flex_extract`` directory or in a path given to the installation script. Under this scenario a software environment similar to that at ECMWF is required. Additionally, Web API's have to be installed to access ECMWF server. The complete installation process is described in :ref:`ref-local-prep`.
+      
+  4. Local public
+      Scripts are installed and executed on a local machine, either in the current ``flex_extract`` directory or in a path given to the installation script. Under this scenario a software environment similar to that at ECMWF is required. Additionally, Web API's have to be installed to access ECMWF server. The complete installation process is described in :ref:`ref-local-prep`. In this case a direct registration at ECMWF is necessary and the user has to accept a specific license agreement for each dataset he/she intends to retrieve. 
+      
+      
+An overview is sketched in figure :ref:`ref-fig-marsaccess`.
+
+.. _ref-fig-marsaccess:
+
+.. figure:: ../../_static/Diagramm_MarsAccess2.png
+
+   Application modes 
+
+
+    
+.. toctree::
+    :hidden:
+    :maxdepth: 2
Index: for_developers/Sphinx/source/Documentation/Overview/convert.rst
===================================================================
--- for_developers/Sphinx/source/Documentation/Overview/convert.rst	(revision 41c9dbc9816a48a73dd439140ea7f56de10d8f43)
+++ for_developers/Sphinx/source/Documentation/Overview/convert.rst	(revision 41c9dbc9816a48a73dd439140ea7f56de10d8f43)
@@ -0,0 +1,7 @@
+=======
+CONVERT
+=======
+
+ 
+    UNDER CONSTRUCTION
+    
Index: for_developers/Sphinx/source/Documentation/Overview/prog_flow.rst
===================================================================
--- for_developers/Sphinx/source/Documentation/Overview/prog_flow.rst	(revision 41c9dbc9816a48a73dd439140ea7f56de10d8f43)
+++ for_developers/Sphinx/source/Documentation/Overview/prog_flow.rst	(revision 41c9dbc9816a48a73dd439140ea7f56de10d8f43)
@@ -0,0 +1,5 @@
+Program Flow
+================
+
+ 
+    UNDER CONSTRUCTION
Index: for_developers/Sphinx/source/Documentation/api.rst
===================================================================
--- for_developers/Sphinx/source/Documentation/api.rst	(revision 41c9dbc9816a48a73dd439140ea7f56de10d8f43)
+++ for_developers/Sphinx/source/Documentation/api.rst	(revision 41c9dbc9816a48a73dd439140ea7f56de10d8f43)
@@ -0,0 +1,82 @@
+Auto Generated Documentation
+============================
+
+.. contents::
+    :local:
+    
+Porgrams
+--------
+
+install
+*******
+
+.. automodule:: install
+    :members:
+    
+submit
+******
+
+.. automodule:: submit
+    :members:
+    
+Classes
+-------
+
+ControlFile
+***********
+
+.. automodule:: ControlFile
+    :members:
+    
+EcFlexpart
+**********
+
+.. automodule:: EcFlexpart
+    :members:
+    
+GribUtil
+*********
+
+.. automodule:: GribUtil
+    :members:
+
+MarsRetrieval
+*************
+
+.. automodule:: MarsRetrieval
+    :members:
+
+UioFiles
+********
+
+.. automodule:: UioFiles
+    :members:
+
+
+
+Modules
+-------
+
+get_mars_data
+*************
+
+.. automodule:: get_mars_data
+    :members:
+ 
+prepare_flexpart
+****************
+
+.. automodule:: prepare_flexpart
+    :members:    
+    
+tools
+*****
+
+.. automodule:: tools
+    :members:
+
+disaggregation
+**************    
+    
+.. automodule:: disaggregation
+    :members:
Index: for_developers/Sphinx/source/Documentation/disagg.rst
===================================================================
--- for_developers/Sphinx/source/Documentation/disagg.rst	(revision 41c9dbc9816a48a73dd439140ea7f56de10d8f43)
+++ for_developers/Sphinx/source/Documentation/disagg.rst	(revision 41c9dbc9816a48a73dd439140ea7f56de10d8f43)
@@ -0,0 +1,11 @@
+===========================
+Disaggregation of Flux Data
+===========================
+    
+    UNDER CONSTRUCTION    
+        
+.. toctree::
+    :hidden:
+    :maxdepth: 2
+    
+    
Index: for_developers/Sphinx/source/Documentation/input.rst
===================================================================
--- for_developers/Sphinx/source/Documentation/input.rst	(revision 41c9dbc9816a48a73dd439140ea7f56de10d8f43)
+++ for_developers/Sphinx/source/Documentation/input.rst	(revision 41c9dbc9816a48a73dd439140ea7f56de10d8f43)
@@ -0,0 +1,12 @@
+====================
+Control & Input Data
+====================
+        
+    UNDER CONSTRUCTION
+        
+.. toctree::
+    :hidden:
+    :maxdepth: 2
+    
+    Input/control
+    Input/control_params
Index: for_developers/Sphinx/source/Documentation/output.rst
===================================================================
--- for_developers/Sphinx/source/Documentation/output.rst	(revision 41c9dbc9816a48a73dd439140ea7f56de10d8f43)
+++ for_developers/Sphinx/source/Documentation/output.rst	(revision 41c9dbc9816a48a73dd439140ea7f56de10d8f43)
@@ -0,0 +1,10 @@
+===========
+Output Data
+===========
+    
+    UNDER CONSTRUCTION
+        
+.. toctree::
+    :hidden:
+    :maxdepth: 2
+    
Index: for_developers/Sphinx/source/Documentation/overview.rst
===================================================================
--- for_developers/Sphinx/source/Documentation/overview.rst	(revision 41c9dbc9816a48a73dd439140ea7f56de10d8f43)
+++ for_developers/Sphinx/source/Documentation/overview.rst	(revision 41c9dbc9816a48a73dd439140ea7f56de10d8f43)
@@ -0,0 +1,19 @@
+========
+Overview
+========
+        
+    UNDER CONSTRUCTION    
+    
+    
+    
+The system retrieves the data from the European Centre for
+Medium-Range Weather Forecasts (ECMWF) situated in Reading, United Kingdom.
+
+    
+.. toctree::
+    :hidden:
+    :maxdepth: 2
+    
+    Overview/app_modes
+    Overview/prog_flow
+    Overview/convert
Index: for_developers/Sphinx/source/Documentation/vertco.rst
===================================================================
--- for_developers/Sphinx/source/Documentation/vertco.rst	(revision 41c9dbc9816a48a73dd439140ea7f56de10d8f43)
+++ for_developers/Sphinx/source/Documentation/vertco.rst	(revision 41c9dbc9816a48a73dd439140ea7f56de10d8f43)
@@ -0,0 +1,10 @@
+===================
+Vertical Coordinate
+===================
+    
+    UNDER CONSTRUCTION
+        
+.. toctree::
+    :hidden:
+    :maxdepth: 2
+    
