/[MITgcm]/MITgcm/verification/tutorial_deep_convection/input/gendata.m
ViewVC logotype

Annotation of /MITgcm/verification/tutorial_deep_convection/input/gendata.m

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


Revision 1.3 - (hide annotations) (download)
Thu Apr 24 01:48:52 2008 UTC (16 years ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64q, checkpoint64p, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint64, checkpoint60, checkpoint61, checkpoint62, checkpoint63, checkpoint59q, checkpoint59r, checkpoint62c, checkpoint62b, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint61f, checkpoint61g, checkpoint61d, checkpoint61e, checkpoint61b, checkpoint61c, checkpoint61a, checkpoint61n, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61q, checkpoint61z, checkpoint61x, checkpoint61y
Changes since 1.2: +5 -1 lines
was too long and too boring: now run for only 3 time steps
and start with output at t=120mn as (pseudo) initial conditions

1 jmc 1.1 % This is a matlab script that generates the input data
2    
3 jmc 1.3 % $Header: $
4     % $Name: $
5    
6 jmc 1.1 % Dimensions of grid
7 jmc 1.2 nx=100;
8     ny=100;
9     nz=50;
10 jmc 1.1 % Nominal depth of model (meters)
11     H=1000;
12     % Size of domain
13 jmc 1.2 Lx=2.0e3;
14     % Radius of cooling disk (m)
15     Rc=600.;
16 jmc 1.1 % Horizontal resolution (m)
17     dx=Lx/nx;
18     % Rotation
19 jmc 1.2 f=1.e-4;
20 jmc 1.1 % Stratification
21 jmc 1.2 N=0.0*(f*Rc/H);
22     % surface temperature
23     Ts=20.;
24     % Flux : Cooling disk & noise added to cooling
25     Qo=800; Q1=10;
26 jmc 1.1
27     % Gravity
28 jmc 1.2 g=10.;
29 jmc 1.1 % E.O.S.
30     alpha=2.e-4;
31    
32     Tz=N^2/(g*alpha)
33    
34     dz=H/nz;
35     sprintf('delZ = %d * %7.6g,',nz,dz)
36    
37     x=(1:nx)*dx;x=x-mean(x);
38     y=(1:ny)*dx;y=y-mean(y);
39     z=-dz/2:-dz:-H;
40    
41     % Temperature profile
42 jmc 1.2 Tref=Ts+Tz*z-mean(Tz*z);
43     [sprintf('Tref =') sprintf(' %8.6g,',Tref)]
44 jmc 1.1
45 jmc 1.2 % Surface heat flux : refine the grid (by 3 x 3) to assign mean heat flux
46     Q=Qo+Q1*(0.5+rand([nx,ny]));
47     Qc=zeros(nx,ny);
48     xc=x'*ones(1,ny); yc=ones(nx,1)*y;
49     for j=-1:1, for i=-1:1,
50     xs=xc+dx*i/3 ; ys=yc+dx*j/3; r2=xs.*xs+ys.*ys;
51     qs=Q/9; qs( find(r2 > Rc*Rc) )=0.;
52     Qc=Qc+qs;
53     end ; end
54 jmc 1.3 %fid=fopen('Qnet_p64.bin','w','b'); fwrite(fid,Qc,'real*8'); fclose(fid);
55     fid=fopen('Qnet_p32.bin','w','b'); fwrite(fid,Qc,'real*4'); fclose(fid);
56 jmc 1.2
57     var=2*pi*[0:1000]/1000; xl=Rc*cos(var); yl=Rc*sin(var);
58     figure(1);clf;
59     var=Qc; var(find(var==0))=NaN;
60     imagesc(xc,yc,var'); set(gca,'YDir','normal');
61     caxis([-15 820]);
62     %change_colmap(-1);
63     colorbar
64     grid;
65     hold on
66     L=line(xl,yl);
67     set(L,'color',[0 0 0]);
68     hold off ;

  ViewVC Help
Powered by ViewVC 1.1.22