/[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.24 by mlosch, Thu Jun 23 08:12:11 2011 UTC revision 1.25 by mlosch, Thu Jun 23 08:40:09 2011 UTC
# Line 207  function [S] = rdmnc_local(nc,varlist,it Line 207  function [S] = rdmnc_local(nc,varlist,it
207        disp(['No such variable ''',cvar,''' in MNC file ',name(nc)]);        disp(['No such variable ''',cvar,''' in MNC file ',name(nc)]);
208        continue        continue
209      end      end
210            % code by Bruno Deremble: if you do not want to read all tiles these
211        % modifications make the output field smaller, let us see, if it is
212        % robust
213        if (isfield(S,cvar) == 0); firstiter = 1; else firstiter = 0; end
214        % end code by Bruno Deremble
215    
216      dims = ncnames(dim(nc{cvar}));        % Dimensions      dims = ncnames(dim(nc{cvar}));        % Dimensions
217      sizVar = size(nc{cvar}); nDims=length(sizVar);      sizVar = size(nc{cvar}); nDims=length(sizVar);
218      if dims{1} == 'T'      if dims{1} == 'T'
# Line 246  function [S] = rdmnc_local(nc,varlist,it Line 251  function [S] = rdmnc_local(nc,varlist,it
251      if dBug > 1,      if dBug > 1,
252        fprintf(' i0,ni= %i %i; j,nj= %i %i; nk=%i :',i0,ni,j0,nj,nk);        fprintf(' i0,ni= %i %i; j,nj= %i %i; nk=%i :',i0,ni,j0,nj,nk);
253      end      end
254        % code by Bruno Deremble: if you do not want to read all tiles these
255        % modifications make the output field smaller, let us see, if it is
256        % robust
257        if (firstiter)
258          S.i_first.(cvar) = i0;
259          S.j_first.(cvar) = j0;
260        end
261        i0 = i0 - S.i_first.(cvar);
262        j0 = j0 - S.j_first.(cvar);
263        % end code by Bruno Deremble
264            
265      Sstr = '';      Sstr = '';
266      for istr = 1:max(nDims,length(dims)),      for istr = 1:max(nDims,length(dims)),
# Line 334  function [S] = rdmnc_local_matlabAPI(fna Line 349  function [S] = rdmnc_local_matlabAPI(fna
349        disp(['No such variable ''',cvar,''' in MNC file ',fname]);        disp(['No such variable ''',cvar,''' in MNC file ',fname]);
350        continue        continue
351      end      end
352        % code by Bruno Deremble: if you do not want to read all tiles these
353        % modifications make the output field smaller, let us see, if it is
354        % robust
355        if (isfield(S,cvar) == 0); firstiter = 1; else firstiter = 0; end
356        % end code by Bruno Deremble
357            
358      [varname,xtype,dimids,natts] = netcdf.inqVar(nc,varid);      [varname,xtype,dimids,natts] = netcdf.inqVar(nc,varid);
359      % does this variable contain a record (unlimited) dimension?      % does this variable contain a record (unlimited) dimension?
# Line 406  function [S] = rdmnc_local_matlabAPI(fna Line 426  function [S] = rdmnc_local_matlabAPI(fna
426      if dBug > 1,      if dBug > 1,
427        fprintf(' i0,ni= %i %i; j,nj= %i %i; nk=%i :',i0,ni,j0,nj,nk);        fprintf(' i0,ni= %i %i; j,nj= %i %i; nk=%i :',i0,ni,j0,nj,nk);
428      end      end
429      %      % code by Bruno Deremble: if you do not want to read all tiles these
430        % modifications make the output field smaller, let us see, if it is
431        % robust
432        if (firstiter)
433          S.i_first.(cvar) = i0;
434          S.j_first.(cvar) = j0;
435        end
436        i0 = i0 - S.i_first.(cvar);
437        j0 = j0 - S.j_first.(cvar);
438        % end code by Bruno Deremble
439    
440      Sstr = '';      Sstr = '';
441      for istr = 1:max(nDims,length(dims)),      for istr = 1:max(nDims,length(dims)),
442        if     istr == it,  Sstr = [Sstr,'dii,'];        if     istr == it,  Sstr = [Sstr,'dii,'];

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.25

  ViewVC Help
Powered by ViewVC 1.1.22