-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPostSandyTilesTest.m
50 lines (48 loc) · 1.63 KB
/
PostSandyTilesTest.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
clear all;clc;close all;
addpath(genpath('OceanMesh2D/'));
addpath(genpath('third-party/'));
addpath(genpath('datasets/'));
wl=30;
dt=0;
grade=0.25;
R=5;
slp=15;
min_el = 1000;
max_el = 10000;
gdat{1} = geodata('shp', 'GSHHS_f_L1',...
'dem', 'topo15_compressed.nc',...
'bbox', [-100 -53; 5 52.5],...
'h0', min_el);
fh{1} = edgefx('geodata',gdat{1},'fs',R,'wl',wl,'slp',slp,...
'max_el',max_el,'dt',dt,'g',grade);
dems = glob('datasets/*.nc');
dems(ismember(dems,'datasets/topo15_compressed.nc')) = [];
min_el = 50;
for i = 1:10%length(dems)
shp = split(dems{i}, '/');
shp = split(shp{end}, '.nc');
shp = strcat(shp{1},'.shp');
shp = strcat('datasets/coastline_', shp);
gdat{i+1} = geodata('shp', shp,...
'dem',dems{i},...
'h0',min_el);
fh{i+1} = edgefx('geodata',gdat{i+1},...
'fs',R,...
'wl',wl,...
'slp',slp,...
'max_el',max_el,...
'dt',dt,...
'g',grade);
end
mshopts = meshgen('ef',fh,'bou',gdat,'plot_on',1,'itmax',50);
mshopts = mshopts.build;
m = mshopts.grd;
m = interp(m,gdat);
m.b = max(m.b,1);
%% Make the nodestrings
m = makens(m,'auto',gdat{1}); % make the nodestring boundary conditions
%% Plot and save the msh class object/write to fort.14
plot(m,'bd',1,'Sinusoidal'); % plot on Sinusoidal projection with nodestrings
plot(m,'b',1,'Sinusoidal'); % plot the bathy on Sinusoidal projection
% Write an ADCIRC fort.14 compliant file to disk.
write(m,'PostSandyTestMesh_min_el_50')