/[MITgcm]/MITgcm_contrib/gmaze_pv/subfct/diagCatH.m
ViewVC logotype

Annotation of /MITgcm_contrib/gmaze_pv/subfct/diagCatH.m

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


Revision 1.1 - (hide annotations) (download)
Wed Sep 19 15:24:41 2007 UTC (17 years, 10 months ago) by gmaze
Branch: MAIN
CVS Tags: HEAD
General Update

1 gmaze 1.1 % Ch = diagCatH(C,depth,h)
2     %
3     % Get field C(depth,lat,lon) at depth h(lat,lon)
4     %
5     % depth < 0
6     % h < 0
7     %
8     % G. Maze, MIT, June 2007
9     %y
10    
11     function varargout = diagCatH(C,Z,h)
12    
13     % 0 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PREPROC
14     [nz,ny,nx] = size(C);
15     Ch = zeros(ny,nx);
16    
17     % 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMPUTING
18     warning off
19     for ix = 1 : nx
20     for iy = 1 : ny
21     Ch(iy,ix) = interp1( Z, squeeze(C(:,iy,ix)) , h(iy,ix) , 'linear');
22     end
23     end
24     warning on
25    
26     % 2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% OUTPUTS
27     switch nargout
28     case 1
29     varargout(1) = {Ch};
30     end

  ViewVC Help
Powered by ViewVC 1.1.22