1 |
function [S] = rdmnc_mod(varargin) |
function [S] = rdmnc_mod2(varargin) |
2 |
|
|
3 |
% Usage: |
% Usage: |
4 |
% S=RDMNC(FILE1,FILE2,...) |
% S=RDMNC(FILE1,FILE2,...) |
14 |
% ITER Vector of iterations in the MNC/netcdf files, not model time. |
% ITER Vector of iterations in the MNC/netcdf files, not model time. |
15 |
% |
% |
16 |
% Output: |
% Output: |
17 |
% S Structure with mutliple fields |
% S Structure with fields corresponding to 'VAR1', 'VAR2', ... |
18 |
% |
% |
19 |
% Description: |
% Description: |
20 |
% This function rudimentary wrapper for joining and reading netcdf files |
% This function is a rudimentary wrapper for joining and reading netcdf |
21 |
% produced by MITgcm. It does not give the same flexibility as opening |
% files produced by MITgcm. It does not give the same flexibility as |
22 |
% the netcdf files directly using netcdf(). It is useful for quick |
% opening the netcdf files directly using netcdf(), but is useful for |
23 |
% loading of entire model fields which are distributed in multiple netcdf |
% quick loading of entire model fields which are distributed in multiple |
24 |
% files. |
% netcdf files. |
25 |
% |
% |
26 |
% Example: |
% Example: |
27 |
% >> S=rdmnd('state.*','XC','YC','RC','T'); |
% >> S=rdmnd('state.*','XC','YC','T'); |
28 |
% >> imagesc( S.XC, S.YC, S.T(:,:,1)' ); |
% >> imagesc( S.XC, S.YC, S.T(:,:,1)' ); |
29 |
|
% |
30 |
|
% Author: Alistair Adcroft |
31 |
|
% Modifications: Daniel Enderton |
32 |
|
|
33 |
% Initializations |
% Initializations |
34 |
file={}; |
file={}; |
103 |
|
|
104 |
function [A] = read_att(nc); |
function [A] = read_att(nc); |
105 |
allatt=ncnames(att(nc)); |
allatt=ncnames(att(nc)); |
106 |
A='none'; |
if ~isempty(allatt) |
107 |
for attr=allatt; |
for attr=allatt; |
108 |
A.(char(attr))=nc.(char(attr))(:); |
A.(char(attr))=nc.(char(attr))(:); |
109 |
|
end |
110 |
|
else |
111 |
|
A = 'none'; |
112 |
end |
end |
113 |
|
|
114 |
function [i0,j0,fn] = findTileOffset(S); |
function [i0,j0,fn] = findTileOffset(S); |