Changeset 501 for trunk/src/civ.m
- Timestamp:
- Jul 25, 2012, 1:41:52 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r500 r501 337 337 ind_opening=0;%default 338 338 if strcmp(ExtInput,'.xml') 339 Param=xml2struct(fileinput); 339 %reinitialise menus 340 set(handles.ListPairMode,'Value',1) 341 set(handles.ListPairMode,'String',{''}) 342 set(handles.ListPairCiv1,'Value',1) 343 set(handles.ListPairCiv1,'String',{''}) 344 set(handles.ListPairCiv2,'Value',1) 345 set(handles.ListPairCiv2,'String',{''}) 346 Param=xml2struct(fileinput); %read parameters from the xml input file 340 347 fill_GUI(Param,handles);%fill the GUI with the parameters retrieved from the xml file 341 348 return … … 611 618 %% set the civ options depending on the input file content when a nc file has been opened 612 619 ListOptions={'CheckCiv1', 'CheckFix1' 'CheckPatch1', 'CheckCiv2', 'CheckFix2', 'CheckPatch2'}; 613 if ind_opening~=0 614 for index = 1:ind_opening 620 if ind_opening==0 621 for index=1:numel(ListOptions) 622 checkbox(index)=get(handles.(ListOptions{index}),'Value'); 623 end 624 for index=1:max(1,max(find(checkbox))) 625 set(handles.(ListOptions{index}),'Value',1)% select all operations starting from CIV1 626 end 627 else 628 for index = 1:min(ind_opening,5) 615 629 set(handles.(ListOptions{index}),'value',0) 616 630 end 617 end 618 for index = ind_opening+2:6 619 set(handles.(ListOptions{index}),'value',0) 620 end 621 set(handles.(ListOptions{min(ind_opening+1,6)}),'value',1) 631 set(handles.(ListOptions{min(ind_opening+1,6)}),'value',1) 632 for index = ind_opening+2:6 633 set(handles.(ListOptions{index}),'value',0) 634 end 635 end 636 %list_operation={'CheckCiv1','CheckFix1','CheckPatch1','CheckCiv2','CheckFix2','CheckPatch2'}; 637 638 %set(handles.(ListOptions{min(ind_opening+1,6)}),'value',1) 622 639 update_CivOptions(handles,ind_opening) 623 640 … … 1093 1110 Param.xml.FixBin=fullfile('bin','fix_flag'); 1094 1111 Param.xml.PatchBin=fullfile('bin','patch_up'); 1095 Param.xml.CivmBin=fullfile('bin','civ_matlab');1096 1112 end 1097 1113 if strcmp(Param.RunMode,'cluster') %computation dispatched on a cluster … … 1111 1127 Param.xml.FixBin=fullfile('bin','fix_flag'); 1112 1128 Param.xml.PatchBin=fullfile('bin','patch_up'); 1113 Param.xml.CivmBin=fullfile('bin','civ_matlab');1129 % Param.xml.CivmBin=fullfile('bin','civ_matlab'); 1114 1130 Param.xml.BatchMode='oar';% TODO : allow choice for sge 1115 1131 end … … 1122 1138 Param.xml.FixBin=fullfile('bin','fix_flag'); 1123 1139 Param.xml.PatchBin=fullfile('bin','patch_up'); 1124 Param.xml.CivmBin=fullfile('bin','civ_matlab');1125 1126 end 1140 end 1141 end 1142 %Param.xml.CivmBin=fullfile('bin','civ_matlab'); 1127 1143 1128 1144 %% check if the binaries exist : to move in civ_opening … … 1133 1149 case 'CivAll'% desactivated option 1134 1150 binary_list={'Civ'}; 1135 case 'civ_matlab.sh'% compiled version of civ_matlab1136 binary_list={'CivmBin'};1151 % case 'civ_matlab.sh'% compiled version of civ_matlab 1152 % binary_list={'CivmBin'}; 1137 1153 end 1138 1154 for bin_name=binary_list %loop on the list of binaries … … 1153 1169 cd(currentdir); 1154 1170 else 1155 errormsg=['path ' path ' for binaries defined in PARAM.xml does not exist']; 1171 errormsg=['path ' path ' for binaries specified in PARAM.xml does not exist']; 1172 return 1156 1173 end 1157 1174 else %look for the full path if the file name has been defined with a relative path in PARAM.xm … … 1160 1177 Param.xml.(bin_name{1})=fullname; 1161 1178 else 1162 errormsg=['Binary ' Param.xml.(bin_name{1}) ' defined in PARAM.xml does not exist']; 1163 end 1164 end 1165 end 1166 end 1167 if ~isempty(errormsg) 1168 if strcmp(Param.Program,'civ_matlab.sh') 1169 errormsg=[{errormsg}; {'run compile_functions.m to create it by compiling civ_matlab.m'}]; 1179 errormsg=['Binary ' Param.xml.(bin_name{1}) ' specified in PARAM.xml does not exist']; 1180 return 1181 end 1182 end 1183 end 1184 end 1185 if strcmp(Param.Program,'civ_matlab.sh') 1186 if ~exist(fullfile(path_civ,'civ_matlab.sh'),'file') 1187 errormsg=[{'no file civ_matlab.sh found'}; {'run compile_functions.m to create it by compiling civ_matlab.m'}]; 1170 1188 end 1171 1189 return … … 1188 1206 %% create subfolders for log, cmx, nml, xml, bat 1189 1207 RootBat=fileparts(filecell.nc.civ1{1,1}); 1190 dir_list={'0_BAT','0_CMX','0_XML','0_LOG'}; 1208 switch(Param.Program) 1209 case {'CivX','CivAll'} 1210 dir_list={'0_BAT','0_CMX','0_LOG'}; 1211 case {'civ_matlab','civ_matlab.sh'} 1212 dir_list={'0_BAT','0_XML'}; 1213 end 1191 1214 for k=1:length(dir_list) 1192 1215 if ~exist(fullfile(RootBat,dir_list{k}),'dir')
Note: See TracChangeset
for help on using the changeset viewer.