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

Contents of /MITgcm_contrib/gael/matlab_class/@gcmfaces/mean.m

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


Revision 1.2 - (show annotations) (download)
Thu Oct 20 20:57:01 2011 UTC (13 years, 8 months ago) by gforget
Branch: MAIN
CVS Tags: checkpoint65r, checkpoint65p, checkpoint65q
Changes since 1.1: +4 -0 lines
- add help sections at the top.

1 function r = mean(p,varargin)
2 %overloaded gcmfaces mean function :
3 % 1) if single gcmfaces argument, then returns the global mean over all faces
4 % 2) if more than one argument, then simply calls double mean function for
5 % each face data, passing over the other arguments
6
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=mean(tmp1);
14 return;
15 end;
16
17 r=p;
18
19 for iFace=1:r.nFaces;
20 iF=num2str(iFace);
21 eval(['r.f' iF '=mean(p.f' iF ',varargin{:});']);
22 end;
23
24

  ViewVC Help
Powered by ViewVC 1.1.22