1 |
function r = nanmax(p,varargin) |
function r = nanmax(p,varargin) |
2 |
%overloaded gcmfaces nanmax function : |
%overloaded gcmfaces nanmax function : |
3 |
% 1) if single gcmfaces argument, then returns the global nanmax over all faces |
% 1) if single gcmfaces argument, then returns the global nanmax over all faces |
4 |
% 2) if more than one argument, then simply calls double nanmax function for |
% 2) if two gcmfaces arguments, then returns the nanmax of the two at each point |
5 |
% each face data, passing over the other arguments |
% 3) otherwise calls double nanmax function for each face, passing over the other arguments |
6 |
|
|
7 |
if nargin==1; |
if nargin==1; |
8 |
tmp1=[]; |
tmp1=[]; |
14 |
return; |
return; |
15 |
end; |
end; |
16 |
|
|
17 |
r=p; |
if isa(varargin{1},'gcmfaces'); |
18 |
|
r=p; |
19 |
|
for iFace=1:r.nFaces; |
20 |
|
iF=num2str(iFace); |
21 |
|
eval(['r.f' iF '=nanmax(p.f' iF ',varargin{1}.f' iF ');']); |
22 |
|
end; |
23 |
|
return; |
24 |
|
end; |
25 |
|
|
26 |
|
|
27 |
|
r=p; |
28 |
for iFace=1:r.nFaces; |
for iFace=1:r.nFaces; |
29 |
iF=num2str(iFace); |
iF=num2str(iFace); |
30 |
eval(['r.f' iF '=nanmax(p.f' iF ',varargin{:});']); |
eval(['r.f' iF '=nanmax(p.f' iF ',varargin{:});']); |