Changeset 747 for trunk/src/read_field.m


Ignore:
Timestamp:
Apr 22, 2014, 9:44:39 AM (10 years ago)
Author:
sommeria
Message:

adpatations to 3D fields

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/read_field.m

    r693 r747  
    3636errormsg='';
    3737if ~exist(FileName,'file')
    38     erromsg=['input file ' FileName ' does not exist'];
     38    errormsg=['input file ' FileName ' does not exist'];
    3939    return
    4040end
     
    9292                end
    9393            else  % an operator 'vec' or 'norm' is used
    94                 %Operator=r.Operator;
    9594                if ~check_colorvar(ilist) && strcmp(r.Operator,'norm')
    9695                    ProjModeRequestVar='interp_lin';%scalar field (requires interpolation for plot)
     
    121120        end
    122121        if isfield(ParamIn,'TimeDimName')% case of reading of a single time index in a multidimensional array
    123             [Field,var_detect,ichoice]=nc2struct(FileName,'TimeDimName',ParamIn.TimeDimName,num,[ParamIn.Coord_x (ParamIn.Coord_y) ListVar]);
    124         else
    125             [Field,var_detect,ichoice]=nc2struct(FileName,[ParamIn.Coord_x (ParamIn.Coord_y) ListVar]);
    126         end
    127         if isfield(Field,'Txt')
    128             errormsg=Field.Txt;
     122            [Field,var_detect,ichoice,errormsg]=nc2struct(FileName,'TimeDimName',ParamIn.TimeDimName,num,[ParamIn.Coord_x (ParamIn.Coord_y) ListVar]);
     123        elseif isfield(ParamIn,'TimeVarName')% case of reading of a single time  in a multidimensional array
     124            [Field,var_detect,ichoice,errormsg]=nc2struct(FileName,'TimeVarName',ParamIn.TimeVarName,num,[ParamIn.Coord_x (ParamIn.Coord_y) ListVar]);
     125        else
     126            [Field,var_detect,ichoice,errormsg]=nc2struct(FileName,[ParamIn.Coord_x (ParamIn.Coord_y) (ParamIn.Coord_z) ListVar]);
     127        end
     128        if ~isempty(errormsg)
    129129            return
    130130        end
Note: See TracChangeset for help on using the changeset viewer.