Index: source/python/classes/ControlFile.py
===================================================================
--- source/python/classes/ControlFile.py	(revision 5bad6ecd8c2b5597cc84f56143c36adc3ad18530)
+++ source/python/classes/ControlFile.py	(revision 0e576fcaf0dab8e7e586efa1a4b9b194ee90f8bb)
@@ -113,4 +113,7 @@
         self.time = None
         self.step = None
+        self.acctype = None
+        self.acctime = None
+        self.accmaxstep = None
         self.marsclass = None
         self.dataset = None
@@ -118,4 +121,5 @@
         self.number = 'OFF'
         self.expver = '1'
+        self.gaussian = ''
         self.grid = None
         self.area = ''
@@ -346,5 +350,5 @@
         # check for having at least a starting date
         # otherwise program is not allowed to run
-        if self.start_date is None:
+        if not self.start_date:
             print('start_date specified neither in command line nor \
                    in CONTROL file ' +  self.controlfile)
@@ -354,5 +358,5 @@
 
         # retrieve just one day if end_date isn't set
-        if self.end_date is None:
+        if not self.end_date:
             self.end_date = self.start_date
 
@@ -365,15 +369,26 @@
 
         # assure consistency of levelist and level
-        if self.levelist is None and self.level is None:
+        # up-to-date available maximum level numbers at ECMWF, 05.10.2018
+        max_level_list = [16, 19, 31, 40, 50, 60, 62, 91, 137]
+        if not self.levelist and not self.level:
             print('Warning: neither levelist nor level \
                                specified in CONTROL file')
             sys.exit(1)
-        elif self.levelist is None and self.level:
+        elif not self.levelist and self.level:
             self.levelist = '1/to/' + self.level
-        elif (self.levelist and self.level is None) or \
+        elif (self.levelist and not self.level) or \
              (self.levelist[-1] != self.level[-1]):
             self.level = self.levelist.split('/')[-1]
         else:
             pass
+
+        # check if max level is a valid level
+        if int(self.level) not in max_level_list:
+            print('ERROR: ')
+            print('LEVEL must be the maximum level of a specified '
+                  'level list from ECMWF, e.g.')
+            print('[16, 19, 31, 40, 50, 60, 62, 91 or 137]')
+            print('Check parameter "LEVEL" or the max level of "LEVELIST"!')
+            sys.exit(1)
 
         # if area was provided (only from commandline)
@@ -404,5 +419,5 @@
         # if maxstep wasn't provided
         # search for it in the "step" parameter
-        if self.maxstep is None:
+        if not self.maxstep:
             self.maxstep = 0
             for s in self.step:
@@ -461,4 +476,38 @@
                   'the "dataset"-parameter has to be set in the control file!')
             sys.exit(1)
+
+        if not isinstance(self.type, list):
+            self.type = [self.type]
+
+        for i, val in enumerate(self.type):
+            if self.type[i] == 'AN' and int(self.step[i]) != 0:
+                print('Analysis retrievals must have STEP = 0 (is set to 0)')
+                self.type[i] = 0
+
+        if not isinstance(self.time, list):
+            self.time = [self.time]
+
+        if not isinstance(self.step, list):
+            self.step = [self.step]
+
+        if not self.acctype:
+            print('... Control paramter ACCTYPE was not defined.')
+            try:
+                if len(self.type) > 1 and self.type[1] != 'AN':
+                    print('Use old setting by using TYPE[1] for flux forecast!')
+                    self.acctype = self.type[1]
+            except:
+                print('Use default value "FC" for flux forecast!')
+                self.acctype='FC'
+
+        if not self.acctime:
+            print('... Control paramter ACCTIME was not defined.')
+            print('Use default value "00/12" for flux forecast!')
+            self.acctime='00/12'
+
+        if not self.accmaxstep:
+            print('... Control paramter ACCMAXSTEP was not defined.')
+            print('Use default value "12" for flux forecast!')
+            self.accmaxstep='12'
 
         return
Index: source/python/classes/EcFlexpart.py
===================================================================
--- source/python/classes/EcFlexpart.py	(revision 5bad6ecd8c2b5597cc84f56143c36adc3ad18530)
+++ source/python/classes/EcFlexpart.py	(revision 0e576fcaf0dab8e7e586efa1a4b9b194ee90f8bb)
@@ -135,5 +135,5 @@
 
         if c.maxstep > len(c.type):    # Pure forecast mode
-            c.type = [c.type[1]]
+            c.type = [c.type[0]]
             c.step = ['{:0>3}'.format(int(c.step[0]))]
             c.time = [c.time[0]]
@@ -155,6 +155,7 @@
             # the initialisation times of the flux fields
             # and therefore are zero all the time)
-            self.types[c.type[1]] = {'times': '00/12', 'steps':
-                                     '{}/to/12/by/{}'.format(c.dtime, c.dtime)}
+            self.types[str(c.acctype)] = {'times': str(c.acctime),
+                                          'steps': '{}/to/{}/by/{}'.format(
+                                              c.dtime, c.accmaxstep, c.dtime)}
         else:
             for ty, st, ti in zip(c.type, c.step, c.time):
@@ -165,5 +166,10 @@
                     btlist = [13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 0]
 
-                if i % int(c.dtime) == 0 and (i in btlist or c.maxstep > 24):
+                if ((ty.upper() == 'AN' and
+                     int(c.time[i]) % int(c.dtime) ==0) or
+                    (ty.upper() != 'AN' and
+                     int(c.step[i]) % int(c.dtime) == 0 and
+                     int(c.step[i]) % int(c.dtime) == 0) ) and \
+                    (int(c.time[i]) in btlist or c.maxstep > 24):
 
                     if ty not in self.types.keys():
@@ -191,9 +197,5 @@
         # for gaussian grid retrieval
         self.glevelist = '1/to/' + c.level
-
-        if hasattr(c, 'gaussian') and c.gaussian:
-            self.gaussian = c.gaussian
-        else:
-            self.gaussian = ''
+        self.gaussian = c.gaussian
 
         if 'N' in c.grid:  # Gaussian output grid
@@ -239,6 +241,10 @@
                 self.params['OG__SL'][0] += '/' + '/'.join(c.addpar)
 
-            self.params['OG_OROLSM__SL'] = ["160/27/28/173", \
-                                            'SFC', '1', self.grid]
+            if c.marsclass.upper() == 'EA' or c.marsclass.upper() == 'EP':
+                self.params['OG_OROLSM__SL'] = ["160/27/28/244",
+                                                'SFC', '1', self.grid]
+            else:
+                self.params['OG_OROLSM__SL'] = ["160/27/28/173", \
+                                                'SFC', '1', self.grid]
 
             self.params['OG__ML'] = ['T/Q', 'ML', self.levelist, self.grid]
@@ -543,5 +549,7 @@
                 if pk == 'OG_OROLSM__SL' and not oro:
                     oro = True
-                    retr_param_dict['stream'] = 'OPER'
+                    # in CERA20C (class EP) there is no stream "OPER"!
+                    if self.marsclass.upper() != 'EP':
+                        retr_param_dict['stream'] = 'OPER'
                     retr_param_dict['type'] = 'AN'
                     retr_param_dict['time'] = '00'
@@ -834,5 +842,6 @@
                     values = (np.reshape(values, (nj, ni))).flatten() / fak
                     vdp.append(values[:])  # save the accumulated values
-                    if step <= int(c.dtime):
+                    if c.marsclass.upper() == 'EA' or \
+                       step <= int(c.dtime):
                         svdp.append(values[:] / int(c.dtime))
                     else:  # deaccumulate values
Index: source/python/classes/MarsRetrieval.py
===================================================================
--- source/python/classes/MarsRetrieval.py	(revision 5bad6ecd8c2b5597cc84f56143c36adc3ad18530)
+++ source/python/classes/MarsRetrieval.py	(revision 0e576fcaf0dab8e7e586efa1a4b9b194ee90f8bb)
@@ -463,5 +463,5 @@
         # find all keys without a value and convert all other values to strings
         empty_keys = []
-        for key, value in attrs.itteritems():
+        for key, value in attrs.iteritems():
             if value == '':
                 empty_keys.append(str(key))
@@ -486,13 +486,14 @@
                 print("ERROR: ", e)
                 print('MARS Request failed!')
-            if not self.public and os.stat(target).st_size == 0:
-                print('MARS Request returned no data - please check request')
-                raise IOError
-            elif self.public and os.stat(target).st_size == 0:
-                print('Public MARS Request returned no data - '
-                      'please check request')
-                raise IOError
-            else:
-                raise IOError
+                if not self.public and os.stat(target).st_size == 0:
+                    print('MARS Request returned no data - '
+                          'please check request')
+                    raise IOError
+                elif self.public and os.stat(target).st_size == 0:
+                    print('Public MARS Request returned no data - '
+                          'please check request')
+                    raise IOError
+                else:
+                    raise IOError
         # MARS request via extra process in shell
         else:
@@ -515,6 +516,4 @@
                 print('MARS Request returned no data - please check request')
                 raise IOError
-            else:
-                raise
 
         return
