/[MITgcm]/MITgcm_contrib/osse/utils/cart2cyluv.m
ViewVC logotype

Annotation of /MITgcm_contrib/osse/utils/cart2cyluv.m

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


Revision 1.1 - (hide annotations) (download)
Thu Jan 13 20:25:24 2005 UTC (20 years, 6 months ago) by afe
Branch: MAIN
CVS Tags: HEAD
cart2cyluv and assorted testing stuff

1 afe 1.1 function [thetav,rhov] = cart2cyluv(u,v,thetai,rhoi,varargin)
2     % z=cart2cyl(c,xi,yi);
3     %
4    
5     NN=size(u);
6     [x y nz]=size(u);
7     stepx=(x+1)/(x);
8     stepy=(y+1)/(y);
9     [Y,X] = meshgrid(-(x)/2:stepx:(x)/2,-(y)/2:stepy:(y)/2);
10     [theta,rho] = cart2pol(X,Y);
11    
12     azimv=u.*cos(theta)+v.*-sin(theta);
13     radialv=u.*sin(theta)+v.*cos(theta);
14    
15     theta=(theta./(pi*2)+0.5).*(size(thetai,2));
16     rho=max(rhoi)*rho/((x)/2);
17     ntheta=x;nrho=y;
18    
19     THETA=reshape(theta,[1 ntheta*nrho]);
20     RHO=reshape(rho,[1 ntheta*nrho]);
21     del=griddata_preprocess(RHO,THETA,rhoi,thetai',varargin{:});
22    
23     for k=1:nz;
24     THETAV=reshape(azimv(:,:,k),[1 ntheta*nrho]);
25     RHOV=reshape(radialv(:,:,k),[1 ntheta*nrho]);
26     thetav(:,:,k)=griddata(RHO,THETA,THETAV,rhoi,thetai',varargin{:});
27     rhov(:,:,k)=griddata(RHO,THETA,RHOV,rhoi,thetai',varargin{:});
28     end % k
29    
30     % Split vertical and time dimensions
31     if size(NN,2)>2
32     thetav=reshape(thetav,[size(thetav,1) size(thetav,2) NN(3:end)]);
33     rhov=reshape(rhov,[size(rhov,1) size(rhov,2) NN(3:end)]);
34     end

  ViewVC Help
Powered by ViewVC 1.1.22