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'
