1 |
jmc |
1.1 |
% This is a matlab script that generates the input data |
2 |
|
|
|
3 |
jmc |
1.4 |
% $Header: /u/gcmpack/MITgcm/verification/tutorial_deep_convection/input/gendata.m,v 1.3 2008/04/24 01:48:52 jmc Exp $ |
4 |
jmc |
1.3 |
% $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 |
jmc |
1.4 |
imagesc(x,y,var'); set(gca,'YDir','normal'); |
61 |
jmc |
1.2 |
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 ; |