Index: python/CONTROL.temp
===================================================================
--- python/CONTROL.temp	(revision e18f4b5f53f063ab746e1307bdd3162d31cb3e8a)
+++ 	(revision )
@@ -1,40 +1,0 @@
-DAY1
-DAY2
-DTIME 3
-TYPE AN FC FC FC FC FC FC FC FC FC FC FC AN FC FC FC FC FC FC FC FC FC FC FC
-TIME 00 00 00 00 00 00 00 00 00 00 00 00 12 12 12 12 12 12 12 12 12 12 12 12
-STEP 00 01 02 03 04 05 06 07 08 09 10 11 00 01 02 03 04 05 06 07 08 09 10 11
-ACCTYPE FC
-ACCTIME 00/12
-ACCMAXSTEP 12
-CLASS EI
-STREAM OPER
-NUMBER OFF
-EXPVER 1
-GRID 5000  
-LEFT -15000
-LOWER 30000
-UPPER 75000
-RIGHT 45000
-LEVEL 60
-LEVELIST 55/to/60
-RESOL 63
-GAUSS 1
-ACCURACY 16
-OMEGA 0
-OMEGADIFF 0
-ETA 0
-ETADIFF 0
-DPDETA 1
-SMOOTH 0
-FORMAT GRIB1
-ADDPAR 186/187/188/235/139/39
-PREFIX EI
-ECSTORAGE 0
-ECTRANS 1
-ECFSDIR ectmp:/${USER}/econdemand/
-MAILFAIL ${USER} 
-MAILOPS ${USER}
-GRIB2FLEXPART 0
-EOF
-
Index: python/FlexpartTools.py
===================================================================
--- python/FlexpartTools.py	(revision 51f985321699a54b8e5acd7d1975955e45948717)
+++ python/FlexpartTools.py	(revision a9c7f3e683adff09e14197fcd3b46ab149d4f8b7)
@@ -197,5 +197,5 @@
 
     if c.request != '0':
-        marsfile = os.path.join(c.inputdir, 'mars_request.csv')
+        marsfile = os.path.join(c.inputdir, 'mars_requests.csv')
         if os.path.isfile(marsfile):
             os.remove(marsfile)
@@ -578,4 +578,9 @@
             if not hasattr(self,'request'):
                 self.request='0'
+            elif self.request != 0:
+                marsfile = os.path.join(self.inputdir,
+                                        'mars_requests.csv')
+                if os.path.isfile(marsfile):
+                    silentremove(marsfile)
 
         return
@@ -675,9 +680,10 @@
 
         # Get all class attributes and their values as a dictionary
-        attrs = vars(self)
+        attrs = vars(self).copy()
         del attrs['server']
+        del attrs['public']
 
         # open a file to store all requests to
-        with open(os.path.join(inputdir, 'mars_request.csv'), 'a') as f:
+        with open(os.path.join(inputdir, 'mars_requests.csv'), 'a') as f:
             f.write(str(request_number) + ', ')
             f.write(', '.join(str(attrs[key])
@@ -1475,6 +1481,6 @@
                 for k in l:
                     key_vals.append(str(k))
-
-            index_vals.append(key_vals)
+    
+                index_vals.append(key_vals)
 
 
Index: python/getMARSdata.py
===================================================================
--- python/getMARSdata.py	(revision 51f985321699a54b8e5acd7d1975955e45948717)
+++ python/getMARSdata.py	(revision a9c7f3e683adff09e14197fcd3b46ab149d4f8b7)
@@ -58,11 +58,27 @@
     if not os.path.exists(c.inputdir):
         os.makedirs(c.inputdir)
+
+
+    if c.request == 0:
+        print("Retrieving EC data!")
+    else:
+        if c.request == 1:
+            print("Printing mars requests!")
+        elif c.request == 2:
+            print("Retrieving EC data and printing mars request!")
+        # first, write header with the mars parameter to file
+        # create a dummy MarsRetrieval to get parameter
+        MR = MARSretrieval(None, None)
+        attrs = vars(MR).copy()
+        del attrs['server']
+        del attrs['public']
+        marsfile = os.path.join(c.inputdir, 'mars_request.csv')
+        with open(marsfile, 'w') as f:
+            f.write('request_number' + ', ')
+            f.write(', '.join(str(key) for key in sorted(attrs.iterkeys())))
+            f.write('\n')
+
     print "start date %s "%(c.start_date)
     print "end date %s "%(c.end_date)
-    
-    if c.request == '0' or c.request == '2':
-        print("Retrieving EC data!")
-    elif c.request == '1':
-        print("Printing mars requests!")
 
     if ecapi:
@@ -96,5 +112,5 @@
 
     datechunk=datetime.timedelta(days=int(c.date_chunk))
-    if c.request == '0' or c.request == '2':
+    if c.request == '0' or c.request == '2':
         print 'removing content of '+c.inputdir
         tobecleaned=glob.glob(c.inputdir+'/*_acc_*.'+str(os.getppid())+'.*.grb')
@@ -136,9 +152,9 @@
 
     if c.request == '0' or c.request == '2':
-        print 'removing content of '+c.inputdir
+        print 'removing content of '+c.inputdir
         tobecleaned=glob.glob(c.inputdir+'/*__*.'+str(os.getppid())+'.*.grb')
         for f in tobecleaned:
             os.remove(f)
-	    
+
     day=start
     times=None
