/[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.2 - (hide annotations) (download)
Wed Apr 23 23:23:31 2008 UTC (16 years ago) by jmc
Branch: MAIN
Changes since 1.1: +38 -19 lines
update this set-up : higher resolution and larger computational domain

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

  ViewVC Help
Powered by ViewVC 1.1.22