Changeset 501
- Timestamp:
- Jul 25, 2012, 1:41:52 AM (12 years ago)
- Location:
- trunk/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/PARAM.xml.default
r500 r501 2 2 <UvmatParam> 3 3 <RunParam> 4 <MaxCivProcesses>20</MaxCivProcesses>5 4 <RunTime>${MCRROOT712}</RunTime> 6 5 <CivBin>bin/civ<!--binary for the new civx version (relative or … … 10 9 <Civ2Bin>bin/civ2<!--binary for civ2 (relative or absolute path) 11 10 --></Civ2Bin> 12 <CivmBin>civ_matlab.sh<!--binary from compilation of civ_matlab.13 m (relative or absolute path)--></CivmBin>14 11 <Civ3D3CBin>bin/civ3d3c</Civ3D3CBin> 15 12 <FixBin>bin/fix_flag</FixBin> 16 13 <PatchBin>bin/patch_up</PatchBin> 17 <PatchNewBin></PatchNewBin>18 14 </RunParam> 19 15 <BatchParam> … … 23 19 <Civ1Bin>bin/civ1</Civ1Bin> 24 20 <Civ2Bin>bin/civ2</Civ2Bin> 25 <CivmBin>civ_matlab.sh<!--binary from compilation of civ_matlab.26 m (relative or absolute path)--></CivmBin>27 21 <Civ3D3CBin>bin/civ3d3c</Civ3D3CBin> 28 22 <FixBin>bin/fix_flag</FixBin> 29 23 <PatchBin>bin/patch_up</PatchBin> 30 <PatchNewBin></PatchNewBin>31 24 </BatchParam> 32 25 <SchemaPath>XML_SCHEMAS <!--directory of xml schemas(relative or absolut -
trunk/src/calc_field.m
r491 r501 117 117 end 118 118 end 119 coord_x=XMin:DataIn.Mesh:XMax; 119 coord_x=XMin:DataIn.Mesh:XMax;% increase the recommanded mesh to visualisation 120 120 coord_y=YMin:DataIn.Mesh:YMax; 121 121 % npx=length(coord_x); -
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') -
trunk/src/find_field_indices.m
r494 r501 117 117 118 118 %% role of variables 119 Role= mat2cell(blanks(nbvar),1,ones(1,nbvar));%initialize a cell array of nbvar blanks119 Role=num2cell(blanks(nbvar));%initialize a cell array of nbvar blanks 120 120 Role=regexprep(Role,' ','scalar'); % Role set to 'scalar' by default 121 121 if isfield(Data,'VarAttribute') … … 129 129 %% loop on the list of variables, group them by common dimensions 130 130 for ivar=1:nbvar 131 if ischar(Data.VarDimName{ivar}) 132 Data.VarDimName{ivar}=Data.VarDimName(ivar);%transform char chain into cell 133 end 131 134 DimCell=Data.VarDimName{ivar}; %dimensions associated with the variable #ivar 132 if ischar(DimCell)133 DimCell={DimCell};134 Data.VarDimName{ivar}={Data.VarDimName{ivar}};%transform char chain into cell135 end136 135 testnewcell=1; 137 136 for icell_prev=1:numel(CellVarIndex)%detect whether the dimensions of ivar fit with an existing cell 138 137 PrevVarIndex=CellVarIndex{icell_prev};%list of variable indices in cell # icell_prev 139 PrevDim Name=Data.VarDimName{PrevVarIndex(1)};%list of corresponding variable names140 if isequal(PrevDim Name,DimCell)138 PrevDimCell=Data.VarDimName{PrevVarIndex(1)};%list of corresponding variable names 139 if isequal(PrevDimCell,DimCell) 141 140 CellVarIndex{icell_prev}=[CellVarIndex{icell_prev} ivar];% add variable index #ivar to the cell #icell_prev 142 141 testnewcell=0; %existing cell detected … … 146 145 if testnewcell 147 146 icell=icell+1; 148 CellVarIndex{icell}=ivar;%put the current variabl index in the new cell 147 CellVarIndex{icell}=ivar;%put the current variable index in the new cell 148 NbDim(icell)=numel(DimCell);%default 149 149 end 150 150 151 151 %look for dimension variables 152 if numel(DimCell)==1% if the variable has a single dimension 153 if strcmp(DimCell{1},Data.ListVarName{ivar}) || strcmp(Role{ivar},'dimvar') 154 ivardim=ivardim+1; 155 VarDimIndex(ivardim)=ivar;%index of the variable 156 VarDimName{ivardim}=DimCell{1};%name of the dimension 157 end 158 end 152 % if numel(DimCell)==1% if the variable has a single dimension 153 % if strcmp(DimCell{1},Data.ListVarName{ivar}) %|| strcmp(Role{ivar},'dimvar') 154 % ivardim=ivardim+1; 155 % VarDimIndex(ivardim)=ivar;%index of the variable 156 % VarDimName{ivardim}=DimCell{1};%name of the dimension 157 % end 158 % end 159 end 160 161 %% find dimension variables 162 checksinglecell=cellfun(@numel,CellVarIndex)==1 & NbDim==1;% find isolated cells with a single dimension 163 ind_dim_var_cell=find(checksinglecell); 164 %CoordType(ind_dim_var_cell)='dim_var';% to be used in output 165 for icoord=1:numel(ind_dim_var_cell) 166 VarDimIndex(icoord)=CellVarIndex{ind_dim_var_cell(icoord)}; 167 VarDimName{icoord}=Data.VarDimName{VarDimIndex(icoord)}{1}; 159 168 end 160 169 … … 162 171 ListRole={'coord_x','coord_y','coord_z','vector_x','vector_y','vector_z','vector_x_tps','vector_y_tps','warnflag','errorflag',... 163 172 'ancillary','image','color','discrete','scalar','coord_tps'};% rmq vector_x_tps and vector_y_tps to be replaced by vector_x and vector_y 164 NbDim=zeros(size(CellVarIndex));%default173 % NbDim=zeros(size(CellVarIndex));%default 165 174 166 175 for ilist=1:numel(ListRole) … … 171 180 VarType.subrange_tps=[]; 172 181 VarType.nbsites_tps=[]; 182 select=zeros(1,numel(VarType.coord_tps)); 173 183 for ifield=1:numel(VarType.coord_tps) 174 select(ifield)=0;175 184 DimCell=Data.VarDimName{VarType.coord_tps(ifield)}; 176 185 if numel(DimCell)==3 … … 194 203 CellVarType=cell(1,length(CellVarIndex)); 195 204 for icell=1:length(CellVarIndex) 205 if checksinglecell(icell) 206 continue 207 end 196 208 VarIndex=CellVarIndex{icell};%set of variable indices with the same dim 197 209 check_remove=0; … … 212 224 return 213 225 end 226 % case of x cordinate marked as a dimension variable (var name=dimension name) 227 if isempty(CellVarType{icell}.coord_x) 228 var_dim_index=find(strcmp(DimCell{1},Data.ListVarName(VarIndex))); 229 if ~isempty(var_dim_index) 230 CellVarType{icell}.coord_x=VarIndex(var_dim_index); 231 end 232 end 214 233 if numel(CellVarType{icell}.errorflag)>1 215 234 errormsg='multiply defined error flag in the same cell'; … … 239 258 if ~test_coord && ~isempty(VarDimName) 240 259 for idim=1:numel(DimCell) %loop on the dimensions of the variables in cell #icell 241 for ivardim=1:numel(VarDimName) 242 if strcmp(VarDimName{ivardim},DimCell{idim}) 243 coord(idim)=VarDimIndex(ivardim); 244 break 245 end 260 ind_coord=find(strcmp(DimCell{idim},VarDimName)); 261 if ~isempty(ind_coord) 262 coord(idim)=VarDimIndex(ind_coord); 246 263 end 264 % for ivardim=1:numel(VarDimName) 265 % if strcmp(VarDimName{ivardim},DimCell{idim}) 266 % coord(idim)=VarDimIndex(ivardim); 267 % break 268 % end 269 % end 247 270 end 248 271 NbDim(icell)=numel(find(coord)); -
trunk/src/plot_field.m
r477 r501 132 132 end 133 133 end 134 index_1D=find(NbDim==1 );134 index_1D=find(NbDim==1&~cellfun(@isempty,VarType)); 135 135 index_0D=find(NbDim==0); 136 136 %remove coordinates variables from 1D plot 137 if ~isempty(index_2D)138 for ivar=1:length(index_1D)139 if isequal(CellVarIndex{index_1D(ivar)},VarType{index_1D(ivar)}.coord)140 index_1D(ivar)=0;141 end142 end143 index_1D=index_1D(index_1D>0);144 end137 % if ~isempty(index_2D) 138 % for ivar=1:length(index_1D) 139 % if isequal(CellVarIndex{index_1D(ivar)},VarType{index_1D(ivar)}.coord) 140 % index_1D(ivar)=0; 141 % end 142 % end 143 % index_1D=index_1D(index_1D>0); 144 % end 145 145 146 146 %% test axes and figure … … 346 346 %loop on input fields 347 347 for icell=1:length(CellVarIndex) 348 if isempty(VarType{icell})% coordiante variable 349 continue 350 end 348 351 VarIndex=CellVarIndex{icell};% indices of the selected variables in the list data.ListVarName 349 352 if ~isempty(VarType{icell}.coord_x) -
trunk/src/uvmat.m
r499 r501 2379 2379 end 2380 2380 if (check_tps ||check_proj_tps)&&~isfield(Field{1},'Coord_tps') 2381 SubDomain=1 500; %default, estimated nbre of vectors in a subdomain used for tps2381 SubDomain=1000; %default, estimated nbre of vectors in a subdomain used for tps 2382 2382 if isfield(Field{1},'SubDomain') 2383 2383 SubDomain=Field{1}.SubDomain;%
Note: See TracChangeset
for help on using the changeset viewer.