Index: source/python/mods/checks.py
===================================================================
--- source/python/mods/checks.py	(revision f2616a333db26377c5a93a897e13f877b4118e5a)
+++ source/python/mods/checks.py	(revision 6f951ca0346aa6a2c3e11ee62df85214a290d838)
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
-##*******************************************************************************
+#*******************************************************************************
 # @Author: Anne Philipp (University of Vienna)
 #
@@ -9,16 +9,14 @@
 #
 # @License:
-#    (C) Copyright 2014-2018.
+#    (C) Copyright 2014-2019.
+#    Anne Philipp, Leopold Haimberger
 #
-#    This software is licensed under the terms of the Apache Licence Version 2.0
-#    which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-#
-# @Modul Description:
-#
-#
-# @Module Content:
-
-#
+#    This work is licensed under the Creative Commons Attribution 4.0
+#    International License. To view a copy of this license, visit
+#    http://creativecommons.org/licenses/by/4.0/ or send a letter to
+#    Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
 #*******************************************************************************
+'''This module contains check methods for the CONTROL paramaters.
+'''
 
 # ------------------------------------------------------------------------------
@@ -27,4 +25,5 @@
 
 import os
+import sys
 import _config
 import exceptions
@@ -40,9 +39,9 @@
     Parameters
     ----------
-    c : :obj:`ControlFile`
+    c : ControlFile
         Contains all the parameters of CONTROL file and
         command line.
 
-    logicals : :obj:`list` of (:obj:`string` or :obj:`integer`)
+    logicals : list of (str or int)
         Names of the switches that are used to control the flow of the
         program.
@@ -67,10 +66,10 @@
     Parameters
     ----------
-    grid : :obj:`string`
+    grid : str
         Contains grid information
 
     Return
     ------
-    grid : :obj:``string`
+    grid : str
         Contains grid in format Lat/lon. E.g. 0.1/0.1
     '''
@@ -108,25 +107,25 @@
     Parameters
     ----------
-    grid : :obj:`string`
+    grid : str
         Contains grid information.
 
-    area : :obj:`string`
+    area : str
         Contains area informtion.
 
-    upper : :obj:`string`
+    upper : str
         The northern most latitude.
 
-    lower : :obj:`string`
+    lower : str
         The souther most latitude.
 
-    left : :obj:`string`
+    left : str
         The western most longitude.
 
-    right : :obj:`string`
+    right : str
         The eastern most longiude.
 
     Return
     ------
-    grid : :obj:``string`
+    grid : str
         Contains grid in format Lat/lon. E.g. 0.1/0.1
     '''
@@ -173,19 +172,19 @@
     Parameters
     ----------
-    levelist : :obj:`string`
+    levelist : str
         Specifies the level list.
         Examples: model level: 1/to/137, pressure levels: 500/to/1000
 
-    level : :obj:`string`
+    level : str
         Specifies the maximum level.
 
     Return
     ------
-    levelist : :obj:`string`
+    levelist : str
         Specifies the required levels. It has to have a valid
         correspondence to the selected levtype.
         Examples: model level: 1/to/137, pressure levels: 500/to/1000
 
-    level : :obj:`string`
+    level : str
         Specifies the maximum level. It has to be one of the
         available maximum level number as contained in the variable
@@ -221,9 +220,9 @@
     Parameters
     ----------
-    c : :obj:`ControlFile`
+    c : ControlFile
             Contains all the parameters of CONTROL file and
             command line.
 
-    ppid : :obj:`int` or :obj:`None`
+    ppid : int or None
         Contains the ppid number provided by the command line parameter
         of is None otherwise.
@@ -247,5 +246,5 @@
     Parameters
     ----------
-    ftype : :obj:`list` of :obj:`string`
+    ftype : list of str
         List of field types.
 
@@ -273,9 +272,9 @@
     Parameters
     ----------
-    step : :obj:`list` of :obj:`string` or :obj:`string`
+    step : list of str or str
         Specifies the forecast time step from forecast base time.
         Valid values are hours (HH) from forecast base time.
 
-    mailfail : :obj:`list` of :obj:``string`
+    mailfail : list of str
         Contains all email addresses which should be notified.
         It might also contain just the ecmwf user name which will trigger
@@ -284,5 +283,5 @@
     Return
     ------
-    step : :obj:`list` of :obj:`string`
+    step : list of str
         List of forecast steps in format e.g. [001, 002, ...]
     '''
@@ -313,8 +312,8 @@
     Parameters
     ----------
-    ftype : :obj:`list` of :obj:`string` or :obj:`string`
+    ftype : list of str or str
         List of field types.
 
-    steps : :obj:`string`
+    steps : str
         Specifies the forecast time step from forecast base time.
         Valid values are hours (HH) from forecast base time.
@@ -322,5 +321,5 @@
     Return
     ------
-    ftype : :obj:`list` of :obj:`string`
+    ftype : list of str
         List of field types.
     '''
@@ -340,10 +339,10 @@
     Parameters
     ----------
-    ftime : :obj:`list` of :obj:`string` or :obj:`string`
+    ftime : list of str or str
         The time in hours of the field.
 
     Return
     ------
-    ftime : :obj:`list` of :obj:`string`
+    ftime : list of str
         The time in hours of the field.
     '''
@@ -358,30 +357,30 @@
     Parameters
     ----------
-    ftype : :obj:`list` of :obj:`string`
+    ftype : list of str
         List of field types.
 
-    ftime : :obj:`list` of :obj:`string` or :obj:`string`
+    ftime : list of str or str
         The time in hours of the field.
 
-    steps : :obj:`string`
+    steps : str
         Specifies the forecast time step from forecast base time.
         Valid values are hours (HH) from forecast base time.
 
-    maxstep : :obj:`integer`
+    maxstep : int
         The maximum forecast time step in hours from the forecast base time.
         This is the maximum step for non flux (accumulated) forecast data.
 
-    purefc : :obj:`integer`
+    purefc : int
         Switch for definition of pure forecast mode or not.
 
     Return
     ------
-    ftype : :obj:`list` of :obj:`string`
+    ftype : list of str
         List of field types.
 
-    ftime : :obj:`list` of :obj:`string`
+    ftime : list of str
         The time in hours of the field.
 
-    steps : :obj:`string`
+    steps : str
         Specifies the forecast time step from forecast base time.
         Valid values are hours (HH) from forecast base time.
@@ -410,5 +409,5 @@
     Parameters
     ----------
-    mail : :obj:`list` of :obj:`string` or :obj:`string`
+    mail : list of str or str
         Contains email addresses for notifications.
         It might also contain just the ecmwf user name which will trigger
@@ -417,5 +416,5 @@
     Return
     ------
-    mail : :obj:`list` of :obj:``string`
+    mail : list of str
         Contains email addresses for notifications.
         It might also contain just the ecmwf user name which will trigger
@@ -439,20 +438,20 @@
     Parameters
     ----------
-    queue : :obj:`string`
+    queue : str
         Name of the queue if submitted to the ECMWF servers.
         Used to check if ecuid, ecgid, gateway and destination
         are set correctly and are not empty.
 
-    gateway : :obj:`string`
+    gateway : str
         The address of the gateway server.
 
-    destination : :obj:`string`
+    destination : str
         The name of the destination of the gateway server for data
         transfer through ectrans. E.g. name@genericSftp
 
-    ecuid : :obj:`string`
+    ecuid : str
         ECMWF user id.
 
-    ecgid : :obj:`string`
+    ecgid : str
         ECMWF group id.
 
@@ -475,24 +474,24 @@
     Parameters
     ----------
-    idir : :obj:`string`
+    idir : str
         Path to the temporary directory for MARS retrieval data.
 
-    odir : :obj:`string`
+    odir : str
         Path to the final output directory where the FLEXPART input files
         will be stored.
 
-    fpdir : :obj:`string`
+    fpdir : str
         Path to FLEXPART root directory.
 
-    fedir : :obj:`string`
+    fedir : str
         Path to flex_extract root directory.
 
     Return
     ------
-    odir : :obj:`string`
+    odir : str
         Path to the final output directory where the FLEXPART input files
         will be stored.
 
-    fpdir : :obj:`string`
+    fpdir : str
         Path to FLEXPART root directory.
 
@@ -513,16 +512,16 @@
     Parameters
     ----------
-    start : :obj:`string`
+    start : str
         The start date of the retrieval job.
 
-    end : :obj:`string`
+    end : str
         The end date of the retrieval job.
 
     Return
     ------
-    start : :obj:`string`
+    start : str
         The start date of the retrieval job.
 
-    end : :obj:`string`
+    end : str
         The end date of the retrieval job.
 
@@ -555,9 +554,9 @@
     Parameters
     ----------
-    maxstep : :obj:`string`
+    maxstep : str
         The maximum forecast time step in hours from the forecast base time.
         This is the maximum step for non flux (accumulated) forecast data.
 
-    steps : :obj:`string`
+    steps : str
         Specifies the forecast time step from forecast base time.
         Valid values are hours (HH) from forecast base time.
@@ -565,5 +564,5 @@
     Return
     ------
-    maxstep : :obj:`integer`
+    maxstep : int
         The maximum forecast time step in hours from the forecast base time.
         This is the maximum step for non flux (accumulated) forecast data.
@@ -588,5 +587,5 @@
     Parameters
     ----------
-    basetime : :obj:``
+    basetime : str
         The time for a half day retrieval. The 12 hours upfront are to be
         retrieved.
@@ -607,5 +606,5 @@
     Parameters
     ----------
-    request : :obj:`integer`
+    request : int
         Selects the mode of retrieval.
         0: Retrieves the data from ECMWF.
@@ -613,5 +612,5 @@
         2: Retrieves the data and prints the mars request.
 
-    marsfile : :obj:`string`
+    marsfile : str
         Path to the mars request file.
 
@@ -631,8 +630,8 @@
     Parameters
     ----------
-    public : :obj:`ìnteger`
+    public : int
         Specifies if public data are to be retrieved or not.
 
-    dataset : :obj:`string`
+    dataset : str
         Specific name which identifies the public dataset.
 
@@ -653,13 +652,13 @@
     Parameters
     ----------
-    acctype : :obj:`string`
+    acctype : str
         The field type for the accumulated forecast fields.
 
-    ftype : :obj:`list` of :obj:`string`
+    ftype : list of str
         List of field types.
 
     Return
     ------
-    acctype : :obj:`string`
+    acctype : str
         The field type for the accumulated forecast fields.
     '''
@@ -690,21 +689,21 @@
     Parameters
     ----------
-    acctime : :obj:`string`
+    acctime : str
         The starting time from the accumulated forecasts.
 
-    acctype : :obj:`string`
+    acctype : str
         The field type for the accumulated forecast fields.
 
-    purefc : :obj:`integer`
+    purefc : int
         Switch for definition of pure forecast mode or not.
 
     Return
     ------
-    acctime : :obj:`string`
+    acctime : str
         The starting time from the accumulated forecasts.
     '''
     if not acctime:
         print('... Control parameter ACCTIME was not defined.')
-        print('... Value will be set depending on field type: '
+        print('... Value will be set depending on field type:\n '
               '\t\t EA=06/18\n\t\t EI/OD=00/12\n\t\t  EP=18')
         if acctype.upper() == 'EA': # Era 5
@@ -726,14 +725,14 @@
     Parameters
     ----------
-    accmaxstep : :obj:`string`
+    accmaxstep : str
         The maximum forecast step for the accumulated forecast fields.
 
-    acctype : :obj:`string`
+    acctype : str
         The field type for the accumulated forecast fields.
 
-    purefc : :obj:`integer`
+    purefc : int
         Switch for definition of pure forecast mode or not.
 
-    maxstep : :obj:`string`
+    maxstep : str
         The maximum forecast time step in hours from the forecast base time.
         This is the maximum step for non flux (accumulated) forecast data.
@@ -741,5 +740,5 @@
     Return
     ------
-    accmaxstep : :obj:`string`
+    accmaxstep : str
         The maximum forecast step for the accumulated forecast fields.
     '''
@@ -776,10 +775,10 @@
     Parameters
     ----------
-    addpar : :obj:`string` or :obj:'list' of :obj:'string'
+    addpar : str or list of str
         List of additional parameters to be retrieved.
 
     Return
     ------
-    addpar : :obj:'string'
+    addpar : str
         List of additional parameters to be retrieved.
     '''
@@ -798,16 +797,19 @@
 
 def check_job_chunk(job_chunk):
-    '''Checks that the job chunk number is positive and non zero.
-
-    Parameters
-    ----------
-    job_chunk : :obj:`integer`
+    '''Checks that if job chunk is set, the number is positive and non zero.
+
+    Parameters
+    ----------
+    job_chunk : int
         The number of days for a single job script.
 
     Return
     ------
-    job_chunk : :obj:`integer`
+    job_chunk : int
         The number of days for a single job script.
     '''
+    if not job_chunk:
+        return job_chunk
+
     if job_chunk < 0:
         raise ValueError('ERROR: The number of job chunk is negative!\n'
Index: source/python/mods/disaggregation.py
===================================================================
--- source/python/mods/disaggregation.py	(revision 0e2f93e769a4276db0016147409dffbb1482dfa9)
+++ source/python/mods/disaggregation.py	(revision 6f951ca0346aa6a2c3e11ee62df85214a290d838)
@@ -17,30 +17,34 @@
 #        - outsourced the disaggregation functions dapoly and darain
 #          to a new module named disaggregation
+#        - added the new disaggregation method for precipitation
 #
 # @License:
-#    (C) Copyright 2015-2018.
-#
-#    This software is licensed under the terms of the Apache Licence Version 2.0
-#    which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-#
-# @Module Description:
-#    disaggregation of deaccumulated flux data from an ECMWF model FG field.
-#    Initially the flux data to be concerned are:
-#    - large-scale precipitation
-#    - convective precipitation
-#    - surface sensible heat flux
-#    - surface solar radiation
-#    - u stress
-#    - v stress
-#    Different versions of disaggregation is provided for rainfall
-#    data (darain, modified linear) and the surface fluxes and
-#    stress data (dapoly, cubic polynomial).
-#
-# @Module Content:
+#    (C) Copyright 2014-2019.
+#    Anne Philipp, Leopold Haimberger
+#
+#    This work is licensed under the Creative Commons Attribution 4.0
+#    International License. To view a copy of this license, visit
+#    http://creativecommons.org/licenses/by/4.0/ or send a letter to
+#    Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
+#
+# @Methods:
 #    - dapoly
 #    - darain
 #    - IA3
-#
 #*******************************************************************************
+'''Disaggregation of deaccumulated flux data from an ECMWF model FG field.
+
+Initially the flux data to be concerned are:
+    - large-scale precipitation
+    - convective precipitation
+    - surface sensible heat flux
+    - surface solar radiation
+    - u stress
+    - v stress
+
+Different versions of disaggregation is provided for rainfall
+data (darain, modified linear) and the surface fluxes and
+stress data (dapoly, cubic polynomial).
+'''
 
 # ------------------------------------------------------------------------------
@@ -65,5 +69,5 @@
     Parameters
     ----------
-    alist : :obj:`list` of :obj:`array` of :obj:`float`
+    alist : list of array of float
         List of 4 timespans as 2-dimensional, horizontal fields.
         E.g. [[array_t1], [array_t2], [array_t3], [array_t4]]
@@ -71,5 +75,5 @@
     Return
     ------
-    nfield : :obj:`array` of :obj:`float`
+    nfield : array of float
         Interpolated flux at central point of accumulation timespan.
 
@@ -109,5 +113,5 @@
     Parameters
     ----------
-    alist : :obj:`list` of :obj:`array` of :obj:`float`
+    alist : list of array of float
         List of 4 timespans as 2-dimensional, horizontal fields.
         E.g. [[array_t1], [array_t2], [array_t3], [array_t4]]
@@ -115,5 +119,5 @@
     Return
     ------
-    nfield : :obj:`array` of :obj:`float`
+    nfield : array of float
         Interpolated flux at central point of accumulation timespan.
 
@@ -160,5 +164,5 @@
     Note
     ----
-    Copyright 2017
+    (C) Copyright 2017-2019
     Sabine Hittmeir, Anne Philipp, Petra Seibert
 
@@ -170,5 +174,5 @@
     Parameters
     ----------
-    g : :obj:`list` of :obj:`float`
+    g : list of float
         Complete data series that will be interpolated having
         the dimension of the original raw series.
@@ -176,5 +180,5 @@
     Return
     ------
-    f : :obj:`list` of :obj:`float`
+    f : list of float
         The interpolated data series with additional subgrid points.
         Its dimension is equal to the length of the input data series
Index: source/python/mods/get_mars_data.py
===================================================================
--- source/python/mods/get_mars_data.py	(revision 9aefaadcad4f37803b25dccec9574c3b437be4e6)
+++ source/python/mods/get_mars_data.py	(revision 6f951ca0346aa6a2c3e11ee62df85214a290d838)
@@ -22,40 +22,36 @@
 #          online documentation)
 #        - use of UIFiles class for file selection and deletion
-#
+#        - seperated get_mars_data function into several smaller pieces:
+#          write_reqheader, mk_server, mk_dates, remove_old, do_retrievment
 #
 # @License:
-#    (C) Copyright 2014-2018.
-#
-#    This software is licensed under the terms of the Apache Licence Version 2.0
-#    which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-#
-# @Program Functionality:
-#    This program can be used as a module in the whole flex_extract process
-#    or can be run by itself to just extract MARS data from ECMWF. To do so,
-#    a couple of necessary parameters has to be passed with the program call.
-#    See documentation for more details.
-#
-# @Program Content:
-#    - main
-#    - get_mars_data
-#    - do_retrievement
-#
+#    (C) Copyright 2014-2019.
+#    Anne Philipp, Leopold Haimberger
+#
+#    This work is licensed under the Creative Commons Attribution 4.0
+#    International License. To view a copy of this license, visit
+#    http://creativecommons.org/licenses/by/4.0/ or send a letter to
+#    Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
 #*******************************************************************************
-"""ToDo: Name of litte program
-
-ToDo: Add desccription
-
-ToDo: Add Conditions
-
-This script requires that `...` be installed within the Python
-environment you are running this script in.
+'''This script extracts MARS data from ECMWF servers.
+
+At first, the necessary parameters from command line and CONTROL files are
+extracted. They define the data set to be extracted from MARS.
 
 This file can also be imported as a module and contains the following
 functions:
 
-    * get_mars_data -
-    * do_retrievement -
     * main - the main function of the script
-"""
+    * get_mars_data - overall control of ECMWF data retrievment
+    * write_reqheader - writes the header into the mars_request file
+    * mk_server - creates the server connection to ECMWF servers
+    * mk_dates - defines the start and end date
+    * remove_old - deletes old retrieved grib files
+    * do_retrievement - creates individual retrievals
+
+Type: get_mars_data.py --help
+to get information about command line parameters.
+Read the documentation for usage instructions.
+'''
 # ------------------------------------------------------------------------------
 # MODULES
@@ -67,4 +63,5 @@
 
 # software specific classes and modules from flex_extract
+# add path to local main python path for flex_extract to get full access
 sys.path.append(os.path.dirname(os.path.abspath(
     inspect.getfile(inspect.currentframe()))) + '/../')
@@ -120,5 +117,5 @@
     Parameters
     ----------
-    c : :obj:`ControlFile`
+    c : ControlFile
         Contains all the parameters of CONTROL file and
         command line.
@@ -166,5 +163,5 @@
     Parameters
     ----------
-    marsfile : :obj:`string`
+    marsfile : str
         Path to the mars request file.
 
@@ -189,5 +186,5 @@
     Parameters
     ----------
-    c : :obj:`ControlFile`
+    c : ControlFile
         Contains all the parameters of CONTROL file and
         command line.
@@ -195,5 +192,5 @@
     Return
     ------
-    server : :obj:`ECMWFDataServer` or :obj:`ECMWFService`
+    server : ECMWFDataServer or ECMWFService
         Connection to ECMWF server via python interface ECMWF WebAPI.
 
@@ -230,9 +227,9 @@
     Parameters
     ----------
-    c : :obj:`ControlFile`
+    c : ControlFile
         Contains all the parameters of CONTROL file and
         command line.
 
-    fluxes : :obj:`boolean`, optional
+    fluxes : boolean, optional
         Decides if the flux parameter settings are stored or
         the rest of the parameter list.
@@ -241,11 +238,11 @@
     Return
     ------
-    start : :obj:`datetime`
+    start : datetime
         The start date of the retrieving data set.
 
-    end : :obj:`datetime`
+    end : datetime
         The end date of the retrieving data set.
 
-    chunk : :obj:`datetime`
+    chunk : datetime
         Time period in days for one single mars retrieval.
 
@@ -271,8 +268,8 @@
     Parameters
     ----------
-    pattern : :obj:`string`
+    pattern : str
         The sub string pattern which identifies the files to be deleted.
 
-    inputdir : :obj:`string`, optional
+    inputdir : str, optional
         Path to the directory where the retrieved data is stored.
 
@@ -295,22 +292,22 @@
     Parameters
     ----------
-    c : :obj:`ControlFile`
+    c : ControlFile
         Contains all the parameters of CONTROL file and
         command line.
 
-    server : :obj:`ECMWFService`
+    server : ECMWFService or ECMWFDataServer
             The server connection to ECMWF.
 
-    start : :obj:`datetime`
+    start : datetime
         The start date of the retrieval.
 
-    end : :obj:`datetime`
+    end : datetime
         The end date of the retrieval.
 
-    delta_t : :obj:`datetime`
+    delta_t : datetime
         Delta_t + 1 is the maximal time period of a single
         retrieval.
 
-    fluxes : :obj:`boolean`, optional
+    fluxes : boolean, optional
         Decides if the flux parameters are to be retrieved or
         the rest of the parameter list.
Index: source/python/mods/prepare_flexpart.py
===================================================================
--- source/python/mods/prepare_flexpart.py	(revision 9aefaadcad4f37803b25dccec9574c3b437be4e6)
+++ source/python/mods/prepare_flexpart.py	(revision 6f951ca0346aa6a2c3e11ee62df85214a290d838)
@@ -22,5 +22,5 @@
 #        - added documentation
 #        - minor changes in programming style for consistence
-#        - BUG: removed call of clean_up-Function after call of
+#        - BUGFIX: removed call of clean_up-Function after call of
 #               prepareFlexpart in main since it is already called in
 #               prepareFlexpart at the end!
@@ -29,23 +29,31 @@
 #
 # @License:
-#    (C) Copyright 2014-2018.
+#    (C) Copyright 2014-2019.
+#    Anne Philipp, Leopold Haimberger
 #
-#    This software is licensed under the terms of the Apache Licence Version 2.0
-#    which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-#
-# @Program Functionality:
-#    This program prepares the final version of the grib files which are
-#    then used by FLEXPART. It converts the bunch of grib files extracted
-#    via get_mars_data by doing for example the necessary conversion to get
-#    consistent grids or the disaggregation of flux data. Finally, the
-#    program combines the data fields in files per available hour with the
-#    naming convention xxYYMMDDHH, where xx should be 2 arbitrary letters
-#    (mostly xx is chosen to be "EN").
-#
-# @Program Content:
-#    - main
-#    - prepare_flexpart
-#
+#    This work is licensed under the Creative Commons Attribution 4.0
+#    International License. To view a copy of this license, visit
+#    http://creativecommons.org/licenses/by/4.0/ or send a letter to
+#    Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
 #*******************************************************************************
+'''This script prepares the final version of the grib files which are
+then used by FLEXPART.
+
+It converts the bunch of grib files extracted via get_mars_data before,
+by doing the necessary conversion to get consistent grids or the
+disaggregation of flux data. Finally, the data fields are combined
+in files per available hour with the naming convention xxYYMMDDHH,
+where xx should be 2 arbitrary letters (mostly xx is chosen to be "EN").
+
+This file can also be imported as a module which then contains the following
+functions:
+
+    * main
+    * prepare_flexpart
+
+Type: prepare_flexpart.py --help
+to get information about command line parameters.
+Read the documentation for usage instructions.
+'''
 
 # ------------------------------------------------------------------------------
@@ -59,5 +67,5 @@
 
 # software specific classes and modules from flex_extract
-
+# add path to local main python path for flex_extract to get full access
 sys.path.append(os.path.dirname(os.path.abspath(
     inspect.getfile(inspect.currentframe()))) + '/../')
@@ -115,9 +123,9 @@
     Parameters
     ----------
-    ppid : :obj:`int`
+    ppid : int
         Contains the ppid number of the current ECMWF job. It will be None if
         the method was called within this module.
 
-    c : :obj:`ControlFile`
+    c : ControlFile
         Contains all the parameters of CONTROL file and
         command line.
Index: source/python/mods/tools.py
===================================================================
--- source/python/mods/tools.py	(revision f2616a333db26377c5a93a897e13f877b4118e5a)
+++ source/python/mods/tools.py	(revision 6f951ca0346aa6a2c3e11ee62df85214a290d838)
@@ -14,34 +14,45 @@
 #          my_error, normal_exit, init128, to_param_id
 #
-#    April 2018 - Anne Philipp (University of Vienna):
+#    April - December 2018 - Anne Philipp (University of Vienna):
 #        - applied PEP8 style guide
 #        - added documentation
-#        - moved all functions from file Flexparttools to this file tools
-#        - added function get_list_as_string
+#        - moved all non class methods from former file Flexparttools in here
 #        - seperated args and control interpretation
+#        - added functions get_list_as_string, read_ecenv, send_mail, make_dir,
+#          put_file_to_ecserver, submit_job_to_ecserver, get_informations,
+#          get_dimensions, execute_subprocess, none_or_int, none_or_str
 #
 # @License:
-#    (C) Copyright 2014-2018.
+#    (C) Copyright 2014-2019.
+#    Anne Philipp, Leopold Haimberger
 #
-#    This software is licensed under the terms of the Apache Licence Version 2.0
-#    which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
+#    This work is licensed under the Creative Commons Attribution 4.0
+#    International License. To view a copy of this license, visit
+#    http://creativecommons.org/licenses/by/4.0/ or send a letter to
+#    Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
 #
-# @Modul Description:
-#    This module contains a couple of helpful functions which are
-#    used in different places in flex_extract.
-#
-# @Module Content:
-#    - get_cmdline_args
-#    - clean_up
-#    - my_error
-#    - normal_exit
-#    - product
-#    - silent_remove
-#    - init128
-#    - to_param_id
-#    - get_list_as_string
-#    - make_dir
-#
+# @Methods:
+#    none_or_str
+#    none_or_int
+#    get_cmdline_args
+#    read_ecenv
+#    clean_up
+#    my_error
+#    send_mail
+#    normal_exit
+#    product
+#    silent_remove
+#    init128
+#    to_param_id
+#    get_list_as_string
+#    make_dir
+#    put_file_to_ecserver
+#    submit_job_to_ecserver
+#    get_informations
+#    get_dimensions
+#    execute_subprocess
 #*******************************************************************************
+'''This module contains a collection of diverse tasks within flex_extract.
+'''
 
 # ------------------------------------------------------------------------------
@@ -59,5 +70,5 @@
 
 # ------------------------------------------------------------------------------
-# FUNCTIONS
+# METHODS
 # ------------------------------------------------------------------------------
 
@@ -68,5 +79,5 @@
     Parameters
     ----------
-    value : :obj:`string`
+    value : str
         String to be checked for the "None" word.
 
@@ -87,5 +98,5 @@
     Parameters
     ----------
-    value : :obj:`string`
+    value : str
         String to be checked for the "None" word.
 
@@ -110,5 +121,5 @@
     Return
     ------
-    args : :obj:`Namespace`
+    args : Namespace
         Contains the commandline arguments from script/program call.
     '''
@@ -201,10 +212,10 @@
     Parameters
     ----------
-    filepath : :obj:`string`
+    filepath : str
         Path to file where the ECMWF environment parameters are stored.
 
     Return
     ------
-    envs : :obj:`dictionary`
+    envs : dict
         Contains the environment parameter ecuid, ecgid, gateway
         and destination for ECMWF server environments.
@@ -233,5 +244,5 @@
     Parameters
     ----------
-    c : :obj:`ControlFile`
+    c : ControlFile
         Contains all the parameters of CONTROL file and
         command line.
@@ -265,10 +276,10 @@
     Parameters
     ----------
-    user : :obj:`list` of :obj:`string`
+    user : list of str
         Contains all email addresses which should be notified.
         It might also contain just the ecmwf user name which wil trigger
         mailing to the associated email address for this user.
 
-    message : :obj:`string`, optional
+    message : str, optional
         Error message. Default value is "ERROR".
 
@@ -295,14 +306,14 @@
     Parameters
     ----------
-    users : :obj:`list` of :obj:`string`
+    users : list of str
         Contains all email addresses which should be notified.
         It might also contain just the ecmwf user name which wil trigger
         mailing to the associated email address for this user.
 
-    success_mode : :obj:``string`
+    success_mode : str
         States the exit mode of the program to put into
         the mail subject line.
 
-    message : :obj:`string`, optional
+    message : str, optional
         Message for exiting program. Default value is "Done!".
 
@@ -341,5 +352,5 @@
     Parameters
     ----------
-    message : :obj:`string`, optional
+    message : str, optional
         Message for exiting program. Default value is "Done!".
 
@@ -374,8 +385,8 @@
     Parameters
     ----------
-    \*args : :obj:`list` or :obj:`string`
+    \*args : list or str
         Positional arguments (arbitrary number).
 
-    \*\*kwds : :obj:`dictionary`
+    \*\*kwds : dict
         Contains all the keyword arguments from \*args.
 
@@ -405,5 +416,5 @@
     Parameters
     ----------
-    filename : :obj:`string`
+    filename : str
         The name of the file to be removed without notification.
 
@@ -429,10 +440,10 @@
     Parameters
     ----------
-    filepath : :obj:`string`
+    filepath : str
         Path to file of ECMWF grib table number 128.
 
     Return
     ------
-    table128 : :obj:`dictionary`
+    table128 : dict
         Contains the ECMWF grib table 128 information.
         The key is the parameter number and the value is the
@@ -462,5 +473,5 @@
     Parameters
     ----------
-    pars : :obj:`string`
+    pars : str
         Addpar argument from CONTROL file in the format of
         parameter names instead of ids. The parameter short
@@ -468,5 +479,5 @@
         one single string.
 
-    table : :obj:`dictionary`
+    table : dict
         Contains the ECMWF grib table 128 information.
         The key is the parameter number and the value is the
@@ -475,5 +486,5 @@
     Return
     ------
-    ipar : :obj:`list` of :obj:`integer`
+    ipar : list of int
         List of addpar parameters from CONTROL file transformed to
         parameter ids in the format of integer.
@@ -501,8 +512,8 @@
     Parameters
     ----------
-    list_obj : :obj:`list`
+    list_obj : list of *
         A list with arbitrary content.
 
-    concatenate_sign : :obj:`string`, optional
+    concatenate_sign : str, optional
         A string which is used to concatenate the single
         list elements. Default value is ", ".
@@ -510,5 +521,5 @@
     Return
     ------
-    str_of_list : :obj:`string`
+    str_of_list : str
         The content of the list as a single string.
     '''
@@ -528,5 +539,5 @@
     Parameters
     ----------
-    directory : :obj:`string`
+    directory : str
         The path to directory which should be created.
 
@@ -557,17 +568,17 @@
     Parameters
     ----------
-    ecd : :obj:`string`
+    ecd : str
         The path were the file is stored.
 
-    filename : :obj:`string`
+    filename : str
         The name of the file to send to the ECMWF server.
 
-    target : :obj:`string`
+    target : str
         The target queue where the file should be sent to.
 
-    ecuid : :obj:`string`
+    ecuid : str
         The user id on ECMWF server.
 
-    ecgid : :obj:`string`
+    ecgid : str
         The group id on ECMWF server.
 
@@ -610,13 +621,13 @@
     Parameters
     ----------
-    target : :obj:`string`
+    target : str
         The target where the file should be sent to, e.g. the queue.
 
-    jobname : :obj:`string`
+    jobname : str
         The name of the jobfile to be submitted to the ECMWF server.
 
     Return
     ------
-    job_id : :obj:`int`
+    job_id : int
         The id number of the job as a reference at the ecmwf server.
     '''
@@ -650,10 +661,10 @@
     Parameters
     ----------
-    filename : :obj:`string`
+    filename : str
             Name of the file which will be opened to extract basic information.
 
     Return
     ------
-    data : :obj:`dictionary`
+    data : dict
         Contains basic informations of the ECMWF grib files, e.g.
         'Ni', 'Nj', 'latitudeOfFirstGridPointInDegrees',
@@ -702,5 +713,5 @@
     Parameters
     ----------
-    info : :obj:`dictionary`
+    info : dict
         Contains basic informations of the ECMWF grib files, e.g.
         'Ni', 'Nj', 'latitudeOfFirstGridPointInDegrees',
@@ -709,11 +720,11 @@
         'iDirectionIncrementInDegrees', 'missingValue'
 
-    purefc : :obj:`integer`
+    purefc : int
         Switch for definition of pure forecast mode or not.
 
-    dtime : :obj:`string`
+    dtime : str
         Time step in hours.
 
-    index_vals : :obj:`list`
+    index_vals : list of list of str
         Contains the values from the keys used for a distinct selection
         of grib messages in processing  the grib files.
@@ -723,13 +734,13 @@
         index_vals[2]: ('0', '12', '3', '6', '9') ; stepRange
 
-    start_date : :obj:`string`
+    start_date : str
         The start date of the retrieval job.
 
-    end_date : :obj:`string`
+    end_date : str
         The end date of the retrieval job.
 
     Return
     ------
-    (ix, jy, it) : :obj:`tuple` of :obj:`integer`
+    (ix, jy, it) : tuple of int
         Dimension in x-direction, y-direction and in time.
     '''
@@ -755,5 +766,5 @@
     Parameters
     ----------
-    cmd_list : :obj:`list` of `:obj:`string`
+    cmd_list : list of str
         A list of the components for the command line execution. Each
         list entry is a single part of the command which is seperated from
@@ -763,5 +774,5 @@
     Return
     ------
-    error_msg : :obj:`string`, optional
+    error_msg : str, optional
         The possible error message if the subprocess failed.
         By default it will just tell "SUBPROCESS FAILED!".
