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.87154
% RMSE  = 1.2302
% MEAN  = 7.2328
% RANGE = 2.6285 - 16.3312

beta( 1 )= 2.7908e+00 ;
beta( 2 )= 3.5866e-03 ;
beta( 3 )= -8.5590e-01 ;
beta( 4 )= 1.1233e+00 ;
beta( 5 )= 5.0454e+01 ;
beta( 6 )= 2.5102e-02 ;
beta( 7 )= 5.2645e-01 ;
beta( 8 )= -4.5139e-02 ;
beta( 9 )= -3.0326e-01 ;

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