Index: preproc/python/FlexpartTools.py
===================================================================
--- preproc/python/FlexpartTools.py	(revision 57637935b8c736ecb0a376df5e8f6a044bbd05af)
+++ preproc/python/FlexpartTools.py	(revision 0e29ef4eb4cd16392d60ff1219d9909ad606ea59)
@@ -353,7 +353,9 @@
         index_keys=["date","time","stepRange"]
         indexfile="date_time_stepRange.idx"
+        silentremove(indexfile)
         grib=GribTools(inputfiles.files)
         iid=grib.index(index_keys=index_keys, index_file = indexfile)
 
+        print 'index done...' 
         silentremove("fort.10")
         silentremove("fort.11")
@@ -389,4 +391,5 @@
                 step = grib_get(gid, 'stepRange')
                 cflextime = self.getFlexpartTime(type,step, time)
+#                print 'cyear '+cyear+'/'+cmonth+'/'+'/EI'+cyear[2:4]+cmonth+cday+cflextime
             while 1:  
                 if gid is None: break
@@ -420,4 +423,5 @@
 # create the corresponding output file  fort.15 (generated by CONVERT2) + fort.16 (paramId 167 and paramId 168)  
                 mkdir_p(outputdir+'/'+cyear+'/'+cmonth+'/')
+                print "outputdir = " + outputdir+'/'+cyear+'/'+cmonth+'/'+'/EI'+cyear[2:4]+cmonth+cday+cflextime
                 fout = open(outputdir+'/'+cyear+'/'+cmonth+'/EI'+cyear[2:4]+cmonth+cday+cflextime,'wb')    
                 shutil.copyfileobj(open('fort.15','rb'), fout)     
@@ -427,5 +431,14 @@
         grib_index_release(iid)
 
-    def clean(self):
+    def __del__(self):
         print "clean"
-
+        silentremove("fort.10")
+        silentremove("fort.11")
+        silentremove("fort.12")
+        silentremove("fort.13")
+        silentremove("fort.15")
+        silentremove("fort.16")
+        silentremove("fort.18")
+        silentremove("VERTICAL.EC")
+        silentremove("date_time_stepRange.idx")
+
Index: preproc/python/GribTools.py
===================================================================
--- preproc/python/GribTools.py	(revision 57637935b8c736ecb0a376df5e8f6a044bbd05af)
+++ preproc/python/GribTools.py	(revision 0e29ef4eb4cd16392d60ff1219d9909ad606ea59)
@@ -118,4 +118,5 @@
 # Create index from a list of files if it does not exist or read it
     def index(self,index_keys=["mars"], index_file = "my.idx"):
+        print "index to be done" 
         self.iid = None
  
Index: preproc/python/getEIdata.py
===================================================================
--- preproc/python/getEIdata.py	(revision 57637935b8c736ecb0a376df5e8f6a044bbd05af)
+++ preproc/python/getEIdata.py	(revision 0e29ef4eb4cd16392d60ff1219d9909ad606ea59)
@@ -92,9 +92,5 @@
     for date in daterange( start, end ):
 # if new year & month then we create a new directory to store output files
-        er_date = date
-        if date.strftime("%Y%m") != current_ym:
-            current_outputdir =  outputdir + "/"  + date.strftime("%Y") + '/' + date.strftime("%m") + '/' 
-            mkdir_p(current_outputdir)
-            if current_ym != "":
+        if date.strftime("%Y%m") != current_ym and current_ym != "":
                retrieve="yes"
 
@@ -106,6 +102,12 @@
                 flexpart = EIFlexpart()
                 dates= ir_date.strftime("%Y%m%d") + "/to/" + er_date.strftime("%Y%m%d") 
+                current_outputdir =  outputdir + "/"  + ir_date.strftime("%Y") + '/' + ir_date.strftime("%m") + '/' 
+                mkdir_p(current_outputdir)
+                print "retrieve " + dates + " in dir " + current_outputdir
                 flexpart.retrieve(server, dates, options.times, options.area, options.levels, current_outputdir)
-                ir_date = er_date
+                ir_date = date
+                retrieve="no"
+
+        er_date = date
 
         current_ym =  date.strftime("%Y%m")
Index: preproc/python/prepareFLEXPART.py
===================================================================
--- preproc/python/prepareFLEXPART.py	(revision 57637935b8c736ecb0a376df5e8f6a044bbd05af)
+++ preproc/python/prepareFLEXPART.py	(revision 0e29ef4eb4cd16392d60ff1219d9909ad606ea59)
@@ -90,5 +90,5 @@
 # data retrieved by year/month
            if cyear != date.year or cmonth != date.month:
-             print 'year : ' + str(date.year) + ' month : ', date.month
+             print 'Prepare year : ' + str(date.year) + ' month : ', date.month
              cyear = date.year
              cmonth = date.month
@@ -102,4 +102,5 @@
              flexpart = EIFlexpart()
              flexpart.create(inputfiles, outputdir)
+             
 
 if __name__ == "__main__":
Index: preproc/src/makefile_gfortran
===================================================================
--- preproc/src/makefile_gfortran	(revision 0e29ef4eb4cd16392d60ff1219d9909ad606ea59)
+++ preproc/src/makefile_gfortran	(revision 0e29ef4eb4cd16392d60ff1219d9909ad606ea59)
@@ -0,0 +1,56 @@
+###############################################################################
+#
+# Top level Makefile for ECMWFDATA software
+#
+# Last modified:  August 20, 2013
+#
+###############################################################################
+
+.SUFFIXES: .o .c .f .f90 .f95 .F 
+
+
+.f90.o:	
+	$(F90C) -c $(F90FLAGS)  $<
+
+
+TARGET_ARCH =
+OPT	= -g -O
+DEBUG	= -g -O
+LIB     = 
+FC=gfortran  -m64  -fdefault-real-8 -fcray-pointer -fno-second-underscore  -ffixed-line-length-132 -fopenmp -fconvert=big-endian  -fmax-stack-var-size=100000000 
+F90C=gfortran   -m64 -fdefault-real-8 -fcray-pointer -fno-second-underscore  -ffixed-line-length-132 -fopenmp  -fconvert=big-endian  -fmax-stack-var-size=100000000 
+GRIB_API_INCLUDE = $(GRIB_API_FFLAGS)
+GRIB_API_LIB = $(GRIB_API_LDFLAGS)
+FFLAGS =  $(OPT) $(DEBUG) -I. $(GRIB_API_INCLUDE)
+F90FLAGS =  $(OPT) $(DEBUG)  -I. $(GRIB_API_INCLUDE)
+LDFLAGS =  $(OPT) $(DEBUG)
+EMOSLIB=$(EMOS_LDFLAGS) 
+LIB =  $(EMOSLIB)  $(GRIB_API_LIB) -lgcc -lm -fdefault-integer-8  -lgfortran -ljasper 
+
+F90=$(F90C)
+
+BINDIR  =      .
+
+EXE	=	CONVERT2
+
+all:	${EXE}
+
+clean:
+	rm *.o *.mod ${EXE} 
+
+phgrreal.o: phgrreal.f90
+	$(F90) -c -g -O3 -fopenmp phgrreal.f90
+
+grphreal.o: grphreal.f90
+	$(F90) -c -g -O3 -fopenmp grphreal.f90
+
+ftrafo.o: ftrafo.f90
+	$(F90) -c -g -O3 -fopenmp ftrafo.f90
+
+CONVERT2:	phgrreal.o grphreal.o ftrafo.o rwGRIB2.o  preconvert.o
+	$(F90) $(DEBUG) $(OPT) -o CONVERT2 ftrafo.o phgrreal.o grphreal.o rwGRIB2.o preconvert.o ${LIB}
+
+#
+# End of the Makefile
+#
+###############################################################################
Index: preproc/src/makefile_intel
===================================================================
--- preproc/src/makefile_intel	(revision 0e29ef4eb4cd16392d60ff1219d9909ad606ea59)
+++ preproc/src/makefile_intel	(revision 0e29ef4eb4cd16392d60ff1219d9909ad606ea59)
@@ -0,0 +1,57 @@
+###############################################################################
+#
+# Top level Makefile for ECMWFDATA software
+#
+# Last modified:  August 20, 2013
+#
+###############################################################################
+
+.SUFFIXES: .o .c .f .f90 .f95 .F 
+
+
+.f90.o:	
+	$(F90C) -c $(F90FLAGS)  $<
+
+
+TARGET_ARCH =
+OPT	= -g -O
+DEBUG	= -g -O
+LIB     = 
+FC=ifort   -O2 -m64 -mcmodel=medium  -safe-cray-ptr -real-size 64 -openmp
+F90C=ifort    -O2 -m64 -mcmodel=medium  -safe-cray-ptr -real-size 64 -openmp
+GRIB_API_INCLUDE = $(GRIB_API_FFLAGS)
+GRIB_API_LIB = $(GRIB_API_LDFLAGS)
+FFLAGS =  $(OPT) $(DEBUG) -I. $(GRIB_API_INCLUDE)
+F90FLAGS =  $(OPT) $(DEBUG)  -I. $(GRIB_API_INCLUDE)
+LDFLAGS =  $(OPT) $(DEBUG)
+EMOS_LDFLAGS = -L/cluster/software/src/openifs/emos_000392 -lemosR64
+EMOSLIB=$(EMOS_LDFLAGS) 
+LIB =  $(EMOSLIB)  $(GRIB_API_LIB) -lgcc -lm -lgfortran -ljasper -openmp 
+
+F90=$(F90C)
+
+BINDIR  =      .
+
+EXE	=	CONVERT2
+
+all:	${EXE}
+
+clean:
+	rm *.o *.mod ${EXE} 
+
+phgrreal.o: phgrreal.f90
+	$(F90) -c -g -O3 -fopenmp phgrreal.f90
+
+grphreal.o: grphreal.f90
+	$(F90) -c -g -O3 -fopenmp grphreal.f90
+
+ftrafo.o: ftrafo.f90
+	$(F90) -c -g -O3 -fopenmp ftrafo.f90
+
+CONVERT2:	phgrreal.o grphreal.o ftrafo.o rwGRIB2.o  preconvert.o
+	$(F90) $(DEBUG) $(OPT) -o CONVERT2 ftrafo.o phgrreal.o grphreal.o rwGRIB2.o preconvert.o ${LIB}
+
+#
+# End of the Makefile
+#
+###############################################################################
