Changeset 106 for trunk/src/struct2nc.m


Ignore:
Timestamp:
Jul 1, 2010, 12:01:37 AM (11 years ago)
Author:
sommeria
Message:

merge_proj and series.m: bug for use of mmreader corrected
struct2nc: bug for regularly meshed coordinates corrected (builtin netcdf lib)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/struct2nc.m

    r93 r106  
    113113            VarDimIndex=Data.VarDimIndex{ivar}; %indices of the variable dimensions in the list of dimensions
    114114            siz=size(VarVal);
    115             VarDimName=Data.VarDimName{ivar};%NEW
    116             if ischar(VarDimName)%NEW
    117                 VarDimName={VarDimName};%NEW
    118             end%NEW
    119             testrange=(numel(VarDimName)==1 && strcmp(VarDimName{1},ListVarName{ivar}) && numel(VarVal)==2); %NEW
     115            VarDimName=Data.VarDimName{ivar};
     116            if ischar(VarDimName)
     117                VarDimName={VarDimName};
     118            end
     119            testrange=(numel(VarDimName)==1 && strcmp(VarDimName{1},ListVarName{ivar}) && numel(VarVal)==2);
    120120            testline=isequal(length(siz),2) && isequal(siz(1),1)&& isequal(siz(2), Data.DimValue(VarDimIndex));
    121121            testcolumn=isequal(length(siz),2) && isequal(siz(1), Data.DimValue(VarDimIndex))&& isequal(siz(2),1);
    122             if ~testline && ~testcolumn && ~isequal(siz,Data.DimValue(VarDimIndex))
     122            if ~testrange && ~testline && ~testcolumn && ~isequal(siz,Data.DimValue(VarDimIndex))
    123123                errormsg=['wrong dimensions declared for ' ListVarName{ivar} ' in struct2nc.m'];
    124124                break
Note: See TracChangeset for help on using the changeset viewer.