Index: Source/Python/Classes/ControlFile.py
===================================================================
--- Source/Python/Classes/ControlFile.py	(revision 44174de31acc10708895185f7beb7568204f0760)
+++ Source/Python/Classes/ControlFile.py	(revision 0f89116d0fc1de9b182758abd84208eb9c6933b5)
@@ -38,12 +38,11 @@
 
 import os
-import re
 import sys
-import inspect
 
 # software specific classes and modules from flex_extract
+#pylint: disable=wrong-import-position
 sys.path.append('../')
 import _config
-from Mods.tools import my_error, silent_remove
+from Mods.tools import my_error
 from Mods.checks import (check_grid, check_area, check_levels, check_purefc,
                          check_step, check_mail, check_queue, check_pathes,
@@ -53,4 +52,5 @@
                          check_logicals_type, check_len_type_time_step,
                          check_addpar, check_job_chunk, check_number)
+#pylint: enable=wrong-import-position
 
 # ------------------------------------------------------------------------------
@@ -65,5 +65,5 @@
     from the MARS archive for driving FLEXPART are set in a CONTROL file.
     Some specific parameters like the start and end dates can be overwritten
-    by the command line parameters, but in generel all parameters needed
+    by the command line parameters, but in generall all parameters needed
     for a complete set of fields for FLEXPART can be set in the CONTROL file.
 
@@ -238,9 +238,4 @@
         Default value is ['${USER}'].
 
-    grib2flexpart : int 0
-        Switch to select generation of preprocessed FLEXPART files ".fp".
-        If it is selected, the program grib2flexpart will try
-        to convert the flex_extract output files into ".fp" format.
-
     ecstorage : int
         Switch to select storage of FLEXPART ready output files
@@ -334,5 +329,5 @@
         List of the names of logical switches which controls the flow
         of the program. Default list is ['gauss', 'omega', 'omegadiff', 'eta',
-        'etadiff', 'dpdeta', 'cwc', 'wrf', 'grib2flexpart', 'ecstorage',
+        'etadiff', 'dpdeta', 'cwc', 'wrf', 'ecstorage',
         'ectrans', 'debug', 'request', 'public', 'purefc', 'rrint', 'doubleelda']
     '''
@@ -400,5 +395,4 @@
         self.mailfail = ['${USER}']
         self.mailops = ['${USER}']
-        self.grib2flexpart = 0
         self.ecstorage = 0
         self.ectrans = 0
@@ -425,5 +419,5 @@
 
         self.logicals = ['gauss', 'omega', 'omegadiff', 'eta', 'etadiff',
-                         'dpdeta', 'cwc', 'wrf', 'grib2flexpart', 'ecstorage',
+                         'dpdeta', 'cwc', 'wrf', 'ecstorage',
                          'ectrans', 'debug', 'oper', 'request', 'public',
                          'purefc', 'rrint', 'doubleelda']
@@ -602,5 +596,7 @@
 
         self.outputdir, self.installdir = check_pathes(self.inputdir,
-             self.outputdir, self.installdir, self.flexextractdir)
+                                                       self.outputdir,
+                                                       self.installdir,
+                                                       self.flexextractdir)
 
         self.start_date, self.end_date = check_dates(self.start_date,
@@ -611,5 +607,5 @@
         self.levelist, self.level = check_levels(self.levelist, self.level)
 
-        self.step = check_step(self.step, self.mailfail)
+        self.step = check_step(self.step)
 
         self.maxstep = check_maxstep(self.maxstep, self.step)
@@ -649,5 +645,5 @@
         self.job_chunk = check_job_chunk(self.job_chunk)
 
-        self.number = check_number(self.number, self.mailfail)
+        self.number = check_number(self.number)
 
         return
@@ -695,3 +691,2 @@
 
         return sorted(l)
-
Index: Source/Python/Classes/EcFlexpart.py
===================================================================
--- Source/Python/Classes/EcFlexpart.py	(revision c77630a97116cfe48788a474eaf76b1887d1479f)
+++ Source/Python/Classes/EcFlexpart.py	(revision 0f89116d0fc1de9b182758abd84208eb9c6933b5)
@@ -53,4 +53,8 @@
 #pylint: disable=consider-using-enumerate
 # this is not useful in this case
+#pylint: disable=unsubscriptable-object
+# this error is a bug
+#pylint: disable=ungrouped-imports
+# not necessary that we group the imports
 # ------------------------------------------------------------------------------
 # MODULES
@@ -62,13 +66,13 @@
 import glob
 import shutil
-import subprocess
 from datetime import datetime, timedelta
 
 # software specific classes and modules from flex_extract
+#pylint: disable=wrong-import-position
 sys.path.append('../')
 import _config
 from Classes.GribUtil import GribUtil
 from Mods.tools import (init128, to_param_id, silent_remove, product,
-                        my_error, make_dir, get_informations, get_dimensions,
+                        my_error, get_informations, get_dimensions,
                         execute_subprocess, to_param_id_with_tablenumber,
                         generate_retrieval_period_boundary)
@@ -76,5 +80,5 @@
 from Classes.UioFiles import UioFiles
 import Mods.disaggregation as disaggregation
-
+#pylint: enable=wrong-import-position
 # ------------------------------------------------------------------------------
 # CLASS
@@ -401,6 +405,6 @@
         else:  # GAUSS and ETA
             print('Warning: Collecting etadot and parameters for gaussian grid '
-                           'is a very costly parameter combination, '
-                           'use this combination only for debugging!')
+                  'is a very costly parameter combination, '
+                  'use this combination only for debugging!')
             self.params['GG__SL'] = ['Q', 'ML', '1',
                                      '{}'.format((int(self.resol) + 1) // 2)]
@@ -415,5 +419,5 @@
 
         # ADDITIONAL FIELDS FOR FLEXPART-WRF MODEL (IF QUESTIONED)
-        # -----------------------------------------------------------------------
+        # ----------------------------------------------------------------------
         if wrf:
             # @WRF
@@ -710,5 +714,6 @@
                     retr_param_dict['date'] = self.dates.split('/')[0]
                     retr_param_dict['target'] = self._mk_targetname('',
-                                            pk, retr_param_dict['date'])
+                                                                    pk,
+                                                                    retr_param_dict['date'])
                 elif pk == 'OG_OROLSM__SL' and oro:
                     continue
@@ -752,5 +757,5 @@
                         if 'acc' in pk:
                             startdate = retr_param_dict['date'].split('/')[0]
-                            enddate = datetime.strftime(elimit - t24h,'%Y%m%d')
+                            enddate = datetime.strftime(elimit - t24h, '%Y%m%d')
                             retr_param_dict['date'] = '/'.join([startdate,
                                                                 'to',
@@ -781,7 +786,7 @@
                         timesave = ''.join(retr_param_dict['time'])
 
-                        if ('/' in retr_param_dict['time'] and
-                            pk != 'OG_OROLSM__SL' and
-                            'acc' not in pk ) :
+                        if all(['/' in retr_param_dict['time'],
+                                pk != 'OG_OROLSM__SL',
+                                'acc' not in pk]):
                             times = retr_param_dict['time'].split('/')
                             steps = retr_param_dict['step'].split('/')
@@ -794,7 +799,7 @@
                                     retr_param_dict['time'] = times[0]
 
-                        if (pk != 'OG_OROLSM__SL' and
-                            int(retr_param_dict['step'].split('/')[0]) == 0 and
-                            int(timesave.split('/')[0]) == 0):
+                        if all([pk != 'OG_OROLSM__SL',
+                                int(retr_param_dict['step'].split('/')[0]) == 0,
+                                int(timesave.split('/')[0]) == 0]):
 
                             retr_param_dict['date'] = \
@@ -810,5 +815,5 @@
                     else:
                         raise ValueError('ERROR: Basetime has an invalid value '
-                                                 '-> {}'.format(str(basetime)))
+                                         '-> {}'.format(str(self.basetime)))
 
         if request == 0 or request == 2:
@@ -860,21 +865,21 @@
 
             stream = namelist_template.generate(
-                maxl = str(maxl),
-                maxb = str(maxb),
-                mlevel = str(self.level),
-                mlevelist = str(self.levelist),
-                mnauf = str(self.resol),
-                metapar = '77',
-                rlo0 = str(area[1]),
-                rlo1 = str(area[3]),
-                rla0 = str(area[2]),
-                rla1 = str(area[0]),
-                momega = str(c.omega),
-                momegadiff = str(c.omegadiff),
-                mgauss = str(c.gauss),
-                msmooth = str(c.smooth),
-                meta = str(c.eta),
-                metadiff = str(c.etadiff),
-                mdpdeta = str(c.dpdeta)
+                maxl=str(maxl),
+                maxb=str(maxb),
+                mlevel=str(self.level),
+                mlevelist=str(self.levelist),
+                mnauf=str(self.resol),
+                metapar='77',
+                rlo0=str(area[1]),
+                rlo1=str(area[3]),
+                rla0=str(area[2]),
+                rla1=str(area[0]),
+                momega=str(c.omega),
+                momegadiff=str(c.omegadiff),
+                mgauss=str(c.gauss),
+                msmooth=str(c.smooth),
+                meta=str(c.eta),
+                metadiff=str(c.etadiff),
+                mdpdeta=str(c.dpdeta)
             )
         except UndefinedError as e:
@@ -928,5 +933,5 @@
         '''
         import numpy as np
-        from eccodes import (codes_index_select, codes_new_from_index, codes_get,
+        from eccodes import (codes_index_select, codes_get,
                              codes_get_values, codes_set_values, codes_set,
                              codes_write, codes_release, codes_new_from_index,
@@ -1053,5 +1058,4 @@
             step = codes_get(gid, 'step') # integer
             ctime = '{:0>2}'.format(time)
-            cstep = '{:0>3}'.format(step)
 
             t_date = datetime.strptime(cdate + ctime, '%Y%m%d%H')
@@ -1132,5 +1136,5 @@
                     deac_vals[parId].append(
                         (orig_vals[parId][-1] - orig_vals[parId][-2]) /
-                         int(c.dtime))
+                        int(c.dtime))
 
                 # store precipitation if new disaggregation method is selected
@@ -1332,10 +1336,10 @@
             for inum in range(maxnum):
                 for ix in range(ni*nj):
-                    lsp_new_np[inum,ix,:] = disaggregation.IA3(lsp_np[inum,ix,:])[:-1]
-                    cp_new_np[inum,ix,:] = disaggregation.IA3(cp_np[inum,ix,:])[:-1]
+                    lsp_new_np[inum, ix, :] = disaggregation.IA3(lsp_np[inum, ix, :])[:-1]
+                    cp_new_np[inum, ix, :] = disaggregation.IA3(cp_np[inum, ix, :])[:-1]
         else:
             for ix in range(ni*nj):
-                lsp_new_np[0,ix,:] = disaggregation.IA3(lsp_np[ix,:])[:-1]
-                cp_new_np[0,ix,:] = disaggregation.IA3(cp_np[ix,:])[:-1]
+                lsp_new_np[0, ix, :] = disaggregation.IA3(lsp_np[ix, :])[:-1]
+                cp_new_np[0, ix, :] = disaggregation.IA3(cp_np[ix, :])[:-1]
 
         # write to grib files (full/orig times to flux file and inbetween
@@ -1402,44 +1406,50 @@
             # write original time step to flux file as usual
             fluxfile = GribUtil(os.path.join(c.inputdir, fluxfilename))
-            fluxfile.set_keys(tmpfile, filemode='ab', strict=True,
+            fluxfile.set_keys(tmpfile, filemode='ab',
                               wherekeynames=['paramId'], wherekeyvalues=[142],
-                              keynames=['perturbationNumber','date','time','stepRange','values'],
+                              keynames=['perturbationNumber', 'date', 'time',
+                                        'stepRange', 'values'],
                               keyvalues=[inumb, int(date.strftime('%Y%m%d')),
-                                         date.hour*100, 0, lsp_new_np[inumb,:,it]],
+                                         date.hour*100, 0, lsp_new_np[inumb, :, it]],
                              )
-            fluxfile.set_keys(tmpfile, filemode='ab', strict=True,
+            fluxfile.set_keys(tmpfile, filemode='ab',
                               wherekeynames=['paramId'], wherekeyvalues=[143],
-                              keynames=['perturbationNumber','date','time','stepRange','values'],
-                              keyvalues=[inumb,int(date.strftime('%Y%m%d')),
-                                         date.hour*100, 0, cp_new_np[inumb,:,it]]
+                              keynames=['perturbationNumber', 'date', 'time',
+                                        'stepRange', 'values'],
+                              keyvalues=[inumb, int(date.strftime('%Y%m%d')),
+                                         date.hour*100, 0, cp_new_np[inumb, :, it]]
                              )
 
             # rr for first subgrid point is identified by step = 1
-            fluxfile.set_keys(tmpfile, filemode='ab', strict=True,
+            fluxfile.set_keys(tmpfile, filemode='ab',
                               wherekeynames=['paramId'], wherekeyvalues=[142],
-                              keynames=['perturbationNumber','date','time','stepRange','values'],
-                              keyvalues=[inumb,int(date.strftime('%Y%m%d')),
-                                         date.hour*100, '1', lsp_new_np[inumb,:,it+1]]
-                              )
-            fluxfile.set_keys(tmpfile, filemode='ab', strict=True,
+                              keynames=['perturbationNumber', 'date', 'time',
+                                        'stepRange', 'values'],
+                              keyvalues=[inumb, int(date.strftime('%Y%m%d')),
+                                         date.hour*100, '1', lsp_new_np[inumb, :, it+1]]
+                             )
+            fluxfile.set_keys(tmpfile, filemode='ab',
                               wherekeynames=['paramId'], wherekeyvalues=[143],
-                              keynames=['perturbationNumber','date','time','stepRange','values'],
-                              keyvalues=[inumb,int(date.strftime('%Y%m%d')),
-                                         date.hour*100, '1', cp_new_np[inumb,:,it+1]]
-                              )
+                              keynames=['perturbationNumber', 'date', 'time',
+                                        'stepRange', 'values'],
+                              keyvalues=[inumb, int(date.strftime('%Y%m%d')),
+                                         date.hour*100, '1', cp_new_np[inumb, :, it+1]]
+                             )
 
             # rr for second subgrid point is identified by step = 2
-            fluxfile.set_keys(tmpfile, filemode='ab', strict=True,
+            fluxfile.set_keys(tmpfile, filemode='ab',
                               wherekeynames=['paramId'], wherekeyvalues=[142],
-                              keynames=['perturbationNumber','date','time','stepRange','values'],
-                              keyvalues=[inumb,int(date.strftime('%Y%m%d')),
-                                         date.hour*100, '2', lsp_new_np[inumb,:,it+2]]
-                              )
-            fluxfile.set_keys(tmpfile, filemode='ab', strict=True,
+                              keynames=['perturbationNumber', 'date', 'time',
+                                        'stepRange', 'values'],
+                              keyvalues=[inumb, int(date.strftime('%Y%m%d')),
+                                         date.hour*100, '2', lsp_new_np[inumb, :, it+2]]
+                             )
+            fluxfile.set_keys(tmpfile, filemode='ab',
                               wherekeynames=['paramId'], wherekeyvalues=[143],
-                              keynames=['perturbationNumber','date','time','stepRange','values'],
-                              keyvalues=[inumb,int(date.strftime('%Y%m%d')),
-                                         date.hour*100, '2', cp_new_np[inumb,:,it+2]]
-                              )
+                              keynames=['perturbationNumber', 'date', 'time',
+                                        'stepRange', 'values'],
+                              keyvalues=[inumb, int(date.strftime('%Y%m%d')),
+                                         date.hour*100, '2', cp_new_np[inumb, :, it+2]]
+                             )
 
             it = it + 3 # jump to next original time step in rr fields
@@ -1463,11 +1473,11 @@
         '''
 
-        gribfile = GribUtil(os.path.join(inputdir,'rr_grib_dummy.grb'))
+        gribfile = GribUtil(os.path.join(inputdir, 'rr_grib_dummy.grb'))
 
         gribfile.copy_dummy_msg(ifile, keynames=['paramId'],
-                      keyvalues=[142], filemode='wb')
+                                keyvalues=[142], filemode='wb')
 
         gribfile.copy_dummy_msg(ifile, keynames=['paramId'],
-                      keyvalues=[143], filemode='ab')
+                                keyvalues=[143], filemode='ab')
 
         return
@@ -1501,5 +1511,5 @@
 
         '''
-        from eccodes import (codes_index_select, codes_new_from_index, codes_get,
+        from eccodes import (codes_index_select, codes_get,
                              codes_get_values, codes_set_values, codes_set,
                              codes_write, codes_release, codes_new_from_index,
@@ -1583,20 +1593,18 @@
             cdate_hour = datetime.strftime(timestamp, '%Y%m%d%H')
 
+            # if basetime is used, adapt start/end date period
+            if c.basetime is not None:
+                time_delta = timedelta(hours=12-int(c.dtime))
+                start_period = datetime.strptime(c.end_date + str(c.basetime),
+                                               '%Y%m%d%H') - time_delta
+                end_period = datetime.strptime(c.end_date + str(c.basetime),
+                                             '%Y%m%d%H')
+
             # skip all temporary times
-            # which are outside the retrieval period
+            # which are outside the retrieval period                
             if timestamp < start_period or \
                timestamp > end_period:
                 continue
-
-            # if the timestamp is out of basetime start/end date period,
-            # skip this specific product
-            if c.basetime is not None:
-                time_delta = timedelta(hours=12-int(c.dtime))
-                start_time = datetime.strptime(c.end_date + str(c.basetime),
-                                                '%Y%m%d%H') - time_delta
-                end_time = datetime.strptime(c.end_date + str(c.basetime),
-                                             '%Y%m%d%H')
-                if timestamp < start_time or timestamp > end_time:
-                    continue
+                
 
             # @WRF
@@ -1620,5 +1628,4 @@
                 paramId = codes_get(gid, 'paramId')
                 gridtype = codes_get(gid, 'gridType')
-                levtype = codes_get(gid, 'typeOfLevel')
                 if paramId == 77: # ETADOT
                     codes_write(gid, fdict['21'])
@@ -1704,5 +1711,5 @@
             # Fortran program creates file fort.15 (with u,v,etadot,t,sp,q)
             execute_subprocess([os.path.join(c.exedir,
-                                _config.FORTRAN_EXECUTABLE)],
+                                             _config.FORTRAN_EXECUTABLE)],
                                error_msg='FORTRAN PROGRAM FAILED!')#shell=True)
 
@@ -1733,5 +1740,7 @@
             # to the outputfile (final GRIB input files for FLEXPART)
             orolsm = os.path.basename(glob.glob(c.inputdir +
-                                        '/OG_OROLSM__SL.*.' + c.ppid + '*')[0])
+                                                '/OG_OROLSM__SL.*.' +
+                                                c.ppid +
+                                                '*')[0])
             fluxfile = 'flux' + cdate[0:2] + suffix
             if not c.cwc:
@@ -1783,6 +1792,6 @@
         '''
         from eccodes import (codes_grib_new_from_file, codes_get_array,
-                             codes_set_array, codes_release, codes_set_values,
-                             codes_set, codes_write, codes_release)
+                             codes_set_array, codes_release,
+                             codes_set, codes_write)
 
         # max number
@@ -1790,10 +1799,10 @@
 
         # get a list of all prepared output files with control forecast (CF)
-        CF_filelist = UioFiles(path, prefix + '*.N000')
-        CF_filelist.files = sorted(CF_filelist.files)
-
-        for cffile in CF_filelist.files:
+        cf_filelist = UioFiles(path, prefix + '*.N000')
+        cf_filelist.files = sorted(cf_filelist.files)
+
+        for cffile in cf_filelist.files:
             with open(cffile, 'rb') as f:
-                cfvalues=[]
+                cfvalues = []
                 while True:
                     fid = codes_grib_new_from_file(f)
@@ -1900,3 +1909,2 @@
 
         return
-
Index: Source/Python/Classes/GribUtil.py
===================================================================
--- Source/Python/Classes/GribUtil.py	(revision c77630a97116cfe48788a474eaf76b1887d1479f)
+++ Source/Python/Classes/GribUtil.py	(revision 0f89116d0fc1de9b182758abd84208eb9c6933b5)
@@ -68,5 +68,5 @@
 
 
-    def get_keys(self, keynames, wherekeynames=[], wherekeyvalues=[]):
+    def get_keys(self, keynames, wherekeynames, wherekeyvalues):
         '''Get keyvalues for a given list of keynames a where statement
         can be given (list of key and list of values)
@@ -77,9 +77,9 @@
             List of keynames.
 
-        wherekeynames : :obj:`list` of :obj:`string`, optional
-            Default value is an empty list.
-
-        wherekeyvalues : :obj:`list` of :obj:`string`, optional
-            Default value is an empty list.
+        wherekeynames : :obj:`list` of :obj:`string`
+            List of key names for indexing grib message parameter.
+
+        wherekeyvalues : :obj:`list` of :obj:`string`
+            List of key values corresponding the key names.
 
         Return
@@ -122,6 +122,6 @@
 
 
-    def set_keys(self, fromfile, keynames, keyvalues, wherekeynames=[],
-                 wherekeyvalues=[], strict=False, filemode='wb'):
+    def set_keys(self, fromfile, keynames, keyvalues, wherekeynames,
+                 wherekeyvalues, filemode='wb'):
         '''Opens the file to read the grib messages and then write
         the selected messages (with wherekeys) to a new output file.
@@ -141,16 +141,9 @@
             Default is an empty list.
 
-        wherekeynames : :obj:`list` of :obj:`string`, optional
+        wherekeynames : :obj:`list` of :obj:`string`
             List of keynames to select correct message.
-            Default value is an empty list.
-
-        wherekeyvalues : :obj:`list` of :obj:`string`, optional
+
+        wherekeyvalues : :obj:`list` of :obj:`string`
             List of keyvalues for keynames to select correct message.
-            Default value is an empty list.
-
-        strict : :obj:`boolean`, optional
-            Decides if everything from keynames and keyvalues
-            is written out the grib file (False) or only those
-            meeting the where statement (True). Default is False.
 
         filemode : :obj:`string`, optional
@@ -200,6 +193,6 @@
         return
 
-    def copy_dummy_msg(self, filename_in, selectWhere=True,
-                 keynames=[], keyvalues=[], filemode='wb'):
+    def copy_dummy_msg(self, filename_in, keynames, keyvalues,
+                       selectwhere=True, filemode='wb'):
         '''Add the content of another input grib file to the objects file but
         only messages corresponding to keys/values passed to the function.
@@ -212,14 +205,14 @@
             Filename of the input file to read the grib messages from.
 
-        selectWhere : :obj:`boolean`, optional
+        selectwhere : :obj:`boolean`, optional
             Decides if to copy the keynames and values equal to (True) or
             different to (False) the keynames/keyvalues list passed to the
             function. Default is True.
 
-        keynames : :obj:`list` of :obj:`string`, optional
-            List of keynames. Default is an empty list.
-
-        keyvalues : :obj:`list` of :obj:`string`, optional
-            List of keyvalues. Default is an empty list.
+        keynames : :obj:`list` of :obj:`string`
+            List of keynames.
+
+        keyvalues : :obj:`list` of :obj:`string`
+            List of keyvalues.
 
         filemode : :obj:`string`, optional
@@ -254,5 +247,5 @@
                     raise Exception("Key was not defined")
 
-                if selectWhere:
+                if selectwhere:
                     select = (select and (str(keyvalues[i]) ==
                                           str(codes_get(gid, key))))
@@ -272,5 +265,5 @@
         return
 
-    def index(self, index_keys=["mars"], index_file="my.idx"):
+    def index(self, index_keys, index_file="my.idx"):
         '''Create index file from a list of files if it does not exist or
         read an index file.
@@ -278,8 +271,7 @@
         Parameters
         ----------
-        index_keys: :obj:`list` of :obj:`string`, optional
+        index_keys: :obj:`list` of :obj:`string`
             Contains the list of key parameter names from
             which the index is to be created.
-            Default is a list with a single entry string "mars".
 
         index_file: :obj:`string`, optional
Index: Source/Python/Classes/MarsRetrieval.py
===================================================================
--- Source/Python/Classes/MarsRetrieval.py	(revision c77630a97116cfe48788a474eaf76b1887d1479f)
+++ Source/Python/Classes/MarsRetrieval.py	(revision 0f89116d0fc1de9b182758abd84208eb9c6933b5)
@@ -42,6 +42,8 @@
 
 # software specific classes and modules from flex_extract
+#pylint: disable=wrong-import-position
 sys.path.append('../')
 import _config
+#pylint: disable=invalid-name
 try:
     ec_api = True
@@ -55,4 +57,6 @@
 except ImportError:
     cds_api = False
+#pylint: enable=invalid-name
+#pylint: enable=wrong-import-position
 # ------------------------------------------------------------------------------
 # CLASS
@@ -510,5 +514,4 @@
                 print('\n\nMARS Request failed!')
                 print(e)
-                tb = sys.exc_info()[2]
                 print(traceback.format_exc())
                 sys.exit()
Index: Source/Python/Classes/UioFiles.py
===================================================================
--- Source/Python/Classes/UioFiles.py	(revision 44174de31acc10708895185f7beb7568204f0760)
+++ Source/Python/Classes/UioFiles.py	(revision 0f89116d0fc1de9b182758abd84208eb9c6933b5)
@@ -42,6 +42,8 @@
 
 # software specific modules from flex_extract
+#pylint: disable=wrong-import-position
 sys.path.append('../')
 from Mods.tools import silent_remove, get_list_as_string
+#pylint: enable=wrong-import-position
 
 # ------------------------------------------------------------------------------
@@ -50,5 +52,5 @@
 
 class UioFiles(object):
-    '''Collection of files matching a specific pattern.
+    """Collection of files matching a specific pattern.
 
     The pattern can contain regular expressions for the files.
@@ -62,14 +64,14 @@
 
     pattern : str
-        Regular expression pattern. For example: '\*.grb'
+        Regular expression pattern. For example: '*.grb'
 
     files : list of str
         List of files matching the pattern in the path.
-    '''
+    """
     # --------------------------------------------------------------------------
     # CLASS METHODS
     # --------------------------------------------------------------------------
     def __init__(self, path, pattern):
-        '''Assignes a specific pattern for these files.
+        """Assignes a specific pattern for these files.
 
         Parameters
@@ -79,10 +81,10 @@
 
         pattern : str
-            Regular expression pattern. For example: '\*.grb'
+            Regular expression pattern. For example: '*.grb'
 
         Return
         ------
 
-        '''
+        """
 
         self.path = path
@@ -96,5 +98,5 @@
 
     def _list_files(self, path):
-        '''Lists all files in the directory with the matching
+        """Lists all files in the directory with the matching
         regular expression pattern.
 
@@ -107,9 +109,10 @@
         ------
 
-        '''
+        """
         # Get the absolute path
         path = os.path.abspath(path)
 
         # get all files in the dir and subdir as absolut path
+	    # pylint: disable=W0612
         for root, dirnames, filenames in os.walk(path):
             for filename in fnmatch.filter(filenames, self.pattern):
@@ -120,5 +123,5 @@
 
     def __str__(self):
-        '''Converts the list of files into a single string.
+        """Converts the list of files into a single string.
         The entries are sepereated by "," sign.
 
@@ -130,5 +133,5 @@
         files_string : str
             The content of the list as a single string.
-        '''
+        """
 
         filenames = [os.path.basename(f) for f in self.files]
@@ -139,5 +142,5 @@
 
     def delete_files(self):
-        '''Deletes the files.
+        """Deletes the files.
 
         Parameters
@@ -147,5 +150,5 @@
         ------
 
-        '''
+        """
 
         for old_file in self.files:
Index: Source/Python/Mods/checks.py
===================================================================
--- Source/Python/Mods/checks.py	(revision 44174de31acc10708895185f7beb7568204f0760)
+++ Source/Python/Mods/checks.py	(revision 0f89116d0fc1de9b182758abd84208eb9c6933b5)
@@ -29,11 +29,14 @@
 import os
 import sys
-
-import _config
+from datetime import datetime
+# pylint: disable=unused-import
 try:
     import exceptions
 except ImportError:
     import builtins as exceptions
-from datetime import datetime
+# pylint: enable=unused-import
+
+# software specific classes and modules from flex_extract
+import _config
 from Mods.tools import my_error, silent_remove
 # ------------------------------------------------------------------------------
@@ -113,5 +116,5 @@
     return grid
 
-def check_area(grid, area, upper, lower, left , right):
+def check_area(grid, area, upper, lower, left, right):
     '''Defines the correct area string.
 
@@ -158,8 +161,8 @@
 
     # determine area format
-    if ((abs(float(upper) / 10000.) >= 0.01 or float(upper) / 1000. == 0. ) and
-        (abs(float(lower) / 10000.) >= 0.01 or float(lower) / 1000. == 0. ) and
-        (abs(float(left) / 10000.) >= 0.01 or float(left) / 1000. == 0. ) and
-        (abs(float(right) / 10000.) >= 0.01 or float(right) / 1000. == 0.)):
+    if all([(abs(float(upper) / 10000.) >= 0.01 or float(upper) / 1000. == 0.),
+            (abs(float(lower) / 10000.) >= 0.01 or float(lower) / 1000. == 0.),
+            (abs(float(left) / 10000.) >= 0.01 or float(left) / 1000. == 0.),
+            (abs(float(right) / 10000.) >= 0.01 or float(right) / 1000. == 0.)]):
         # area is defined in 1/1000 degrees; old format
         area = '{}/{}/{}/{}'.format(float(upper) / 1000.,
@@ -167,8 +170,8 @@
                                     float(lower) / 1000.,
                                     float(right) / 1000.)
-    elif (abs(float(upper) / 10000.) < 0.05 and
-          abs(float(lower) / 10000.) < 0.05 and
-          abs(float(left) / 10000.) < 0.05 and
-          abs(float(right) / 10000.) < 0.05):
+    elif all([abs(float(upper) / 10000.) < 0.05,
+              abs(float(lower) / 10000.) < 0.05,
+              abs(float(left) / 10000.) < 0.05,
+              abs(float(right) / 10000.) < 0.05]):
         # area is already in new format
         area = '{}/{}/{}/{}'.format(float(upper),
@@ -180,5 +183,5 @@
                          'formats (upper, lower, left, right): '
                          '{}/{}/{}/{}'.format(str(upper), str(lower),
-                                              str(left) , str(right)))
+                                              str(left), str(right)))
 
     return area
@@ -281,5 +284,5 @@
 
 
-def check_step(step, mailfail):
+def check_step(step):
     '''Checks on step format and convert into a list of steps.
 
@@ -293,9 +296,4 @@
         Specifies the forecast time step from forecast base time.
         Valid values are hours (HH) from forecast base time.
-
-    mailfail : list of str
-        Contains all email addresses which should be notified.
-        It might also contain just the ecmwf user name which will trigger
-        mailing to the associated email address for this user.
 
     Return
@@ -405,5 +403,5 @@
         Valid values are hours (HH) from forecast base time.
     '''
-    if not (len(ftype) == len(ftime) == len(steps)):
+    if not len(ftype) == len(ftime) == len(steps):
         raise ValueError('ERROR: The number of field types, times and steps '
                          'are not the same! Please check the setting in the '
@@ -553,5 +551,5 @@
                          'in CONTROL file.\n'
                          'Try "{} -h" to print usage information'
-                         .format(sys.argv[0].split('/')[-1]) )
+                         .format(sys.argv[0].split('/')[-1]))
 
     # retrieve just one day if end_date isn't set
@@ -790,6 +788,6 @@
             accmaxstep = maxstep
             print('... For pure forecast mode, the accumulated forecast must '
-                          'have the same maxstep as the normal forecast fields!\n'
-                          '\t\t Accmaxstep was set to maxstep!')
+                  'have the same maxstep as the normal forecast fields!\n'
+                  '\t\t Accmaxstep was set to maxstep!')
     return accmaxstep
 
@@ -851,5 +849,5 @@
 
 
-def check_number(number, mailfail):
+def check_number(number):
     '''Check for correct string format of ensemble member numbers.
 
@@ -858,9 +856,4 @@
     number : str
         List of ensemble member forecast runs.
-
-    mailfail : list of str
-        Contains all email addresses which should be notified.
-        It might also contain just the ecmwf user name which will trigger
-        mailing to the associated email address for this user.
 
     Return
Index: Source/Python/Mods/disaggregation.py
===================================================================
--- Source/Python/Mods/disaggregation.py	(revision 44174de31acc10708895185f7beb7568204f0760)
+++ Source/Python/Mods/disaggregation.py	(revision 0f89116d0fc1de9b182758abd84208eb9c6933b5)
@@ -247,5 +247,5 @@
             # geometric mean, restricted such that non-negativity is guaranteed
             # according to Eq. (25)
-            fip1=min( 3.*g[i] , 3.*g[i+1] , np.sqrt(g[i+1]*g[i]) )
+            fip1 = min(3. * g[i], 3. * g[i + 1], np.sqrt(g[i + 1] * g[i]))
 
             # the function value at the first sub-grid point (fi1) is determined
@@ -281,8 +281,8 @@
                 # the monotonicity filter corrects the value at (fim1) by
                 # substituting (fim1) with (fmon), see Eq. (27), (28) and (29)
-                fmon = min(3.*g[i-2], \
-                           3.*g[i-1], \
-                           np.sqrt(max(0,(18./13.*g[i-2] - 5./13.*f[-7]) *
-                                         (18./13.*g[i-1] - 5./13.*f[-1]))))
+                fmon = min(3. * g[i - 2],
+                           3. * g[i - 1],
+                           np.sqrt(max(0, (18. / 13. * g[i - 2] - 5. / 13. * f[-7]) *
+                                       (18. / 13. * g[i - 1] - 5. / 13. * f[-1]))))
 
                 # recomputation of the sub-grid interval values while the
@@ -295,5 +295,5 @@
                 f[-2] = f[-3]+(f[-1]-fmon)/3.
 
-            f.extend([0.,0.,0.])
+            f.extend([0., 0., 0.])
 
         # otherwise the sub-grid values are calculated and added to the list
@@ -306,5 +306,5 @@
             # geometric mean, restricted such that non-negativity is guaranteed
             # according to Eq. (25)
-            fip1 = min( 3.*g[i] , 3.*g[i+1] , np.sqrt(g[i+1]*g[i]) )
+            fip1 = min(3. * g[i], 3. * g[i + 1], np.sqrt(g[i + 1] * g[i]))
 
             # the function value at the first sub-grid point (fi1) is determined
@@ -324,8 +324,8 @@
                 # the monotonicity filter corrects the value at (fim1) by
                 # substituting (fim1) with fmon, see Eq. (27), (28) and (29)
-                fmon = min(3.*g[i-2], \
-                           3.*g[i-1], \
-                           np.sqrt(max(0,(18./13.*g[i-2] - 5./13.*f[-7]) *
-                                         (18./13.*g[i-1] - 5./13.*f[-1]))))
+                fmon = min(3. * g[i - 2],
+                           3. * g[i - 1],
+                           np.sqrt(max(0, (18. / 13. * g[i - 2] - 5. / 13. * f[-7]) *
+                                       (18. / 13. * g[i - 1] - 5. / 13. * f[-1]))))
 
                 # recomputation of the sub-grid interval values while the
@@ -358,8 +358,8 @@
             # the monotonicity filter corrects the value at (fim1) by
             # substituting (fim1) with (fmon), see Eq. (27), (28) and (29)
-            fmon = min(3.*g[-3], \
-                       3.*g[-2], \
-                       np.sqrt(max(0,(18./13.*g[-3] - 5./13.*f[-7]) *
-                                     (18./13.*g[-2] - 5./13.*f[-1]))))
+            fmon = min(3. * g[-3],
+                       3. * g[-2],
+                       np.sqrt(max(0, (18. / 13. * g[-3] - 5. / 13. * f[-7]) *
+                                   (18. / 13. * g[-2] - 5. / 13. * f[-1]))))
 
             # recomputation of the sub-grid interval values while the
@@ -372,5 +372,5 @@
             f[-2] = f[-3]+(f[-1]-fmon)/3.
 
-        f.extend([0.,0.,0.])
+        f.extend([0., 0., 0.])
 
     # otherwise the sub-grid values are calculated and added to the list
@@ -397,8 +397,8 @@
             # the monotonicity filter corrects the value at (fim1) by
             # substituting (fim1) with (fmon), see Eq. (27), (28) and (29)
-            fmon = min(3.*g[-3], \
-                       3.*g[-2], \
-                       np.sqrt(max(0,(18./13.*g[-3] - 5./13.*f[-7]) *
-                                     (18./13.*g[-2] - 5./13.*f[-1]))))
+            fmon = min(3. * g[-3],
+                       3. * g[-2],
+                       np.sqrt(max(0, (18. / 13. * g[-3] - 5. / 13. * f[-7]) *
+                                   (18. / 13. * g[-2] - 5. / 13. * f[-1]))))
 
             # recomputation of the sub-grid interval values while the
Index: Source/Python/Mods/get_mars_data.py
===================================================================
--- Source/Python/Mods/get_mars_data.py	(revision 44174de31acc10708895185f7beb7568204f0760)
+++ Source/Python/Mods/get_mars_data.py	(revision 0f89116d0fc1de9b182758abd84208eb9c6933b5)
@@ -70,11 +70,12 @@
 sys.path.append(os.path.dirname(os.path.abspath(
     inspect.getfile(inspect.currentframe()))) + '/../')
+# pylint: disable=wrong-import-position
 import _config
-from Mods.tools import (setup_controldata, my_error, normal_exit, get_cmdline_args,
-                   read_ecenv, make_dir)
+from Mods.tools import (setup_controldata, my_error, normal_exit, make_dir)
 from Classes.EcFlexpart import EcFlexpart
 from Classes.UioFiles import UioFiles
 from Classes.MarsRetrieval import MarsRetrieval
-
+# pylint: enable=wrong-import-position
+# pylint: disable=invalid-name
 try:
     ec_api = True
@@ -88,4 +89,5 @@
 except ImportError:
     cds_api = False
+# pylint: enable=invalid-name
 # ------------------------------------------------------------------------------
 # FUNCTION
@@ -223,7 +225,20 @@
 
 def check_dates_for_nonflux_fc_times(types, times):
-    '''
-    '''
-    for ty, ti in zip(types,times):
+    '''Checks if the time 18UTC corresponds to forecast field.
+
+    Parameters
+    ----------
+    types : list of str
+        List of field types.
+
+    times : list of str or str
+        The time in hours of the field.
+
+    Return
+    ------
+    True or False
+
+    '''
+    for ty, ti in zip(types, times):
         if ty.upper() == 'FC' and int(ti) == 18:
             return True
@@ -245,5 +260,5 @@
 
     Since for basetime the extraction contains the 12 hours upfront,
-    if basetime is 0, the starting date has to be the day before and
+    if basetime is 0, the starting date has to be the day before
 
     Parameters
Index: Source/Python/Mods/prepare_flexpart.py
===================================================================
--- Source/Python/Mods/prepare_flexpart.py	(revision 44174de31acc10708895185f7beb7568204f0760)
+++ Source/Python/Mods/prepare_flexpart.py	(revision 0f89116d0fc1de9b182758abd84208eb9c6933b5)
@@ -38,5 +38,7 @@
 #    http://creativecommons.org/licenses/by/4.0/ or send a letter to
 #    Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
-#*******************************************************************************
+# *******************************************************************************
+# pylint: disable=ungrouped-imports
+# not necessary that we group the imports
 '''This script prepares the final version of the grib files which are
 then used by FLEXPART.
@@ -68,5 +70,4 @@
 import inspect
 import sys
-import socket
 
 # software specific classes and modules from flex_extract
@@ -74,11 +75,12 @@
 sys.path.append(os.path.dirname(os.path.abspath(
     inspect.getfile(inspect.currentframe()))) + '/../')
-import _config
+# pylint: disable=wrong-import-position
+#import _config
 from Mods.checks import check_ppid
 from Classes.UioFiles import UioFiles
-from Classes.ControlFile import ControlFile
-from Mods.tools import (setup_controldata, clean_up, get_cmdline_args,
-                        read_ecenv, make_dir, normal_exit)
+#from Classes.ControlFile import ControlFile
+from Mods.tools import (setup_controldata, clean_up, make_dir, normal_exit)
 from Classes.EcFlexpart import EcFlexpart
+# pylint: enable=wrong-import-position
 
 # ------------------------------------------------------------------------------
@@ -146,5 +148,5 @@
 
     print('Prepare ' + start.strftime("%Y%m%d") +
-           "/to/" + end.strftime("%Y%m%d"))
+          '/to/' + end.strftime("%Y%m%d"))
 
     # create output dir if necessary
@@ -171,9 +173,4 @@
     flexpart.process_output(c)
 
-    # make use of a possible conversion to a
-    # specific flexpart binary format
-    if c.grib2flexpart:
-        flexpart.prepare_fp_files(c)
-
     # check if in debugging mode, then store all files
     # otherwise delete temporary files
Index: Source/Python/Mods/profiling.py
===================================================================
--- Source/Python/Mods/profiling.py	(revision 8463d78e072ae26108ea1d2a66211aa8ac9f9e72)
+++ Source/Python/Mods/profiling.py	(revision 0f89116d0fc1de9b182758abd84208eb9c6933b5)
@@ -37,10 +37,10 @@
 # FUNCTION
 # ------------------------------------------------------------------------------
-def timefn(fn):
+def timefn(func):
     '''
     @Description:
         Decorator function. It takes the inner function as an argument.
     '''
-    @wraps(fn)
+    @wraps(func)
     def measure_time(*args, **kwargs):
         '''
@@ -65,8 +65,9 @@
         '''
 
-        t1 = time.time()
-        result = fn(*args, **kwargs)
-        t2 = time.time()
-        print("@timefn:" + fn.__name__ + " took " + str(t2 - t1) + " seconds")
+        time1 = time.time()
+        result = func(*args, **kwargs)
+        time2 = time.time()
+        print("@timefn:" + func.__name__ + " took " +
+              str(time2 - time1) + " seconds")
 
         return result
Index: Source/Python/Mods/tools.py
===================================================================
--- Source/Python/Mods/tools.py	(revision c77630a97116cfe48788a474eaf76b1887d1479f)
+++ Source/Python/Mods/tools.py	(revision 0f89116d0fc1de9b182758abd84208eb9c6933b5)
@@ -69,8 +69,10 @@
 import subprocess
 import traceback
+# pylint: disable=unused-import
 try:
     import exceptions
 except ImportError:
     import builtins as exceptions
+# pylint: enable=unused-import
 from datetime import datetime, timedelta
 from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
@@ -268,5 +270,5 @@
         and destination for ECMWF server environments.
     '''
-    envs= {}
+    envs = {}
     try:
         with open(filepath, 'r') as f:
@@ -279,5 +281,5 @@
 
         sys.exit('\n... Error occured while trying to read ECMWF_ENV '
-                     'file: ' + str(filepath))
+                 'file: ' + str(filepath))
 
     return envs
@@ -302,6 +304,7 @@
     print("... clean inputdir!")
 
-    cleanlist = [file for file in glob.glob(os.path.join(c.inputdir, "*"))
-                 if not os.path.basename(file).startswith(c.prefix)]
+    cleanlist = [filename for filename in
+                 glob.glob(os.path.join(c.inputdir, "*"))
+                 if not os.path.basename(filename).startswith(c.prefix)]
 
     if cleanlist:
@@ -371,5 +374,5 @@
                                  stderr=subprocess.PIPE,
                                  bufsize=1)
-            pout = p.communicate(input=message.encode() + '\n\n')[0]
+            pout = p.communicate(input=message + '\n\n')[0]
         except ValueError as e:
             print('... ERROR: ' + str(e))
@@ -531,5 +534,5 @@
         return []
     if not isinstance(pars, str):
-        pars=str(pars)
+        pars = str(pars)
 
     cpar = pars.upper().split('/')
@@ -575,5 +578,5 @@
         return []
     if not isinstance(pars, str):
-        pars=str(pars)
+        pars = str(pars)
 
     cpar = pars.upper().split('/')
@@ -768,6 +771,5 @@
 
         # information needed from grib message
-        keys = [
-                'Ni',
+        keys = ['Ni',
                 'Nj',
                 'latitudeOfFirstGridPointInDegrees',
@@ -783,6 +785,6 @@
         for key in keys:
             # Get the value of the key in a grib message.
-            data[key] = codes_get(gid,key)
-            print("%s = %s" % (key,data[key]))
+            data[key] = codes_get(gid, key)
+            print("%s = %s" % (key, data[key]))
 
         # Free the memory for the message referred as gribid.
Index: Source/Python/_config.py
===================================================================
--- Source/Python/_config.py	(revision 44174de31acc10708895185f7beb7568204f0760)
+++ Source/Python/_config.py	(revision 0f89116d0fc1de9b182758abd84208eb9c6933b5)
@@ -54,5 +54,5 @@
 
 FILE_MARS_REQUESTS = 'mars_requests.csv'
-FORTRAN_EXECUTABLE = 'CONVERT2'
+FORTRAN_EXECUTABLE = 'calc_etadot'
 TEMPFILE_USER_ENVVARS = 'ECMWF_ENV.template'
 FILE_USER_ENVVARS = 'ECMWF_ENV'
@@ -97,5 +97,5 @@
 PATH_PYTHONTEST_SRC = os.path.join(PATH_SOURCES, 'Pythontest')
 PATH_INPUT_DIR = os.path.join(PATH_RUN_DIR, INPUT_DIRNAME_DEFAULT)
-PATH_TEST = os.path.join(PATH_FLEXEXTRACT_DIR, 'Test')
+PATH_TEST = os.path.join(PATH_FLEXEXTRACT_DIR, 'Testing')
 if os.getenv('CONTROL'):
     # this is only needed if (gateway) version with job script is used!
Index: Source/Python/install.py
===================================================================
--- Source/Python/install.py	(revision 3a41083aa834ffe9cdeaad10a82afc1df7c835cc)
+++ Source/Python/install.py	(revision 0f89116d0fc1de9b182758abd84208eb9c6933b5)
@@ -68,7 +68,5 @@
 import os
 import sys
-import glob
 import subprocess
-import inspect
 import tarfile
 from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
@@ -179,14 +177,11 @@
 
     '''
-    import tarfile
 
     tarball_name = _config.FLEXEXTRACT_DIRNAME + '.tar'
     tar_file = os.path.join(_config.PATH_FLEXEXTRACT_DIR, tarball_name)
 
-    mk_compilejob(c.makefile, c.install_target, c.ecuid, c.ecgid,
-                  c.installdir)
-
-    mk_job_template(c.ecuid, c.ecgid, c.gateway,
-                    c.destination, c.installdir)
+    mk_compilejob(c.makefile, c.ecuid, c.ecgid, c.installdir)
+
+    mk_job_template(c.ecuid, c.ecgid, c.installdir)
 
     mk_env_vars(c.ecuid, c.ecgid, c.gateway, c.destination)
@@ -205,5 +200,5 @@
     print('Job compilation script has been submitted to ecgate for ' +
           'installation in ' + c.installdir +
-           '/' + _config.FLEXEXTRACT_DIRNAME)
+          '/' + _config.FLEXEXTRACT_DIRNAME)
     print('You should get an email with subject "flexcompile" within ' +
           'the next few minutes!')
@@ -224,10 +219,9 @@
 
     '''
-    import tarfile
 
     tar_file = os.path.join(_config.PATH_FLEXEXTRACT_DIR,
                             _config.FLEXEXTRACT_DIRNAME + '.tar')
 
-    if c.installdir == _config.PATH_FLEXEXTRACT_DIR :
+    if c.installdir == _config.PATH_FLEXEXTRACT_DIR:
         print('WARNING: installdir has not been specified')
         print('flex_extract will be installed in here by compiling the ' +
@@ -241,10 +235,10 @@
             mk_tarball(tar_file, c.install_target)
             make_dir(os.path.join(c.installdir,
-                                   _config.FLEXEXTRACT_DIRNAME))
+                                  _config.FLEXEXTRACT_DIRNAME))
             os.chdir(os.path.join(c.installdir,
-                                   _config.FLEXEXTRACT_DIRNAME))
+                                  _config.FLEXEXTRACT_DIRNAME))
             un_tarball(tar_file)
             os.chdir(os.path.join(c.installdir,
-                                   _config.FLEXEXTRACT_DIRNAME,
+                                  _config.FLEXEXTRACT_DIRNAME,
                                   _config.PATH_REL_FORTRAN_SRC))
 
@@ -286,5 +280,5 @@
         print('target: ', c.install_target)
         print('please specify correct installation target ' +
-              str(INSTALL_TARGETS))
+              str(_config.INSTALL_TARGETS))
         print('use -h or --help for help')
         sys.exit(1)
@@ -334,5 +328,4 @@
 
     '''
-    from glob import glob
 
     print('Create tarball ...')
@@ -345,31 +338,31 @@
     # get lists of the files to be added to the tar file
     if target == 'local':
-        ECMWF_ENV_FILE = []
+        ecmwf_env_file = []
         runfile = [os.path.relpath(x, ecd)
                    for x in UioFiles(_config.PATH_REL_RUN_DIR,
                                      'run_local.sh').files]
     else:
-        ECMWF_ENV_FILE = [_config.PATH_REL_ECMWF_ENV]
+        ecmwf_env_file = [_config.PATH_REL_ECMWF_ENV]
         runfile = [os.path.relpath(x, ecd)
-                       for x in UioFiles(_config.PATH_REL_RUN_DIR,
-                                         'run.sh').files]
+                   for x in UioFiles(_config.PATH_REL_RUN_DIR,
+                                     'run.sh').files]
 
     pyfiles = [os.path.relpath(x, ecd)
                for x in UioFiles(_config.PATH_REL_PYTHON_SRC, '*py').files]
     pytestfiles = [os.path.relpath(x, ecd)
-               for x in UioFiles(_config.PATH_REL_PYTHONTEST_SRC, '*py').files]
+                   for x in UioFiles(_config.PATH_REL_PYTHONTEST_SRC, '*py').files]
     controlfiles = [os.path.relpath(x, ecd)
                     for x in UioFiles(_config.PATH_REL_CONTROLFILES,
                                       'CONTROL*').files]
     testfiles = [os.path.relpath(x, ecd)
-                 for x in UioFiles(_config.PATH_REL_TEST , '*').files]
+                 for x in UioFiles(_config.PATH_REL_TEST, '*').files]
     tempfiles = [os.path.relpath(x, ecd)
-                 for x in UioFiles(_config.PATH_REL_TEMPLATES , '*.temp').files]
+                 for x in UioFiles(_config.PATH_REL_TEMPLATES, '*.temp').files]
     nlfiles = [os.path.relpath(x, ecd)
-                 for x in UioFiles(_config.PATH_REL_TEMPLATES , '*.nl').files]
+               for x in UioFiles(_config.PATH_REL_TEMPLATES, '*.nl').files]
     gribtable = [os.path.relpath(x, ecd)
-                 for x in UioFiles(_config.PATH_REL_TEMPLATES , '*grib*').files]
+                 for x in UioFiles(_config.PATH_REL_TEMPLATES, '*grib*').files]
     ffiles = [os.path.relpath(x, ecd)
-              for x in UioFiles(_config.PATH_REL_FORTRAN_SRC, '*.f*').files]
+              for x in UioFiles(_config.PATH_REL_FORTRAN_SRC, '*.f90').files]
     hfiles = [os.path.relpath(x, ecd)
               for x in UioFiles(_config.PATH_REL_FORTRAN_SRC, '*.h').files]
@@ -380,21 +373,23 @@
     # concatenate single lists to one for a better looping
     filelist = pyfiles + pytestfiles + controlfiles + tempfiles + nlfiles + \
-               ffiles + gribtable + hfiles + makefiles + ECMWF_ENV_FILE + \
+               ffiles + gribtable + hfiles + makefiles + ecmwf_env_file + \
                runfile + jobdir + testfiles +\
                ['CODE_OF_CONDUCT.md', 'LICENSE.md', 'README.md']
 
     # create installation tar-file
-    exclude_files = [".ksh"]
+    exclude_files = [".ksh", ".tar"]
     try:
         with tarfile.open(tarball_path, "w:gz") as tar_handle:
-            for file in filelist:
-                tar_handle.add(file, recursive=False,
+            for filename in filelist:
+                tar_handle.add(filename, recursive=False,
                                filter=lambda tarinfo: None
-                                      if os.path.splitext(tarinfo.name)[1]
-                                         in exclude_files
-                                      else tarinfo)
+                               if os.path.splitext(tarinfo.name)[1]
+                               in exclude_files
+                               else tarinfo)
     except tarfile.TarError as e:
+        print('... ERROR: ' + str(e))
+
         sys.exit('\n... error occured while trying to create the tar-file ' +
-                     str(tarball_path))
+                 str(tarball_path))
 
     return
@@ -422,5 +417,5 @@
     except tarfile.TarError as e:
         sys.exit('\n... error occured while trying to read tar-file ' +
-                     str(tarball_path))
+                 str(tarball_path))
     except OSError as e:
         print('... ERROR CODE: ' + str(e.errno))
@@ -465,9 +460,9 @@
                                          cls=NewTextTemplate)
 
-        stream = ecmwfvars_template.generate(user_name = ecuid,
-                                             user_group = ecgid,
-                                             gateway_name = gateway,
-                                             destination_name = destination
-                                             )
+        stream = ecmwfvars_template.generate(user_name=ecuid,
+                                             user_group=ecgid,
+                                             gateway_name=gateway,
+                                             destination_name=destination
+                                            )
     except UndefinedError as e:
         print('... ERROR ' + str(e))
@@ -494,5 +489,5 @@
     return
 
-def mk_compilejob(makefile, target, ecuid, ecgid, fp_root):
+def mk_compilejob(makefile, ecuid, ecgid, fp_root):
     '''Modifies the original job template file so that it is specified
     for the user and the environment were it will be applied. Result
@@ -505,7 +500,4 @@
         CONVERT2 program.
 
-    target : str
-        The target where the installation should be done, e.g. the queue.
-
     ecuid : str
         The user id on ECMWF server.
@@ -535,10 +527,10 @@
 
         stream = compile_template.generate(
-            usergroup = ecgid,
-            username = ecuid,
-            version_number = _config._VERSION_STR,
-            fp_root_scripts = fp_root,
-            makefile = makefile,
-            fortran_program = _config.FORTRAN_EXECUTABLE
+            usergroup=ecgid,
+            username=ecuid,
+            version_number=_config._VERSION_STR,
+            fp_root_scripts=fp_root,
+            makefile=makefile,
+            fortran_program=_config.FORTRAN_EXECUTABLE
         )
     except UndefinedError as e:
@@ -569,5 +561,5 @@
     return
 
-def mk_job_template(ecuid, ecgid, gateway, destination, fp_root):
+def mk_job_template(ecuid, ecgid, fp_root):
     '''Modifies the original job template file so that it is specified
     for the user and the environment were it will be applied. Result
@@ -581,11 +573,4 @@
     ecgid : str
         The group id on ECMWF server.
-
-    gateway : str
-        The gateway server the user is using.
-
-    destination : str
-        The remote destination which is used to transfer files
-        from ECMWF server to local gateway server.
 
     fp_root : str
@@ -615,8 +600,8 @@
 
         stream = compile_template.generate(
-            usergroup = ecgid,
-            username = ecuid,
-            version_number = _config._VERSION_STR,
-            fp_root_path = fp_root_path_to_python,
+            usergroup=ecgid,
+            username=ecuid,
+            version_number=_config._VERSION_STR,
+            fp_root_path=fp_root_path_to_python,
         )
     except UndefinedError as e:
@@ -711,7 +696,7 @@
         print(e)
     else:
-        execute_subprocess(['ls', '-l', os.path.join(src_path,
-                            _config.FORTRAN_EXECUTABLE)], error_msg=
-                           'FORTRAN EXECUTABLE COULD NOT BE FOUND!')
+        execute_subprocess(['ls', '-l',
+                            os.path.join(src_path, _config.FORTRAN_EXECUTABLE)],
+                           error_msg='FORTRAN EXECUTABLE COULD NOT BE FOUND!')
 
     return
Index: Source/Python/submit.py
===================================================================
--- Source/Python/submit.py	(revision 44174de31acc10708895185f7beb7568204f0760)
+++ Source/Python/submit.py	(revision 0f89116d0fc1de9b182758abd84208eb9c6933b5)
@@ -64,16 +64,13 @@
 import os
 import sys
-import subprocess
-import inspect
-import collections
 from datetime import datetime, timedelta
 
 # software specific classes and modules from flex_extract
 import _config
-from Mods.tools import (setup_controldata, normal_exit, get_cmdline_args,
-                         submit_job_to_ecserver, read_ecenv)
+from Mods.tools import (setup_controldata, normal_exit,
+                        submit_job_to_ecserver)
 from Mods.get_mars_data import get_mars_data
 from Mods.prepare_flexpart import prepare_flexpart
-from Classes.ControlFile import ControlFile
+#from Classes.ControlFile import ControlFile
 
 
