1 |
function [fldOut]=rdmds2gcmfaces(fileName,varargin); |
function [fldOut]=rdmds2gcmfaces(varargin); |
2 |
|
%object: read with rmds then apply convert2gcmfaces |
3 |
|
%input: varargin are the options to pass to rdmds (type help rdmds) |
4 |
|
%output: fldOut is a gcmfaces object |
5 |
|
% |
6 |
|
%note: an earlier version was expecting nFaces to be passed |
7 |
|
% as the last argument; this is not the case anymore. |
8 |
|
|
9 |
if nargin>=3&~isempty(varargin{1}); |
v0=rdmds(varargin{1:end}); |
10 |
v0=rdmds(fileName,varargin{1:end-1}); nFaces=varargin{end}; |
fldOut=convert2gcmfaces(v0); |
|
elseif nargin>=3&isempty(varargin{1}); |
|
|
v0=rdmds(fileName,varargin{2:end-1}); nFaces=varargin{end}; |
|
|
elseif nargin==2~isempty(varargin{1}); |
|
|
v0=rdmds(fileName,varargin{1}); nFaces=5; |
|
|
else; |
|
|
v0=rdmds(fileName); nFaces=5; |
|
|
end; |
|
|
|
|
|
fldOut=convert2gcmfaces(v0,nFaces); |
|
11 |
|
|