function velocity_average_g=CieloHorizontalVelocityDepthAverage(md,velocity_g);
%compute depth averaged horizontal velocity

vx_average2d=DepthAverage(md,velocity_g(1:6:uset.gsize));
vy_average2d=DepthAverage(md,velocity_g(2:6:uset.gsize));

%project onto layer 1 of 3d mesh
vx_average=project3d(md,vx_average2d,'node',1);
vy_average=project3d(md,vy_average2d,'node',1);

%output on g-set
velocity_average_g=zeros(uset.gsize,1);velocity_average_g(1:6:uset.gsize)=vx_average;velocity_average_g(2:6:uset.gsize)=vy_average;
