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

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

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


Revision 1.1 - (hide annotations) (download)
Wed Jan 5 20:40:21 2005 UTC (20 years, 6 months ago) by afe
Branch: MAIN
CVS Tags: HEAD
some tuning to function, removed measleading help, added scalar backtester

1 afe 1.1 % converts U (rho), V (theta) and W in polar coords into
2     % proper u,v, and w in cartesian coords, plus into theta and
3     % rho vector components in a more physical annulus layout
4    
5     if (1)
6     % load data
7     Wwhole=rdmds('W');
8     %Twhole=rdmds('T');
9     W=Wwhole(:,:,15);
10     % set null-space areas to NaN (makes interpolation happier)
11     W(find(W==0))=NaN;
12     %T(find(T==0))=NaN;
13     %W(120,:)=0.005;
14     [ydim xdim]=size(W);
15     else
16     xdim=31;
17     ydim=120;
18     [X Y ]=meshgrid(1:xdim,1:ydim);
19     W=X;
20     W(:,1:8)=nan;
21     W(:,31)=nan;
22     %W(:,9)=26;
23    
24    
25     end
26    
27    
28    
29     % this determines resolution of interpolated fields
30     % 0.5 is perhaps a bit fine, but it looks pretty
31     %step=0.5;
32     % good for quiver plots
33     % step=1;
34     step=(xdim*2+1)/(xdim*2);
35    
36    
37     rhoi=1:31;
38     thetai=1:120;
39     z=1;
40    
41    
42    
43    
44     % convert w (effectively a scalar)
45     w=cyl2cart(W,-xdim:step:xdim,-xdim:step:xdim);
46     Wback=cart2cyl(w,thetai,rhoi);
47     % Tc=cyl2cart(T,-30:step:30,-30:step:30);
48     figure(1);imagesc(W(:,:,z));colorbar;
49     figure(2);imagesc(w(:,:,z));colorbar;
50     figure(3);imagesc(Wback(:,:,z));colorbar;
51     Werr=Wback-W;
52     figure(4);imagesc(Werr(:,:,z));colorbar;
53    
54    
55    

  ViewVC Help
Powered by ViewVC 1.1.22