Index: trunk/src/compile.m
===================================================================
--- trunk/src/compile.m	(revision 894)
+++ trunk/src/compile.m	(revision 895)
@@ -43,12 +43,13 @@
     SubfctPath=['-I ' SubfctPath];%string indicating the option of including the path SubfctPath
 end
-
+hver=ver('MATLAB');
+FctNameVersion=[FctName '_MCRROOT' regexprep(hver.Version,'\.','')];%suppress the dot in version number
 try
     disp(['mcc -m -R -nojvm -R -nodisplay -R -singleCompThread ' SubfctPath ' ' FctName '.m'])
     eval(['mcc -m -R -nojvm -R -nodisplay -R -singleCompThread ' SubfctPath ' ' FctName '.m'])% compile the source file [FctName .m], which produces a binary file FctName and a cmd file [run_' FctName '.sh]
     system(['mv -f ' FctName ' bin/']);%move the binary file FctName to the subdir /bin
-    system(['sed -e ''''s#/' FctName '#/bin/' FctName '#'''' run_' FctName '.sh > ' FctName '.sh']);%modify the cmd file and copy it to [FctName '.sh']
+    system(['sed -e ''''s#/' FctName '#/bin/' FctName '#'''' run_' FctName '.sh > ' FctNameVersion '.sh']);%modify the cmd file and copy it to [FctName '.sh']
     system(['rm run_' FctName '.sh']);% remove the initial cmd file [run_' FctName '.sh]
-    system(['chmod +x ' FctName '.sh']); % set the cmd file to 'executable'
+    system(['chmod +x ' FctNameVersion '.sh']); % set the cmd file to 'executable'
 catch ME
     hh=msgbox_uvmat('ERROR',ME.message);
Index: trunk/src/proj_field.m
===================================================================
--- trunk/src/proj_field.m	(revision 894)
+++ trunk/src/proj_field.m	(revision 895)
@@ -1275,7 +1275,12 @@
                     [VarVal,ListVarName,VarAttribute,errormsg]=calc_field_interp([coord_X coord_Y],FieldData,CellInfo{icell}.FieldName,XI,YI);
                     
-                    % set to NaN interpolation points which are too far from any initial data (more than 2 CoordMaesh)
-                    F=scatteredInterpolant(coord_X, coord_Y,coord_X,'nearest');
-                    G=scatteredInterpolant(coord_X, coord_Y,coord_Y,'nearest');
+                    % set to NaN interpolation points which are too far from any initial data (more than 2 CoordMesh)
+                    if exist('scatteredInterpolant','file')%recent Matlab versions
+                        F=scatteredInterpolant(coord_X, coord_Y,coord_X,'nearest');
+                        G=scatteredInterpolant(coord_X, coord_Y,coord_Y,'nearest');
+                    else
+                        F=TriScatteredInterp([coord_X coord_Y],coord_X,'nearest');
+                        G=TriScatteredInterp([coord_X coord_Y],coord_Y,'nearest');
+                    end
                     Distx=F(XI,YI)-XI;% diff of x coordinates with the nearest measurement point
                     Disty=G(XI,YI)-YI;% diff of y coordinates with the nearest measurement point
@@ -1319,13 +1324,19 @@
                 [DataOut,VarAttribute,errormsg]=calc_field_tps(Coord,NbCentres,SubRange,FieldVar,CellInfo{icell}.FieldName,cat(3,XI,YI));
                 
-                % set to NaN interpolation points which are too far from any initial data (more than 2 CoordMaesh)
-                F=scatteredInterpolant(coord_X, coord_Y,coord_X,'nearest');
-                G=scatteredInterpolant(coord_X, coord_Y,coord_Y,'nearest');
-                Distx=F(XI,YI)-XI;% diff of x coordinates with the nearest measurement point
-                Disty=G(XI,YI)-YI;% diff of y coordinates with the nearest measurement point
-                Dist=Distx.*Distx+Disty.*Disty;
-                for ivar=1:numel(VarVal)
-                    VarVal{ivar}(Dist>2*ProjData.CoordMesh)=NaN;% put to NaN interpolated positions too far from initial data
-                end
+                % set to NaN interpolation points which are too far from any initial data (more than 2 CoordMesh)
+                    if exist('scatteredInterpolant','file')%recent Matlab versions
+                        F=scatteredInterpolant(coord_X, coord_Y,coord_X,'nearest');
+                        G=scatteredInterpolant(coord_X, coord_Y,coord_Y,'nearest');
+                    else
+                        F=TriScatteredInterp([coord_X coord_Y],coord_X,'nearest');
+                        G=TriScatteredInterp([coord_X coord_Y],coord_Y,'nearest');
+                    end
+                    Distx=F(XI,YI)-XI;% diff of x coordinates with the nearest measurement point
+                    Disty=G(XI,YI)-YI;% diff of y coordinates with the nearest measurement point
+                    Dist=Distx.*Distx+Disty.*Disty;
+                    for ivar=1:numel(VarVal)
+                        VarVal{ivar}(Dist>2*ProjData.CoordMesh)=NaN;% put to NaN interpolated positions too far from initial data
+                    end  
+                    
                 
                 ListVarName=(fieldnames(DataOut))';
Index: trunk/src/series.m
===================================================================
--- trunk/src/series.m	(revision 894)
+++ trunk/src/series.m	(revision 895)
@@ -1481,19 +1481,19 @@
     [success,message]=copyfile(fullfile(path_series,'PARAM.xml.default'),xmlfile);
 end
-RunTime='';
+% RunTime='';
 if strcmp(ActionExt,'.sh')
     if exist(xmlfile,'file')
         s=xml2struct(xmlfile);
         if strcmp(RunMode,'cluster_oar') && isfield(s,'BatchParam')
-            if isfield(s.BatchParam,'RunTime')
-                RunTime=s.BatchParam.RunTime;
-            end
+%             if isfield(s.BatchParam,'RunTime')
+%                 RunTime=s.BatchParam.RunTime;
+%             end
             if isfield(s.BatchParam,'NbCore')
                 NbCore=s.BatchParam.NbCore;
             end
         elseif (strcmp(RunMode,'background')||strcmp(RunMode,'local')) && isfield(s,'RunParam')
-            if isfield(s.RunParam,'RunTime')
-                RunTime=s.RunParam.RunTime;
-            end
+%             if isfield(s.RunParam,'RunTime')
+%                 RunTime=s.RunParam.RunTime;
+%             end
             if isfield(s.RunParam,'NbCore')
                 NbCore=s.RunParam.NbCore;
@@ -1501,8 +1501,8 @@
         end
     end
-    if isempty(RunTime) && strcmp(RunMode,'cluster_oar')
-       errormsg='RunTime name not found in PARAM.xml, compiled version .sh cannot run on cluster';
-        return
-    end
+%     if isempty(RunTime) && strcmp(RunMode,'cluster_oar')
+%        errormsg='RunTime name not found in PARAM.xml, compiled version .sh cannot run on cluster';
+%         return
+%     end
 end
 
@@ -1515,5 +1515,9 @@
     set(handles.series,'Pointer','watch') % set the mouse pointer to 'watch'
     set(handles.ActionExt,'BackgroundColor',[1 1 0])
-    ActionFullName=fullfile(get(handles.ActionPath,'String'),[ActionName '.sh']);
+    hver=ver('MATLAB');
+    MCRROOT=['MCRROOT' regexprep(hver.Version,'\.','')];%suppress the dot in version number
+    RunTime = getenv(MCRROOT);
+    ActionNameVersion=[ActionName '_' MCRROOT];
+    ActionFullName=fullfile(get(handles.ActionPath,'String'),[ActionNameVersion '.sh']);
     if ~exist(ActionFullName,'file')
         answer=msgbox_uvmat('INPUT_Y-N','compiled version has not been created: compile now?');
@@ -1531,10 +1535,10 @@
         end       
     else
-        sh_file_info=dir(fullfile(get(handles.ActionPath,'String'),[ActionName '.sh']));
+        sh_file_info=dir(fullfile(get(handles.ActionPath,'String'),[ActionNameVersion '.sh']));
         m_file_info=dir(fullfile(get(handles.ActionPath,'String'),[ActionName '.m']));
         if isfield(m_file_info,'datenum') && m_file_info.datenum>sh_file_info.datenum
             set(handles.ActionExt,'BackgroundColor',[1 1 0])
             drawnow
-            answer=msgbox_uvmat('INPUT_Y-N',[ActionName '.sh needs to be updated: recompile now?']);
+            answer=msgbox_uvmat('INPUT_Y-N',[ActionNameVersion '.sh needs to be updated: recompile now?']);
             if strcmp(answer,'Yes')
                 path_uvmat=fileparts(which('series'));
Index: trunk/src/series/civ_series.m
===================================================================
--- trunk/src/series/civ_series.m	(revision 894)
+++ trunk/src/series/civ_series.m	(revision 895)
@@ -324,5 +324,5 @@
 %%%%% MAIN LOOP %%%%%%
 maskname='';% initiate the mask name
-tstart=tic;
+tic;
 for ifield=1:NbField
     if ~isempty(RUNHandle)% update the waitbar in interactive mode with GUI series  (checkrun=1)
