function make_a_3d_surfplot(A,D,Depth,Velo,Direction)
%MAKE_A_3D_SURFPLOT  
%
% script for plotting the velocity and direction of the 26 hours measurement
% in a 3d surfaceplot. 
% Inputfiles are: struct A and D, and Matrices Depth, Velo and Direction.
%
%% collecting data

cbas = [4+26.0519/60 ;52+15.1497/60];
t    = [];
c    = [];
Diepte   =[];
Velocity =[];
Richting =[];

for kk=37:81
    Diepte    = [Diepte; Depth(kk,:)];
    t         = [t,A(kk).datenum];
    c         = [c,(cbas-[D(kk).lon(1);D(kk).lat(1)]).*100];
    Velocity  = [Velocity; Velo(kk,:)];
    Richting  = [Richting; Direction(kk,:)];
end
%% fixing right format

cc  =  sqrt(abs(c(1,:)).^2+abs(c(2,:)).^2);
t   =  repmat(t,[length(Diepte) 1])';
cc  =  repmat(cc(1,:),[length(Diepte) 1])';
%% VELOCITY PLOT

figure,
surf(t,cc,Diepte,Velocity)
hold on
xlabel('time');datetick('x')
ylabel('cross shore [m]')
zlabel('z [m]')
title('Cross shore Velocity magnitude Profile near Noordwijk 30 July 2009')
shading interp
set(gca,'ydir','reverse')
view(135,20)
Axis([t(2) t(end) 0 30 -20 0])
set(gcf,'renderer','zbuffer'); 
colorbarwithvtext('Velocity [m/s]')
%% DIRCETION PLOT

figure,
surf(t,cc,Diepte,Richting)
hold on
xlabel('time');datetick('x')
ylabel('cross shore [m]')
zlabel('z [m]')
title('Cross shore Salinity Profile near Noordwijk 30 July 2009')
shading interp
set(gca,'ydir','reverse')
view(135,20)
Axis([t(2) t(end) 0 30 -20 0 -180 180])
set(gcf,'renderer','zbuffer');
colorbarwithvtext('Direction [Degree]')