Ignore:
Timestamp:
Jun 24, 2010, 5:28:55 PM (14 years ago)
Author:
sommeria
Message:

Bug fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/read_get_field.m

    r89 r105  
    248248%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    249249% vectors
    250 % test_vec_x_dimvar=0;%default
    251 % test_vec_y_dimvar=0;%default
     250test_vec_x_dimvar=0;%default
     251test_vec_y_dimvar=0;%default
    252252% test_vec_z_dimvar=0;%defaul
    253253dimname_vec_x=[];
     
    321321                end
    322322            end
    323 %             test_vec_x_dimvar=1;
     323             test_vec_x_dimvar=1;
    324324            SubVarAttribute{nbvar}.Role='dimvar';% dimension variable
    325325        else
     
    354354                end
    355355            end
    356 %             test_vec_y_dimvar=1;
     356             test_vec_y_dimvar=1;
    357357            SubVarAttribute{nbvar}.Role='dimvar';% dimension variable
    358358        else
     
    458458    VarNameA=Field.ListVarName{VarIndexA};
    459459    DimCellA=Field.VarDimName{VarIndexA};   
    460     eval(['npxy=size(SubField.' VarNameA ')'])
     460    eval(['npxy=size(SubField.' VarNameA ');'])
    461461    SingleCellA={};
    462462    if numel(npxy) < numel(DimCellA)
     
    489489        for icoord=1:numel(SingleCellA)% look for coincidence of dimension with one of the dimensions of the scalar
    490490            if strcmp(dimname_y,SingleCellA{icoord})% a singleton dimension
    491                 errormsg=['the singleton dimension ' dimname_y ' has been selected for ordiante'];
     491                errormsg=['the singleton dimension ' dimname_y ' has been selected for ordinate'];
    492492                return
    493493            end
     
    517517    dimextra(dimA)=[]; %list of unselected dimension indices
    518518    DimCellA=DimCellA([dimA dimextra]);
    519    % eval(['SubField.' VarNameA '=permute(squeeze(SubField.' VarNameA '),[dimA dimextra]);'])TO CHECK
     519    eval(['SubField.' VarNameA '=permute(squeeze(SubField.' VarNameA '),[dimA dimextra]);'])
    520520    SubField.VarDimName{VarSubIndexA}=DimCellA; 
    521521    %add default coord_x and/or coord_y if empty
     
    523523        VarName=Field.ListVarName{field_var_index};
    524524        DimCell=Field.VarDimName{field_var_index};   
    525         eval(['npxy=size(SubField.' VarName ')'])
     525        eval(['npxy=size(SubField.' VarName ');'])
    526526        if numel(npxy) < numel(DimCell)
    527527            DimCell=DimCell(end-numel(npxy)+1:end); %suppress the first singletons) dimensions
     
    579579    VarNameU=Field.ListVarName{VarIndexU}; % name of u component variable
    580580    DimCellU=Field.VarDimName{VarIndexU}; % list of dimensions for u component 
    581     eval(['npxy=size(SubField.' VarNameU ')']) % npxy= dimension values for the u component
     581    eval(['npxy=size(SubField.' VarNameU ');']) % npxy= dimension values for the u component
    582582    SingleCellU={};
    583583    if numel(npxy) < numel(DimCellU)
     
    609609        end
    610610    end
    611     if test_ydimvar%dim_x && dim_y && ~isempty(VarSubIndexA)
     611    if test_vec_y_dimvar%dim_x && dim_y && ~isempty(VarSubIndexA)
    612612        for icoord=1:numel(SingleCellU)% look for coincidence of dimension with one of the dimensions of the scalar
    613613            if strcmp(dimname_vec_y,SingleCellU{icoord})% a singleton dimension
     
    650650        VarName=Field.ListVarName{field_var_index};
    651651        DimCell=Field.VarDimName{field_var_index};   
    652         eval(['npxy=size(SubField.' VarName ')'])
     652        eval(['npxy=size(SubField.' VarName ');'])
    653653        if numel(npxy) < numel(DimCell)
    654654            DimCell=DimCell(end-numel(npxy)+1:end); %suppress the first singletons) dimensions
     
    722722        VarName=Field.ListVarName{VarIndex_y(1)};
    723723        DimCell=Field.VarDimName{VarIndex_y(1)};   
    724         eval(['npxy=size(SubField.' VarName ')'])
     724        eval(['npxy=size(SubField.' VarName ');'])
    725725        if numel(npxy) < numel(DimCell)
    726726%             DimCell=DimCell(end-numel(npxy)+1:end); %suppress the first singletons) dimensions
    727727        end
    728 %         ind_select=find(npxy~=1) ;%look for non singleton dimensions
    729 %         DimCell=DimCell(ind_select);
    730 %         npxy=npxy(ind_select);
    731728        if isfield(Field,'VarAttribute') && numel(Field.VarAttribute)>=VarIndex_y(1) ...
    732729                             && isfield(Field.VarAttribute{VarIndex_y(1)},'Coord_1')
Note: See TracChangeset for help on using the changeset viewer.