1 |
% This is a matlab script that generates the input data |
2 |
% $Header: $ |
3 |
% $Name: $ |
4 |
|
5 |
prec='real*8'; |
6 |
ieee='b'; |
7 |
|
8 |
% Dimensions of grid |
9 |
nx=52; |
10 |
ny=1; |
11 |
nz=50; |
12 |
% Nominal depth of model (meters) |
13 |
H=10.; |
14 |
% Size of interior domain |
15 |
Lx=10.; |
16 |
|
17 |
% Horizontal resolution (m) |
18 |
dx=Lx/(nx-2); |
19 |
dy=dx; |
20 |
x=[1:nx]*dx; x=x-mean(x)+Lx/2; |
21 |
fprintf('dx = %d ; x 1,2 .. nx-1,nx = %7.4g %7.4g %7.4g %7.4g\n', ... |
22 |
dx,x(1),x(2),x(nx-1),x(nx)); |
23 |
|
24 |
%gravity=9.81; |
25 |
gravity=10.; |
26 |
|
27 |
dz=H/nz; |
28 |
fprintf('delZ = %d * %7.6g\n',nz,dz) |
29 |
|
30 |
%- initial free-surface: |
31 |
Ampli=0.15; |
32 |
et=x*pi/Lx; et=Ampli*cos(et); |
33 |
et(1)=0; et(nx)=0; |
34 |
|
35 |
%- closed bassin: |
36 |
h0=ones(nx,1); h0(1)=0; h0(nx)=0; |
37 |
h0=-H*h0; |
38 |
|
39 |
fid=fopen('topo_flat.bin','w',ieee); fwrite(fid,h0,prec); fclose(fid); |
40 |
fid=fopen('Eta_ini.bin','w',ieee); fwrite(fid,et,prec); fclose(fid); |
41 |
|
42 |
figure(1);clf; |
43 |
plot(x,et,'k-'); |
44 |
axis([-0.2 10.2 [-1 1]*0.16]); grid |