% make_new_gb10mallA.m

clear
load gb10mall
z=[z;NaN*z(1,:)];
[N,M]=size(z);

new=[z zeros(N,1)];
one=ones(N,1);

ind=find(isnan(z(:,1)));
ndrift=length(ind); % number of drifters
nstart=1;

for n=1:ndrift
   nstop=ind(n);
   nn=[nstart:nstop]';
   new(nn,8)=n*one(nn);
   nstart=ind(n)+1;
end

z=new;
save gb10mallA z
clear
load gb10mallA