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

Annotation of /MITgcm_contrib/gael/matlab_class/@gcmfaces/min.m

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


Revision 1.3 - (hide annotations) (download)
Thu Apr 10 16:06:03 2014 UTC (11 years, 3 months ago) by gforget
Branch: MAIN
CVS Tags: checkpoint65r, checkpoint65p, checkpoint65q
Changes since 1.2: +11 -3 lines
- fix case of two gcmfaces arguments (issue reported by I. Fenty).

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

  ViewVC Help
Powered by ViewVC 1.1.22