function ub = ubqf( T, Hs, h )
% UBQF  Quick approximation of near-bottom orbital velocity.
%
% ub = ubqf( T, Hs, h )
%
% (eg, Dyer, 1986, Eqn 3.50, p 98).
%
% Uses approximate explicit method found in 
% Dean and Dalrymple (1991), p 72.
% Calls qkhf.m
%
% Input:
%  T Wave period [s]
%  Hs Wave height [m]
%  h Water depth [m]
% Returns:
%  Wave-orbital velocity amplitude ub = Hs*pi / T*sinh(kh) [m/s]

% Chris Sherwood, USGS
% March 17, 1999

% Idiot lights
if( T < 0.0001 )
  fprintf(stderr,'Warning from ubqf: small T = %g\n',T);
  ub = 0.;
  return
end
if( Hs >= 0.78*h ),      
  fprintf(stderr,'Warning from ubqf: wave is breaking; Hs limited.\n');
  Hs = 0.78*h;
end   
w=2*pi./T;
kh=qkhf(w,h);
amp = Hs ./ (2.*sinh(kh));
ub = w .* amp;




