/[MITgcm]/MITgcm_contrib/gael/matlab_class/@gcmfaces/max.m
ViewVC logotype

Diff of /MITgcm_contrib/gael/matlab_class/@gcmfaces/max.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.2 by gforget, Thu Oct 20 20:57:01 2011 UTC revision 1.3 by gforget, Thu Apr 10 16:06:03 2014 UTC
# Line 1  Line 1 
1  function r = max(p,varargin)  function r = max(p,varargin)
2  %overloaded gcmfaces max function :  %overloaded gcmfaces max function :
3  %  1) if single gcmfaces argument, then returns the global max over all faces  %  1) if single gcmfaces argument, then returns the global max over all faces
4  %  2) if more than one argument, then simply calls double max function for  %  2) if two gcmfaces arguments, then returns the max of the two at each point
5  %     each face data, passing over the other arguments  %  3) otherwise calls double max function for each face, passing over the other arguments
6    
7  if nargin==1;  if nargin==1;
8     tmp1=[];     tmp1=[];
# Line 14  if nargin==1; Line 14  if nargin==1;
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 '=max(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 '=max(p.f' iF ',varargin{:});']);     eval(['r.f' iF '=max(p.f' iF ',varargin{:});']);

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.22