xmax=5025; % km
ymax=3550; % km
dx=25; % km
dy=50; % km

nx=xmax/dx;
ny=ymax/dy;
x=[dx/2:dx:xmax-dx/2]';
y=[dy/2:dy:ymax-dy/2]';
etaini=zeros(nx,ny);
[X,Y]=ndgrid(x,y);

% Gaussian ridge
etaini=0.1*exp(-((X-nx*dx/2).^2)/100000);

% Gaussian blob
%etaini=0.1*exp(-((X-nx*dx/2).^2)/100000 - ((Y-ny*dy/2).^2)/100000);

% tanh 
%etaini=0.1*tanh((X-nx*dx/2)/500);

fid=fopen('etaini','wb','ieee-be'); fwrite(fid,etaini,'float64'); fclose(fid);
%swe2d_write_field(etaini,'etaini')
uini=zeros(nx,ny);
vini=zeros(nx,ny);
fid=fopen('uini','wb','ieee-be'); fwrite(fid,uini,'float64'); fclose(fid);
fid=fopen('vini','wb','ieee-be'); fwrite(fid,vini,'float64'); fclose(fid);
%swe2d_write_field(uini,'uini')
%swe2d_write_field(vini,'vini')
% Bathy: flat bottom
H=10*ones(nx,ny);
fid=fopen('flatbottom','wb','ieee-be'); fwrite(fid,H,'float64'); fclose(fid);
%swe2d_write_field(H,'flatBottom')

