Index: trunk/src/series.m
===================================================================
--- trunk/src/series.m	(revision 1100)
+++ trunk/src/series.m	(revision 1104)
@@ -1633,18 +1633,18 @@
         for iexp=1:numel(ListExp)
             if ~isempty(regexp(ListExp{iexp},'^\+/'))% if it is a folder
-                if strcmp(get(BrowseData.DataSeries,'enable'),'off') %case of a multiple input line for series
-                    NbExp=NbExp+1;
-                    ExpIndex{NbExp}=iexp;
-                    for idevice=1:numel(ListDevices)
-                        lpath= fullfile(SourceDir,regexprep(ListExp{iexp},'^\+/',''),...
-                            regexprep(ListDevices{idevice},'^\+/',''));
-                        lpathout=fullfile(OutputPath,regexprep(ListExp{iexp},'^\+/',''),...
-                            regexprep(ListDevices{idevice},'^\+/',''));
-                        ldir=regexprep(ListDataSeries{idevice},'^\+/','');
-                        ListPath{idevice,NbExp}=lpath;
-                        ListPathOut{idevice,NbExp}=lpathout;
-                        ListSubdir{idevice,NbExp}=ldir;
-                    end
-                else
+               %if strcmp(get(BrowseData.DataSeries,'enable'),'off') %case of a multiple input line for series
+%                     NbExp=NbExp+1;
+%                     ExpIndex{NbExp}=iexp;
+%                     for idevice=1:numel(ListDevices)
+%                         lpath= fullfile(SourceDir,regexprep(ListExp{iexp},'^\+/',''),...
+%                             regexprep(ListDevices{idevice},'^\+/',''));
+%                         lpathout=fullfile(OutputPath,regexprep(ListExp{iexp},'^\+/',''),...
+%                             regexprep(ListDevices{idevice},'^\+/',''));
+%                         ldir=regexprep(ListDataSeries{idevice},'^\+/','');
+%                         ListPath{idevice,NbExp}=lpath;
+%                         ListPathOut{idevice,NbExp}=lpathout;
+%                         ListSubdir{idevice,NbExp}=ldir;
+%                     end
+                %else
                     for idevice=1:numel(ListDevices)
                         if ~isempty(regexp(ListDevices{idevice},'^\+/'))% if it is a folder
@@ -1658,7 +1658,10 @@
                                     if exist(fullfile(lpath,ldir),'dir')
                                         NbExp=NbExp+1;
-                                        ExpIndex{NbExp}=iexp;
+                                        ExpIndex(NbExp)=ExpIndices(iexp);
+                                        DeviceIndex(NbExp)=DeviceIndices(idevice);
                                         ListPath{NbExp}=lpath;
                                         ListPathOut{NbExp}=lpathout;
+                                        ListDeviceOut{NbExp}=regexprep(ListDevices{idevice},'^\+/','');
+                                        ListExpOut{NbExp}=regexprep(ListExp{iexp},'^\+/','');
                                         ListSubdir{NbExp}=ldir;
                                     end
@@ -1667,5 +1670,5 @@
                         end
                     end
-                end
+%                 end
             end
         end
@@ -1685,5 +1688,6 @@
             return
         end
-        set(BrowseData.ListExperiments,'Value',ExpIndex{iexp})
+        set(BrowseData.ListExperiments,'Value',ExpIndex(iexp))
+        set(BrowseData.ListDevices,'Value',DeviceIndex(iexp))
         Param.InputTable(:,1)=ListPath(:,iexp);
         Param.InputTable(:,2)=ListSubdir(:,iexp);
@@ -1706,8 +1710,9 @@
         PathOut=get(handles.OutputPath,'String');
         if ~exist(PathOut,'dir') % test if  the dir  already exist
-        PathOut=uigetdir(PathOut,'pick the output root path')
-        set(handles.OutputPath,'String',PathOut);
-        end
-        PathExpOut=fullfile(PathOut,get(handles.Experiment,'String'));
+            PathOut=uigetdir(PathOut,'pick the output root path');
+            set(handles.OutputPath,'String',PathOut);
+        end
+        %PathExpOut=fullfile(PathOut,get(handles.Experiment,'String'));
+        PathExpOut=fileparts(ListPath{iexp});
         if ~exist(PathExpOut,'dir')
             [tild,msg1]=mkdir(PathExpOut);
@@ -1717,5 +1722,6 @@
             end
         end
-        PathExpDeviceOut=fullfile(PathExpOut,get(handles.Device,'String'));
+        %PathExpDeviceOut=fullfile(PathExpOut,get(handles.Device,'String'));
+        PathExpDeviceOut=ListPath{iexp};
         if ~exist(PathExpDeviceOut,'dir')
             [tild,msg1]=mkdir(PathExpDeviceOut);
@@ -1780,7 +1786,9 @@
     if get(handles.Replicate,'Value')
         set(handles.InputTable,'Data',Param.InputTable)
-        set(handles.OutputPath,'String',Pathout)
-        set(handles.Experiment,'String',ListExp{iexp})
-        set(handles.Device,'String',ListDevices{iexp})
+        set(handles.OutputPath,'String',OutputPath)
+         set(handles.Experiment,'String',ListExpOut{iexp})
+        set(handles.Device,'String',ListDeviceOut{iexp})
+        Param.Experiment=ListExpOut{iexp};
+        Param.Device=ListDeviceOut{iexp};
         check_input_file_series(handles)      
     end
@@ -1850,8 +1858,4 @@
         end
     end
-%     CPUTime=1; % job time estimated at 1 min per iteration (on index i and j) by default
-%     if isfield(Param.Action, 'CPUTime') && ~isempty(Param.Action.CPUTime)
-%         CPUTime=Param.Action.CPUTime; % Note: CpUTime for one iteration ref_i has to be multiplied by the number of j indices nbfield_j
-%     end
     nbfield_j=numel(ref_j); % number of j indices
     BlockLength=numel(ref_i); % by default, job involves the full set of i field indices
@@ -1860,9 +1864,10 @@
         case 'cluster'
             if (isfield(Param.Action, 'CPUTime') && ~isempty(Param.Action.CPUTime))
-        CPUTime=Param.Action.CPUTime; % Note: CpUTime for one iteration ref_i has to be multiplied by the number of j indices nbfield_j
+                CPUTime=Param.Action.CPUTime; % Note: CpUTime for one iteration ref_i has to be multiplied by the number of j indices nbfield_j
             else
-               answer=msgbox_uvmat('INPUT_TXT','estimate the CPU time(in minutes) for each value of index i:' ,''); 
-               CPUTime=str2num(answer);
-               set(handles.num_CPUTime,'String',answer)
+                answer=msgbox_uvmat('INPUT_TXT','estimate the CPU time(in minutes) for each value of index i:' ,'');
+                CPUTime=str2num(answer);
+                set(handles.num_CPUTime,'String',answer)
+                Param.Action.CPUTime=CPUTime;
             end
             JobNumberMax=SeriesData.SeriesParam.ClusterParam.JobNumberMax;
