NCfile=('http://opendap.deltares.nl/thredds/dodsC/opendap/rijkswaterstaat/BKL_TKL_MKL/MKL.nc')

%nc_dump(NCfile);

MKL_x=nc_varget(NCfile,'momentary_coastline_x');
MKL_y=nc_varget(NCfile,'momentary_coastline_y');

dates=nc_varget(NCfile,'time')+ datenum([1970 1 1 0 0 0]);
%%
names=nc_varget(NCfile,'areaname');

namecode=nc_varget(NCfile,'areacode');
id=nc_varget(NCfile,'id');
ind_Dl=find (namecode == 9)




%% data 2010
i_yr=46;
MKL2010=[];
MKL2010(:,1)=MKL_x(i_yr,ind_Dl);
MKL2010(:,2)=MKL_y(i_yr,ind_Dl);
MKL2010=MKL2010(~isnan(MKL2010(:,1)),:);

%% data 2007
i_yr=43;
MKL2007=[];
MKL2007(:,1)=MKL_x(i_yr,ind_Dl);
MKL2007(:,2)=MKL_y(i_yr,ind_Dl);
MKL2007=MKL2007(~isnan(MKL2007(:,1)),:);


%% data 2002
i_yr=38;
MKL2002=[];
MKL2002(:,1)=MKL_x(i_yr,ind_Dl);
MKL2002(:,2)=MKL_y(i_yr,ind_Dl);
MKL2002=MKL2002(~isnan(MKL2002(:,1)),:);

%%
figure
plot(MKL2010(:,1),MKL2010(:,2),'.-k')
hold on
plot(MKL2007(:,1),MKL2007(:,2),'.-b')
plot(MKL2002(:,1),MKL2002(:,2),'.-g')
legend('2010','2007','2002')

axis equal
xlabel('X_{RD} [m]');
ylabel('Y_{RD} [m]');
