1 |
% This is a matlab script that generates the input data |
2 |
% variable x resolution |
3 |
|
4 |
prec='real*8'; |
5 |
ieee='b'; |
6 |
|
7 |
% Dimensions of grid |
8 |
%nx=80; |
9 |
nx=3; |
10 |
ny=1; |
11 |
nz=20; |
12 |
% Nominal depth of model (meters) |
13 |
H=1000.0; |
14 |
% Size of domain |
15 |
Lx=15e3; |
16 |
|
17 |
dx = Lx/nx; |
18 |
dz = H/nz; |
19 |
% Horizontal resolution (m) |
20 |
%Variable resolution |
21 |
|
22 |
dy = dx; |
23 |
|
24 |
% Flux |
25 |
Qo=200; |
26 |
|
27 |
% Stratification |
28 |
gravity=9.81; |
29 |
talpha=2.0e-4; |
30 |
N2=2.56e-4; |
31 |
Tz=N2/(gravity*talpha); |
32 |
Sz=0.05; |
33 |
|
34 |
sprintf('delR = %d * %7.6g,',nz,dz) |
35 |
|
36 |
z=-dz/2:-dz:-H; |
37 |
Tref=Tz*z/(H/20)+2; |
38 |
Sref=34.025-Sz*z/(H/20); |
39 |
[sprintf('Tref =') sprintf(' %8.6g,',Tref)] |
40 |
[sprintf('Sref =') sprintf(' %8.6g,',Sref)] |
41 |
|
42 |
Q=zeros([nx,ny]); |
43 |
Q(1) = 0; |
44 |
Q(2) = 200; |
45 |
Q(3) = 0; |
46 |
fid=fopen('Qnet.forcing','w',ieee); fwrite(fid,Q,prec); fclose(fid); |
47 |
|
48 |
s=zeros([nx,ny,nz]); |
49 |
for k=1:nz |
50 |
s(:,:,k) = s(:,:,k) + Sref(k); |
51 |
end |
52 |
fid=fopen('S.init','w',ieee); fwrite(fid,s,prec); fclose(fid); |
53 |
|
54 |
t0=1*ones([nx,ny,nz]); |
55 |
t=t0; |
56 |
fid=fopen('T.init','w',ieee); fwrite(fid,t,prec); fclose(fid); |
57 |
|
58 |
t=t0; |
59 |
t(2,1,1) = .5; |
60 |
fid=fopen('Tinstable.init','w',ieee); fwrite(fid,t,prec); fclose(fid); |
61 |
|
62 |
t=t0; |
63 |
for k=1:nz |
64 |
t(:,:,k) = t(:,:,k) + Tref(k); |
65 |
end |
66 |
fid=fopen('Tstable.init','w',ieee); fwrite(fid,t,prec); fclose(fid); |
67 |
|
68 |
t=t0; |
69 |
t(2,1,1) = -.5; |
70 |
for k=1:nz |
71 |
t(:,:,k) = t(:,:,k) + Tref(k); |
72 |
end |
73 |
fid=fopen('Tstable2.init','w',ieee); fwrite(fid,t,prec); fclose(fid); |
74 |
|
75 |
taux = 0*ones([nx,ny]); |
76 |
taux(2:3,:) = 1; |
77 |
fid=fopen('taux.forcing','w',ieee); fwrite(fid,taux,prec); fclose(fid); |
78 |
|
79 |
tke = 1e-6*ones([nx,ny,nz]); |
80 |
tke(2,1,1) = 1e-3; |
81 |
fid=fopen('TKE.init','w',ieee); fwrite(fid,tke,prec); fclose(fid); |
82 |
|
83 |
|