Index: XIOS/dev/dev_ym/XIOS_COUPLING/xios_test_suite/TEST_SUITE/step2.py
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/xios_test_suite/TEST_SUITE/step2.py	(revision 2231)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/xios_test_suite/TEST_SUITE/step2.py	(revision 2281)
@@ -13,4 +13,5 @@
 mode=os.getenv("mode")
 arch=os.getenv("arch")
+enable_mem_track=os.getenv("enable_mem_track")
 svnr=os.getenv("svnR")
 ref_location=os.getenv("ref_location")
@@ -73,4 +74,19 @@
 
     for test_folder in test_folder_list:
+        report_filename=""
+        # check if test concerns xios features (NetCDF), or memory consumption (mem files)
+        files_list=""
+        flist = open(test_folder+"/checkfile.def", 'r')
+        files_list = flist.read()
+        flist.close()
+        if ( enable_mem_track==None ) and ( not('.mem' in files_list) ) :
+            report_filename = "report_"+svnr+"_"+arch+"_"+mode+".txt"
+        elif ( enable_mem_track=='--memtrack full' ) and ( '.mem' in files_list ) :
+            #report_filename = "report_"+svnr+"_"+arch+"_"+mode+"_memtrack.txt"
+            # -> use same report that for feature test
+            report_filename = "report_"+svnr+"_"+arch+"_"+mode+".txt"
+        else :
+            continue
+
         config_list = glob.glob(test_folder+"/CONFIG_*")
         
@@ -79,5 +95,5 @@
             checkfiles = list(nonblank_lines(fh))
 
-        with open("report_"+svnr+"_"+arch+"_"+mode+".txt", "a") as report:
+        with open(report_filename, "a") as report:
             for config in config_list:
                 folder_name = list(config.split("/"))[0]
@@ -85,31 +101,41 @@
                 for checkfile in checkfiles:
                     if os.path.exists(config+"/"+checkfile) and os.path.exists("reference/ref_"+config+"/"+checkfile):
-                        #OSinfo("cdo -W diffn "+config+"/"+checkfile+" "+"reference/ref_"+config+"/"+checkfile+"  2>&1 |grep -v 'Found more than one time variable'|grep -v 'cdo diffn: Processed'|grep -v 'cdo    diffn: Processed'|grep -v 'Time variable >time_counter< not found!' > diff_"+checkfile+".txt")
-                        #if os.stat("diff_"+checkfile+".txt").st_size==0: # if no diff -> set 0
-                        #    report.write(folder_name+" "+folder_name+"@"+config_name+" "+folder_name+"@"+config_name+"@"+checkfile+" "+str(1)+"\n")
-                        #else: # if cdo diffn returns diff -> set -1
-                        #    report.write(folder_name+" "+folder_name+"@"+config_name+" "+folder_name+"@"+config_name+"@"+checkfile+" "+str(-1)+"\n")
-                        ref = Dataset( "reference/ref_"+config+"/"+checkfile )
-                        res = Dataset( config+"/"+checkfile )
-                        validated = 1
-                        np.seterr(divide='ignore', invalid='ignore')
-                        for var in res.variables:
-                            if (not (var.startswith('lon_'))) and (not (var.startswith('lat_'))) and (not (var.startswith('time_'))) and (not (var.startswith('atm__'))):
-                                ref_interp = ref.variables[var]
-                                ref_array = ref_interp[:]
-                                res_interp = res.variables[var]
-                                res_array = res_interp[:]
-                                if (res_array.shape == ref_array.shape):
-                                    diff = np.zeros_like( ref_array )
-                                    np.divide(ref_array-res_array,ref_array,diff,where=(ref_array[:]>10**-15))
-                                    if ( np.max(np.abs(diff)) >  1*10**-9 ):
+                        if ( enable_mem_track==None ) and ( not('.mem' in files_list) ): # NetCDF
+                            #OSinfo("cdo -W diffn "+config+"/"+checkfile+" "+"reference/ref_"+config+"/"+checkfile+"  2>&1 |grep -v 'Found more than one time variable'|grep -v 'cdo diffn: Processed'|grep -v 'cdo    diffn: Processed'|grep -v 'Time variable >time_counter< not found!' > diff_"+checkfile+".txt")
+                            #if os.stat("diff_"+checkfile+".txt").st_size==0: # if no diff -> set 0
+                            #    report.write(folder_name+" "+folder_name+"@"+config_name+" "+folder_name+"@"+config_name+"@"+checkfile+" "+str(1)+"\n")
+                            #else: # if cdo diffn returns diff -> set -1
+                            #    report.write(folder_name+" "+folder_name+"@"+config_name+" "+folder_name+"@"+config_name+"@"+checkfile+" "+str(-1)+"\n")
+                            ref = Dataset( "reference/ref_"+config+"/"+checkfile )
+                            res = Dataset( config+"/"+checkfile )
+                            validated = 1
+                            np.seterr(divide='ignore', invalid='ignore')
+                            for var in res.variables:
+                                if (not (var.startswith('lon_'))) and (not (var.startswith('lat_'))) and (not (var.startswith('time_'))) and (not (var.startswith('atm__'))):
+                                    ref_interp = ref.variables[var]
+                                    ref_array = ref_interp[:]
+                                    res_interp = res.variables[var]
+                                    res_array = res_interp[:]
+                                    if (res_array.shape == ref_array.shape):
+                                        diff = np.zeros_like( ref_array )
+                                        np.divide(ref_array-res_array,ref_array,diff,where=(ref_array[:]>10**-15))
+                                        if ( np.max(np.abs(diff)) >  1*10**-9 ):
+                                            validated = -1
+                                        diff = np.zeros_like( ref_array )
+                                        np.divide(ref_array-res_array,res_array,diff,where=(ref_array[:]>10**-15))
+                                        if ( np.max(np.abs(diff)) >  1*10**-9 ):
+                                            validated = -1
+                                    else:
                                         validated = -1
-                                    diff = np.zeros_like( ref_array )
-                                    np.divide(ref_array-res_array,res_array,diff,where=(ref_array[:]>10**-15))
-                                    if ( np.max(np.abs(diff)) >  1*10**-9 ):
-                                        validated = -1
-                                else:
-                                        validated = -1
-                        report.write(folder_name+" "+folder_name+"@"+config_name+" "+folder_name+"@"+config_name+"@"+checkfile+" "+str(validated)+"\n")
+                            report.write(folder_name+" "+folder_name+"@"+config_name+" "+folder_name+"@"+config_name+"@"+checkfile+" "+str(validated)+"\n")
+                        
+                        elif ( enable_mem_track=='--memtrack full' ) and ( '.mem' in files_list ) : # mem file
+                            validated = 1
+                            OSinfo("diff "+config+"/"+checkfile+" "+"reference/ref_"+config+"/"+checkfile+"  2>&1  > diff_"+checkfile+".txt")
+                            if os.stat("diff_"+checkfile+".txt").st_size==0: # if no diff -> set 0
+                                validated = 1
+                            else: # if diff returns diff -> set -1
+                                validated = -1
+                            report.write(folder_name+" "+folder_name+"@"+config_name+" "+folder_name+"@"+config_name+"@"+checkfile+" "+str(validated)+"\n")
 
                     elif os.path.exists(config+"/"+checkfile): # if no ref file -> set 0
