-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnexus_tracking_bones.m
More file actions
56 lines (39 loc) · 1.2 KB
/
nexus_tracking_bones.m
File metadata and controls
56 lines (39 loc) · 1.2 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
54
55
56
close all
clear
% read in dima's model states (subsampled)
load FVsubsampled
% set start time for particle tracking in matlab days
starttime = FVsub.mt(1);
% set particle tracking timestep
dtsec = 60; % minutes
dtday = dtsec/(60*60*24); % convert to days
% conversion factors between degrees of longitude/latitude
metrestolon = 90/1e7/cosd(56);
metrestolat = 90/1e7;
% intialise particle postions
% **your code here!**
% time stepping loop
it = 1; % initial time step
itmax = 2000; % number of timesteps for this simulation
while(it<itmax)
it = it+1;
time(it) = time(it-1)+dtday;
% need to decide which is the model snapshot to use
% no interpolaton in time used
% **your code here!**
% find u and v at the current time and particle positions
% **your code here!**
% step particle positions forward in time
% **your code here!**
% plot particles
clf
% **your code here!**
% draw coastline
load etive6_0coast
plot(ncst(:,1),ncst(:,2),'k')
set(gca,'xlim',[-5.5 -5.35],'ylim',[56.43 56.5])
set(gca,'dataaspectratio',[1 cosd(mean(ylim)) 1])
% add a timestamp
text(-5.45,56.44,datestr(time(it)))
drawnow % needed to make each frame appear as a movie
end