| 1 |
% This is a matlab script that generates the input data |
| 2 |
|
| 3 |
% Dimensions of grid |
| 4 |
nx=100; |
| 5 |
ny=100; |
| 6 |
nz=50; |
| 7 |
% Nominal depth of model (meters) |
| 8 |
H=1000; |
| 9 |
% Size of domain |
| 10 |
Lx=2.0e3; |
| 11 |
% Radius of cooling disk (m) |
| 12 |
Rc=600.; |
| 13 |
% Horizontal resolution (m) |
| 14 |
dx=Lx/nx; |
| 15 |
% Rotation |
| 16 |
f=1.e-4; |
| 17 |
% Stratification |
| 18 |
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 |
|
| 24 |
% Gravity |
| 25 |
g=10.; |
| 26 |
% 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 |
Tref=Ts+Tz*z-mean(Tz*z); |
| 40 |
[sprintf('Tref =') sprintf(' %8.6g,',Tref)] |
| 41 |
|
| 42 |
% 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 ; |