/[MITgcm]/MITgcm_contrib/high_res_cube/matlab-grid-generator/gen510grid.m
ViewVC logotype

Contents of /MITgcm_contrib/high_res_cube/matlab-grid-generator/gen510grid.m

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


Revision 1.1.1.1 - (show annotations) (download) (vendor branch)
Tue Nov 11 18:08:08 2003 UTC (21 years, 8 months ago) by cnh
Branch: MAIN, initial
CVS Tags: baseline, HEAD
Changes since 1.1: +0 -0 lines
Checking in work done with Dimitri on high-resolution cube gridding and parallel 
communications. 
   o code is in a contrib experiment for now so we can continue collaborating
     on it. However most code is general and will be moved into main branch once 
     it is fully hardened.
   o There are README files in the contrib root and in the subdirectories that
     explain the contents

1 format compact
2 path('/u/u0/dimitri/matlab/tools',path);
3 path('/u/u0/dimitri/matlab/whoi',path);
4 path('/u/u0/dimitri/matlab/mitgcm',path);
5 path('/u/adcroft/matlab/bin',path);
6
7 nx=510;
8
9 %for typ={'conf','q=0','q=1','q=1/2','q=7/8','q=i3','tan','tan2','new'}
10
11 for typ={'tan'}
12
13 [dxg,dyg,dxf,dyf,dxc,dyc,dxv,dyu,Ec,Eu,Ev,Ez,latC,lonC,latG,lonG,...
14 Q11,Q22,Q12, TUu,TUv,TVu,TVv ]=gengrid_fn(nx+1,2,typ{1},'c',0,1);
15 theta=zeros(nx/2,nx/2);
16 for i=1:nx/2, for j=1:nx/2
17 lat=[latG(i,j) latG(i+1,j)]*180/pi;
18 lon=[lonG(i,j) lonG(i+1,j)]*180/pi;
19 a=dist(lat,lon,'sphere');
20 lat=[latG(i,j) latG(i,j+1)]*180/pi;
21 lon=[lonG(i,j) lonG(i,j+1)]*180/pi;
22 b=dist(lat,lon,'sphere');
23 lat=[latG(i+1,j) latG(i,j+1)]*180/pi;
24 lon=[lonG(i+1,j) lonG(i,j+1)]*180/pi;
25 c=dist(lat,lon,'sphere');
26 theta(i,j)=acos((a^2+b^2-c^2)/2/a/b);
27 end, end
28 disp(typ{1})
29 disp(minmax(dxg*6371))
30 disp(minmax(dxg(1:nx/2,1:nx/2)./dyg(1:nx/2,1:nx/2)))
31 tmp=theta*180/pi; tmp(1,1)=nan;
32 disp(minmax(tmp))
33 mypcolor(theta*180/pi); colorbar
34 title(typ{1})
35 tmp=typ{1}; tmp(strfind(tmp,'/'))='_';
36 eval(['print -dpsc FIG' tmp])
37
38 end
39
40 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
41 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
42
43 clear all, close all, nx=510; genx;
44 PN='/u/u0/dimitri/cubed_sphere/cs-tan-c-510-1020/';
45
46 LONG=zeros(nx,6,nx); LATG=zeros(nx,6,nx);
47 for i=1:6
48 tmp=readbin([PN 'LONG.' myint2str(i,3) '.bin'],[nx+1 nx+1],1,'real*8');
49 LONG(:,i,:)=tmp(1:nx,1:nx);
50 tmp=readbin([PN 'LATG.' myint2str(i,3) '.bin'],[nx+1 nx+1],1,'real*8');
51 LATG(:,i,:)=tmp(1:nx,1:nx);
52 end
53 writebin([PN 'LONG.bin'],LONG,1,'real*8');
54 writebin([PN 'LATG.bin'],LATG,1,'real*8');
55
56 LONC=zeros(nx,6,nx); LATC=zeros(nx,6,nx);
57 for i=1:6
58 LONC(:,i,:)=readbin([PN 'LONC.' myint2str(i,3) '.bin'],[nx nx],1,'real*8');
59 LATC(:,i,:)=readbin([PN 'LATC.' myint2str(i,3) '.bin'],[nx nx],1,'real*8');
60 end
61 writebin([PN 'LONC.bin'],LONC,1,'real*8');
62 writebin([PN 'LATC.bin'],LATC,1,'real*8');
63
64 for nm={'DXC','DYC','DXF','DYF','DXG','DYG','DXV','DYU','RA','RAS','RAW','RAZ'}
65 fld=tile_fld(PN,nm{1},nx);
66 writebin([PN nm{1} '.bin'],fld,1,'real*8');
67 fld=[PN nm{1} '.bin']; plotfld, title([PN nm{1}]), pause
68 end

  ViewVC Help
Powered by ViewVC 1.1.22