/[MITgcm]/MITgcm_contrib/verification_other/atm_gray/inp_cs/gendata.m
ViewVC logotype

Contents of /MITgcm_contrib/verification_other/atm_gray/inp_cs/gendata.m

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


Revision 1.2 - (show annotations) (download)
Tue Nov 6 21:43:48 2012 UTC (11 years, 5 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64k, checkpoint64x, checkpoint64z, checkpoint64o, checkpoint64p, checkpoint64r, checkpoint64w, checkpoint64v, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint64m, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65u, checkpoint65j, checkpoint67a, checkpoint67b, checkpoint65i, checkpoint67d, checkpoint65m, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65e, checkpoint64i, checkpoint64h, checkpoint65h, checkpoint65, checkpoint64j, checkpoint65n, HEAD
Changes since 1.1: +17 -6 lines
switch to APE-control SST

1
2 %gDir='../run_cs/';
3 gDir='../cs_grid/';
4 G=load_grid(gDir,0);
5
6 nx=G.dims(1); ny=G.dims(2); nc=ny;
7 xc=G.xC; yc=G.yC; xg=G.xG; yg=G.yG;
8
9 ccB=[0 0]; shift=-1; cbV=1; AxBx=[-180 180 -90 90]; kEnv=0;
10 %figure(1);clf;
11 %imagesc(msk'); set(gca,'YDir','normal');
12 %colorbar
13
14 %-- make SST field (cos shape, no noise) from grid-output file YC:
15 %yy=yc*pi/90;
16 %sst=273.15+9+19*cos(yy);
17 %fname='SST_cos0.bin';
18
19 yy=yc*pi/180;
20 sst=sin(1.5*yy); sst=1.-sst.*sst;
21 sst(find(abs(yc) > 60.))=0.;
22 sst=273.15+27*sst;
23 fname='SST_APE_1.bin';
24
25 %fid=fopen(fname,'w','b'); fwrite(fid,sst,'real*8'); fclose(fid);
26 %fprintf(['write file: ',fname,'\n']);
27
28 figure(1);clf;
29 var=sst;
30 grph_CS(var,xc,yc,xg,yg,ccB(1),ccB(2),shift,cbV,AxBx,kEnv);
31
32 %figure(2);clf;
33 %yy=[-90:1:90]*pi/180;
34 %var=sin(1.5*yy); var=1.-var.*var; var(find(abs(yy) > pi/3))=0.; var=27*var;
35 %plot(yy*180/pi,var,'r-'); axis([-90 90 -1 28]); grid
36 return
37
38 %-- make initial pot-temp field by adding noise to T(iter=0) output file:
39
40 rDir=gDir;
41 namf='T'; it=0;
42 tini=rdmds([rDir,namf],it);
43 nr=size(tini,3);
44
45 var=rand([nx,ny]); var=var-mean(var(:));
46 yy=yc*pi/90;
47 var=var.*(2+cos(yy))/3;
48 figure(2);clf;
49 %var=sst0;
50 grph_CS(var,xc,yc,xg,yg,ccB(1),ccB(2),shift,cbV,AxBx,kEnv);
51
52 noise=1.e-3;
53 tini1=tini+noise*reshape(reshape(var,[nx*ny 1])*ones(1,nr),[nx ny nr]);
54 %size(tini1)
55
56 %fname='ini_theta.bin';
57 %fid=fopen(fname,'w','b'); fwrite(fid,tini1,'real*8'); fclose(fid);
58 %fprintf(['write file: ',fname,'\n']);
59
60 %- spec-humid : put constant Rel-Humid in the lowest troposphere
61 relhum=0.8 ; pHum=800.e+2;
62 khum=max(find(G.rC > pHum));
63
64 %- taken from AIM -> qsat in g/kg, pIn = normalised Pressure
65 P0=1.e+5; pIn=G.rC/P0;
66 qsat=calc_Qsat(1,pIn,tini);
67 qsat=reshape(qsat,[nx ny nr]);
68 qini=qsat*1.e-3*relhum;
69 qini(:,:,khum+1:end)=0;
70
71 figure(3);clf;
72 pax=G.rC/100; %- in mb
73 i1=1; j1=1;
74 var=squeeze(qini(i1,j1,:));
75 plot(var,pax,'k-'); hold on;
76 i1=nc/2; j1=nc/2;
77 var=squeeze(qini(i1,j1,:));
78 plot(var,pax,'r-');
79 i1=nc*2.5; j1=nc*0.5;
80 var=squeeze(qini(i1,j1,:));
81 plot(var,pax,'b-');
82 hold off
83 set(gca,'YDir','reverse');
84 grid
85 legend('mid','eq','pol');
86 title('Q-ini profile');
87
88 %fname='ini_specQ.bin';
89 %fid=fopen(fname,'w','b'); fwrite(fid,qini,'real*8'); fclose(fid);
90 %fprintf(['write file: ',fname,'\n']);
91
92 return

  ViewVC Help
Powered by ViewVC 1.1.22