/[MITgcm]/MITgcm_contrib/verification_other/cpl_gray+ocn/input_ocn/gendata.m
ViewVC logotype

Contents of /MITgcm_contrib/verification_other/cpl_gray+ocn/input_ocn/gendata.m

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


Revision 1.2 - (show annotations) (download)
Tue Oct 7 01:09:25 2014 UTC (10 years, 9 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65u, checkpoint65j, checkpoint67a, checkpoint67b, checkpoint65i, checkpoint67d, checkpoint65m, checkpoint65f, checkpoint65h, checkpoint65n, HEAD
Changes since 1.1: +109 -26 lines
- add thin-walls to get a Double-Drake type config.
- adjust diagnostics to get climatological seasonal output

1
2 kwr=[1 1 1]*0;
3 %kwr=[0 1 0];
4
5 gDir='~/grid_cs32/';
6 G=load_grid(gDir,10,180,360);
7
8 nc=G.dims(2); nr=G.dims(3); nPxy=G.dims(1)*G.dims(2); nPp2=nPxy+2;
9 ncx=6*nc; np1=nc+1; globArea=sum(G.rAc(:));
10 rad=pi/180.; rEarth=6370.e+3;
11 %--
12 yg2=zeros(nPp2,1); yg2([1:nPxy],1)=reshape(G.yG,[nPxy 1]);
13 xg2=zeros(nPp2,1); xg2([1:nPxy],1)=reshape(G.xG,[nPxy 1]);
14 rAz2=zeros(nPp2,1); rAz2([1:nPxy],1)=reshape(G.rAz,[nPxy 1]);
15 %-- add missing corner:
16 xg2(nPxy+1)=xg2(1); yg2(nPxy+1)=yg2(1+2*nc); rAz2(nPxy+1)=rAz2(1);
17 xg2(nPxy+2)=xg2(1+3*nc); yg2(nPxy+2)=yg2(1); rAz2(nPxy+2)=rAz2(1);
18
19 [y6t]=split_Z_cub(yg2);
20 y6u=y6t(:,1:nc,:)+y6t(:,2:np1,:); yu=0.5*y6u(1:nc,:,:);
21 yu=reshape(permute(yu,[1 3 2]),[ncx nc]);
22 y6v=y6t(1:nc,:,:)+y6t(2:np1,:,:); yv=0.5*y6v(:,1:nc,:);
23 yv=reshape(permute(yv,[1 3 2]),[ncx nc]);
24
25 %- to make plots:
26 y1d=G.yAxC;
27
28 %-- make flat bathy (4.km deep, but real depth will be smaller if sum(drF) < 4.km)
29 depth=4000.;
30 var=-depth*ones(6*nc,nc);
31 if kwr(1) > 0,
32 fname='flat_4km.bin';
33 fid=fopen(fname,'w','b'); fwrite(fid,var,'real*8'); fclose(fid);
34 fprintf(['write file: ',fname,'\n']);
35 end
36
37 %-- make thin walls:
38 wallW=zeros(nc,6,nc); wallS=zeros(nc,6,nc);
39 mid=nc/2; mdp=mid+1;
40
41 %-- 1 single rigde from South to North poles, @ long 180:
42 % wallS(mdp:nc,3,mdp)=1;
43 % wallS(:,4,mdp)=1;
44 % wallW(mdp,6,1:mid)=1;
45
46 %-- Double Drake type, from North pole to 34.S, at long 90 and 180:
47 [J]=find(y6t(mdp,:,1)< -33.); js=J(end);
48 fprintf(' wall ends at Lat= %8.4f\n',y6t(mdp,js,1));
49 %- 1srt wall @ 90 (western Wall on face 3 & 2):
50 wallW(mdp,3,1:mid)=1;
51 wallW(mdp,2,js:nc)=1;
52 %- 2nd wall @ 180 (southern Wall on face 3 & 4):
53 wallS(mdp:nc,3,mdp)=1;
54 wallS(1:np1-js,4,mdp)=1;
55
56 wallW=reshape(wallW,[ncx nc]); wallS=reshape(wallS,[ncx nc]);
57 if kwr(2) > 0,
58 fname='wall_W_DbD.bin';
59 fid=fopen(fname,'w','b'); fwrite(fid,wallW,'real*8'); fclose(fid);
60 fprintf(['write file: ',fname,'\n']);
61 fname='wall_S_DbD.bin';
62 fid=fopen(fname,'w','b'); fwrite(fid,wallS,'real*8'); fclose(fid);
63 fprintf(['write file: ',fname,'\n']);
64 end
65
66 if kwr(3) > 0,
67 %- linked to danton:~jmc/exp/cpl_ideal/cpl_idl_05/ocn_c300
68 rDir='../cpl_idl_05.ocn_c300/'; it=2592000;
69 namf='Ttave';
70 var=rdmds([rDir,namf],it);
71 mnV=min(var(:)); MxV=max(var(:));
72 fprintf(' file: "%s" loaded: min,Max= %8.3f , %8.3f\n',namf,mnV,MxV);
73 fname='tIni_cpl.bin';
74 fid=fopen(fname,'w','b'); fwrite(fid,var,'real*8'); fclose(fid);
75 fprintf(['write file: ',fname,'\n']);
76
77 namf='Stave';
78 var=rdmds([rDir,namf],it);
79 mnV=min(var(:)); MxV=max(var(:));
80 fprintf(' file: "%s" loaded: min,Max= %8.3f , %8.3f\n',namf,mnV,MxV);
81 fname='sIni_cpl.bin';
82 fid=fopen(fname,'w','b'); fwrite(fid,var,'real*8'); fclose(fid);
83 fprintf(['write file: ',fname,'\n']);
84 end
85
86 %return
87 %imagesc(xc,yc,hh');set(gca,'YDir','normal');
88 %scalHV_colbar([1. 1. 0.5 0.7],1);
89 %grid;
90
91 shift=-1; ccB=[0 0]; cbV=1; AxBx=[-180 180 -90 90]; kEnv=0;
92 xc1=G.xC; yc1=G.yC;
93
94 figure(2);clf;
95 ns=0;
96 %var=txu;
97 %grph_CS(var,xc1,yc1,xg2,yg2,ccB(1),ccB(2),shift,cbV+ns/1000,AxBx,kEnv);
98 ccB=[-.5 1.5];
99 subplot(211);
100 var=wallW;
101 grph_CS(var,xc1,yc1,xg2,yg2,ccB(1),ccB(2),shift,cbV+ns/1000,AxBx,kEnv);
102 title('Western Wall');
103 subplot(212);
104 var=wallS;
105 grph_CS(var,xc1,yc1,xg2,yg2,ccB(1),ccB(2),shift,cbV+ns/1000,AxBx,kEnv);
106 title('Southern Wall');
107
108 figure(3);clf;
109 var=wallW;
110 grph_CS_6t(var,ccB(1),ccB(2),nc,'W-wall',1);
111 figure(4);clf;
112 var=wallS;
113 grph_CS_6t(var,ccB(1),ccB(2),nc,'S-wall',2);
114
115 return

  ViewVC Help
Powered by ViewVC 1.1.22