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' |
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)), |
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? |
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,']; |