function [ue,ve]=ekman(uw,vw);

%

%  Routine to estimate Ekman surface current velocity

%  from measured wind using the empirical formula:

%

%                Velocity (cm/s) = 1.6 * Wind (m/s)

%

%  and applying a 45 degrees to the right rotation.

%  (see Pond & Pickard page 104 and their comments)

%
% %function [ue,ve]=ekman(uw,vw);

%
% where

%

%          ue & ve = ekman current speed (cm/s)

%          uw & vw = oceanographic wind speed (m/s)



% find resultant wind direction and speed

[wdir,wspd]=directio(uw,vw);



% calculate ekman velocity

V=1.6*wspd;



%  add 45 to wind angle

cdir=wdir+45;



% if adding 45 went over 360, subtract 360

if cdir>=360; cdir=cdir-360; end;



% use subroutine to get ue and ve

[ue,ve]=sd2uv(V,cdir);

 