-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathTadpoleRun.m
More file actions
53 lines (32 loc) · 1.14 KB
/
TadpoleRun.m
File metadata and controls
53 lines (32 loc) · 1.14 KB
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
51
52
53
function [p,g] = TadpoleRun(p,g)
% TadpoleRun.m
%
% Performs main iteration loop of Tadpole
n=0;
while p.t < p.tf
n = n + 1;
%%%%%%%%%%%%%%%%%%%%%% UPDATE ELEVATIONS %%%%%%%%%%%%%%%%%%%%%%%
[p g] = Update(p,g);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%% INCREMENT TIME %%%%%%%%%%%%%%%%%%%%%%%%%
p.t = p.t + p.dt;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%% PLOTTING %%%%%%%%%%%%%%%%%%%%%%%%%%%
% if it is time to redraw the plot, do so.
if p.doDrawPlot
if ~rem(n,p.plotint)
DrawPlot(n,p,g)
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%% SAVE DATA %%%%%%%%%%%%%%%%%%%%%%%%%%%%
if p.doSaveOutput
if ~rem(n,p.saveint)
p.lastsave = n/p.saveint + 1;
g.output(:,:,p.lastsave) = g.U;
g.t(p.lastsave) = p.t;
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end
p.iterations = n;