function [u_star,flag] = charnock(u10,alpha_c,b) % flag = 1 did NOT converge % flag = 0 converged! % model parameters % alpha_c Charnock constant (0.011 - Liu & Tang; 0.018 ECMWF; 0.013 Zeng etc. % b smooth flow constant (0.11 all but NCEP) %alpha_c = 0.011; %b = 0.11; % permanent constants % nu is air kinematic viscosity g = 9.81; nu = 1.5e-5; % initialize u_star = 0.04 * u10; flag =1 ; for n = 1:10 z0 = alpha_c* u_star^2/g + b*nu/u_star; u_star_new = u10 *.4 / log(10/z0); small = abs((u_star_new - u_star)/(u_star+eps)); if small < 1e-6 flag = 0; break else u_star = u_star_new; end end