Ignore:
Timestamp:
Feb 27, 2013, 6:39:32 PM (8 years ago)
Author:
sommeria
Message:

various bugs corrected

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/find_field_cells.m

    r569 r575  
    1 %'find_file_indices': test field structure for input in proj_field and plot_field
     1%'find_field_cells': test field structure for input in proj_field and plot_field
    22%    group the variables  into 'fields' with common dimensions
    33%------------------------------------------------------------------------
     
    2727% INPUT:
    2828% Data: structure representing fields, output of check_field_structure
     29%            .ListGlobalAttributes
    2930%            .ListVarName: cell array listing the names (cahr strings) of the variables
    3031%            .VarDimName: cell array of cells containing the set of dimension names for each variable of .ListVarName
     
    3233%                     .VarAttribute{ilist}.key=value, where ilist is the variable
    3334%                     index, key is the name of the attribute, value its value (char string or number)
    34 %
     35%            .Attr1, .Attr2....
     36%        case of actual data:
     37%            .Var1, .Var2...
     38%        case of data structure, without the  data themselves
     39%            .LisDimName: list of dimension names
     40%            .DimValue: list of corresponding dimension values
    3541% HELP:
    3642% to get the dimensions of arrays common to the field #icell
     
    104110ivar_coord_x=find(strcmp('coord_x',Role));
    105111% VarDimCell=cell(numel(ivar_coord_x));
    106 check_select=zeros(1,nbvar);
     112check_select=false(1,nbvar);
     113check_coord=false(1,nbvar);
    107114CellInfo=cell(1,numel(ivar_coord_x));
    108115NbDim=zeros(1,numel(ivar_coord_x));
     
    197204ListVarName=Data.ListVarName(~check_select);%list of remaining variables
    198205VarDimName=Data.VarDimName(~check_select);%dimensions of remaining variables
    199 check_coord= cellfun(@numel,VarDimName)==1|cellfun(@ischar,VarDimName)==1;% find remaining variables with a single dimension
     206check_coord_select= cellfun(@numel,VarDimName)==1|cellfun(@ischar,VarDimName)==1;% find remaining variables with a single dimension
     207check_coord(~check_select)=check_coord_select;
    200208ListCoordIndex=ivar_remain(check_coord);% indices of remaining variables with a single dimension
    201209ListCoordName=Data.ListVarName(ListCoordIndex);% corresponding names of remaining variables with a single dimension
Note: See TracChangeset for help on using the changeset viewer.