Changeset 382 for trunk/src/struct2nc.m


Ignore:
Timestamp:
Feb 6, 2012, 11:46:39 PM (12 years ago)
Author:
sommeria
Message:

several bugs corrected
function filter_tps introduced (spline thin shell)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/struct2nc.m

    r246 r382  
    5353    [Data,errormsg]=check_field_structure(Data);%check the validity of the input field structure
    5454    if ~isempty(errormsg)
    55         errormsg=['invalid input structure:' errormsg];
     55        errormsg=['error in struct2nc:invalid input structure_' errormsg];
    5656        return
    5757    end
     
    112112    for ivar=1:length(ListVarName)
    113113        if isfield(Data,ListVarName{ivar})
    114             eval(['VarVal=Data.' ListVarName{ivar} ';'])%varval=values of the current variable
     114            VarVal=Data.(ListVarName{ivar});
     115            %varval=values of the current variable
    115116            VarDimIndex=Data.VarDimIndex{ivar}; %indices of the variable dimensions in the list of dimensions
    116117            VarDimName=Data.VarDimName{ivar};
     
    122123            testline=isequal(length(siz),2) && isequal(siz(1),1)&& isequal(siz(2), Data.DimValue(VarDimIndex));%matlab vector
    123124            testcolumn=isequal(length(siz),2) && isequal(siz(1), Data.DimValue(VarDimIndex))&& isequal(siz(2),1);%matlab column vector
    124             if ~testrange && ~testline && ~testcolumn && ~isequal(siz,Data.DimValue(VarDimIndex))
    125                 errormsg=['wrong dimensions declared for ' ListVarName{ivar} ' in struct2nc.m'];
    126                 break
    127             end
     125%             if ~testrange && ~testline && ~testcolumn && ~isequal(siz,Data.DimValue(VarDimIndex))
     126%                 errormsg=['wrong dimensions declared for ' ListVarName{ivar} ' in struct2nc.m'];
     127%                 break
     128%             end
    128129            if testline || testrange
    129130                if testrange
Note: See TracChangeset for help on using the changeset viewer.