/[MITgcm]/MITgcm/utils/matlab/rdmnc.m
ViewVC logotype

Diff of /MITgcm/utils/matlab/rdmnc.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.5 by enderton, Thu Oct 20 15:19:49 2005 UTC revision 1.6 by enderton, Tue Feb 28 23:55:28 2006 UTC
# Line 1  Line 1 
1  function [S] = rdmnc_mod2(varargin)  function [S] = rdmnc(varargin)
2    
3  % Usage:  % Usage:
4  %   S=RDMNC(FILE1,FILE2,...)  %   S=RDMNC(FILE1,FILE2,...)
# Line 154  function [S] = rdmnc_local(nc,varlist,it Line 154  function [S] = rdmnc_local(nc,varlist,it
154              continue              continue
155          end          end
156                    
157          dims=ncnames(dim(nc{cvar}));        % Dimensions          dims = ncnames(dim(nc{cvar}));        % Dimensions
158                    
159          if dims{1}=='T'          adj = 0;
160            if dims{1} == 'T'
161              if isempty(find(fii)), return, end              if isempty(find(fii)), return, end
162              tmpdata=nc{cvar}(find(fii),:);              tmpdata = nc{cvar}(find(fii),:);
163              it = length(dims);              if ismember('Zd000001' ,dims), adj = adj - 1; end
164                if ismember('Zmd000001',dims), adj = adj - 1; end
165                it = length(dims) + adj;
166          else          else
167              tmpdata=nc{cvar}(:);              tmpdata = nc{cvar}(:);
168              it = 0;              it = 0;
169          end          end
170                    
171          tmpdata=squeeze(permute(tmpdata,[9:-1:1]));          tmpdata=squeeze(permute(tmpdata,[9:-1:1]));
172          [ni nj nk nm nn no np]=size(tmpdata);          [ni nj nk nm nn no np]=size(tmpdata);
         [ni nj nk nm nn no np];  
173                    
174          [i0,j0,fn]=findTileOffset(S);          [i0,j0,fn]=findTileOffset(S);
175          cdim=dims{end}; if cdim(1)~='X'; i0=0; end          cdim=dims{end}; if cdim(1)~='X'; i0=0; end
# Line 191  function [S] = rdmnc_local(nc,varlist,it Line 193  function [S] = rdmnc_local(nc,varlist,it
193              else, error('Can''t handle this many dimensions!');              else, error('Can''t handle this many dimensions!');
194              end              end
195          end          end
196            
197          eval(['S.(cvar)(',Sstr(1:end-1),')=tmpdata;'])          eval(['S.(cvar)(',Sstr(1:end-1),')=tmpdata;'])
198          %S.(cvar)(i0+(1:ni),j0+(1:nj),(1:nk),(1:nm),(1:nn),(1:no),(1:np))=tmpdata;          %S.(cvar)(i0+(1:ni),j0+(1:nj),(1:nk),(1:nm),(1:nn),(1:no),(1:np))=tmpdata;
199          S.attributes.(cvar)=read_att(nc{cvar});          S.attributes.(cvar)=read_att(nc{cvar});

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.22