Index: trunk/src/civ.m
===================================================================
--- trunk/src/civ.m	(revision 182)
+++ trunk/src/civ.m	(revision 183)
@@ -1724,6 +1724,4 @@
         end
     end
-    %test_interp=get(handles.test_interp,'Value');
-
     if  isfield(sparam,'PatchBin')
         if ~exist(sparam.PatchBin,'file')
@@ -1731,9 +1729,4 @@
         end
     end
-    % if test_interp && isfield(sparam,'PatchNewBin')
-    %     if ~exist(sparam.PatchNewBin,'file')
-    %          sparam.PatchNewBin=fullfile(path_UVMAT,sparam.PatchNewBin);
-    %     end
-    % end
     if isfield(sparam,'FixBin')
         if ~exist(sparam.FixBin,'file')
@@ -1746,9 +1739,4 @@
         batch_mode=sparam.BatchMode;
     end
-else
-%     MaxCivProcesses=50;
-%     if isfield(sparam,'MaxCivProcesses')
-%         MaxCivProcesses=str2double(sparam.MaxCivProcesses);
-%     end
 end
 
@@ -1756,5 +1744,4 @@
 %% get civ1 parameters:
 display('files OK, processing...')
-%get civ parameters
 if box_test(1)==1
     par_civ1=read_param_civ1(handles,filecell.ima1.civ1{1,1});
@@ -1863,5 +1850,4 @@
         cmd='';
         if isunix % check: necessaire aussi en RUN?
-            %fid=fopen([filename '.cmx'],'w')
             cmd='#!/bin/bash \n';
             cmd=[cmd '#$ -cwd \n'];
@@ -1874,10 +1860,7 @@
             civAllxml=set(civAllxml,1,'name','CivDoc');
         end
-        %filename_cur=filecell.nc.civ1{ifile,j};%output netcdf file
         [Rootbat,Filebat]=fileparts(filecell.nc.civ1{ifile,j});%output netcdf file (without extention)
         flname=fullfile(Rootbat,Filebat);
-        %filename_cmx(end-1:end+6)='civ1.cmx';%name of cmx file
         if batch
-%             [Rootbat,Filebat,extbat]=fileparts(filename_cmx);
             filename_bat=fullfile(Rootbat,['job_' Filebat]);
          else
@@ -1890,5 +1873,4 @@
             par_civ1.filename_ima_a=filecell.ima1.civ1{ifile,j};
             par_civ1.filename_ima_b=filecell.ima2.civ1{ifile,j};
-            %namelog=[fullfile(Rootbat,Filebat) '.civ1.log'];
             par_civ1.Dt=num2str(time(num2_civ1(ifile),num_b_civ1(j))-time(num1_civ1(ifile),num_a_civ1(j)));
             par_civ1.T0=num2str((time(num2_civ1(ifile),num_b_civ1(j))+time(num1_civ1(ifile),num_a_civ1(j)))/2);
@@ -1943,5 +1925,11 @@
             i_cmd=i_cmd+1;
             if isequal(civAll,0)
-                cmd=[cmd CIV1_CMD(fullfile(Rootbat,Filebat),'',par_civ1,handles,sparam) '\n'];
+                if(isunix)
+                     cmd=[cmd 'cp -f ' flname '.civ1.cmx ' flname '.cmx\n'];
+                else
+                    flname=regexprep(flname,'\\','\\\\');
+                    cmd=[cmd 'copy /Y "' flname '.civ1.cmx" "' flname '.cmx"\n'];
+                end
+                cmd=[cmd CIV1_CMD(fullfile(Rootbat,Filebat),'',par_civ1,handles,sparam) '\n']
             else
                 civAllCmd=[civAllCmd ' civ1 '];
@@ -2054,14 +2042,10 @@
             filename_cmx=filecell.nc.civ2{ifile,j};%output netcdf file
             filename_cmx([end-1:end+1])=[ 'cmx'];%name of cmx file
-%             filename_cmx=[filename_cmx 'x'];
         end
         
         if box_test(4)==1
             par_civ2.filename_ima_a=filecell.ima1.civ2{ifile,j};
-            %par_civ2.filename_ima_a([end-3:end])=[];%remove .png extension
             par_civ2.filename_ima_b=filecell.ima2.civ2{ifile,j};
-            %par_civ2.filename_ima_b([end-3:end])=[];%remove .png extension
             [Rootbat,Filebat]=fileparts(filecell.nc.civ2{ifile,j});%output netcdf file (without extention)
-            %namelog=[fullfile(Rootbat,Filebat) '.civ2.log'];
             par_civ2.Dt=num2str(time(num2_civ2(ifile),num_b_civ2(j))-time(num1_civ2(ifile),num_a_civ2(j)));
             par_civ2.T0=num2str((time(num2_civ1(ifile),num_b_civ2(j))+time(num1_civ2(ifile),num_a_civ2(j)))/2);
@@ -2115,5 +2099,4 @@
                 end
             end
-            %endTESTgrid
             i_cmd=i_cmd+1;
             flname=fullfile(Rootbat,Filebat);
@@ -2234,5 +2217,4 @@
         if isequal(civAll,1)
             save(civAllxml,[filename_cmx([1:end-4]) '.xml']);
-            %cmd=char({cmd;[CivBin ' -f ' [filename_cmx([1:end-4]) '.xml'] ' ' civAllCmd]});
             cmd=[cmd CivBin ' -f ' filename_cmx(1:end-4) '.xml '  civAllCmd  '\n'];
         end
@@ -2245,10 +2227,8 @@
         fprintf(fid,cmd);
         fclose(fid);
-        %dlmwrite(filename_bat,cmd,'');%write commands in filename_bat
         if batch
             switch batch_mode
                 case 'sge'
                     pvalue=num2str((1-ind_answer)*500);
-                    %namelog=[filename_bat '.patch.log'];
                     display(['!qsub -p ' pvalue ' -q civ.q -e ' flname '.errors -o ' flname '.log' ' ' filename_bat]);
                     eval(  ['!qsub -p ' pvalue ' -q civ.q -e ' flname '.errors -o ' flname '.log' ' ' filename_bat]);
@@ -2258,5 +2238,4 @@
             if(isunix)
                 cmd_str=['. ' filename_bat];
-                % cmd_str=['!at -qb now -f ' filename_bat ' &']; %ou at -qb now -f bad idea...
             else %case of Windows
                 cmd_str=['@call "' regexprep(filename_bat,'\\','\\\\') '"'];
