function v=compute_ekman_surge_cetp(vmax,rmax,r35,vt,phi,phi_in,w,a,n,lat)
% Computes ekman_surge_cetp
% Script automatically generated by fit_ekman_surge_cetp.m
% Inputs : 
% vmax           = Vmax (km/h)
% rmax           = Rmax (km)
% r35            = R35 (km)
% vt             = forward speed (km/h)
% phi            = track angle (deg)
% phi_in         = inflow angle (deg)
% w              = shelf width (km)
% a              = Dean slope a (-)
% n              = Mannings n
% lat            = latitude (deg)

% R2    = 0.82564
% RMSE  = 1.6842
% MEAN  = 9.1268
% RANGE = 3.0496 - 18.3333

beta( 1 )= 2.1620e+00 ;
beta( 2 )= 2.3494e-01 ;
beta( 3 )= -4.5569e-01 ;
beta( 4 )= 6.6332e-01 ;
beta( 5 )= 3.1936e+01 ;
beta( 6 )= 1.7537e-01 ;
beta( 7 )= 5.5351e-01 ;
beta( 8 )= 8.6251e-02 ;

v=(1+beta(2)*sin(phi*pi/180)).*( beta(5)+beta(1).*vmax.^beta(3).*r35.^beta(4) .* a.^beta(6) .* w.^beta(7)  .* phi_in.^beta(8)) ./ (cos(min(max(phi,-60),60)*pi/180).*vt);
