1 
% This is a matlab script that generates the input data 
2 

3 
% $Header: $ 
4 
% $Name: $ 
5 

6 
% Dimensions of grid 
7 
nx=100; 
8 
ny=100; 
9 
nz=50; 
10 
% Nominal depth of model (meters) 
11 
H=1000; 
12 
% Size of domain 
13 
Lx=2.0e3; 
14 
% Radius of cooling disk (m) 
15 
Rc=600.; 
16 
% Horizontal resolution (m) 
17 
dx=Lx/nx; 
18 
% Rotation 
19 
f=1.e4; 
20 
% Stratification 
21 
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 

27 
% Gravity 
28 
g=10.; 
29 
% E.O.S. 
30 
alpha=2.e4; 
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=xmean(x); 
38 
y=(1:ny)*dx;y=ymean(y); 
39 
z=dz/2:dz:H; 
40 

41 
% Temperature profile 
42 
Tref=Ts+Tz*zmean(Tz*z); 
43 
[sprintf('Tref =') sprintf(' %8.6g,',Tref)] 
44 

45 
% 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 
%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 

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 ; 