/[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.3 by gforget, Thu Apr 10 16:06:03 2014 UTC revision 1.4 by gforget, Mon Feb 8 13:19:21 2016 UTC
# Line 1  Line 1 
1  function r = max(p,varargin)  function r = max(p,varargin)
2    % MAX(p,varargin)
3    %
4  %overloaded gcmfaces max function :  %overloaded gcmfaces max function :
5  %  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
6  %  2) if two gcmfaces arguments, then returns the max of the two at each point  %  2) if two gcmfaces arguments, then returns the max of the two at each point
# Line 23  if isa(varargin{1},'gcmfaces'); Line 25  if isa(varargin{1},'gcmfaces');
25     return;     return;
26  end;  end;
27    
28    if varargin{2}>0;
29  r=p;    r=p;
30  for iFace=1:r.nFaces;    for iFace=1:r.nFaces;
31     iF=num2str(iFace);       iF=num2str(iFace);
32     eval(['r.f' iF '=max(p.f' iF ',varargin{:});']);       eval(['r.f' iF '=max(p.f' iF ',varargin{:});']);
33      end;
34    else;
35      tmp1=convert2gcmfaces(p);
36      [n1,n2,n3,n4]=size(tmp1);
37      tmp1=reshape(tmp1,n1*n2,n3,n4);
38      r=max(tmp1,[],1);
39  end;  end;
40    
41    

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

  ViewVC Help
Powered by ViewVC 1.1.22