def Trans_single(k, K, u_10, fetch, azimuth, divergence): nk = k.shape[0] c_beta = 0.04 # wind wave growth parameter k_hat = wn_dless_single(k, u_10) K_hat = K * fv(u_10)**2 / const.g wind_exponent = wind_exp(k) mk = wn_exp(k.reshape(nk, 1), u_10, fetch, azimuth) c_tau = wind_exponent / (2 * c_beta) # constant # transfer function T = c_tau * k_hat**(-3 / 2) * mk * fv(u_10) * divergence / ( const.g * (1 + 1j * c_tau * k_hat**(-2) * K_hat)) return T
def GoM_Trans(k, K, u_10, fetch, azimuth, div): nk = k.shape[2] c_beta = 0.04 # wind wave growth parameter k_hat = wn_dless(k, u_10) K_hat = K * fv(u_10) ** 2 / const.g wind_exponent = np.zeros([div.shape[0], div.shape[1], nk]) mk = np.zeros([div.shape[0], div.shape[1], nk]) for ii in np.arange(k.shape[0]): for jj in np.arange(k.shape[1]): wind_exponent[ii ,jj, :] = wind_exp(k[ii, jj, :]) mk[ii, jj, :] = wn_exp(k[ii, jj, :].reshape(nk, 1), u_10[ii, jj], fetch, azimuth)[:, 0] c_tau = wind_exponent / (2 * c_beta) # constant # transfer function T = c_tau * k_hat ** (-3 / 2) * mk * fv(u_10)[:, :, None] * div[:, :, None] / (const.g*( 1 + 1j * c_tau * k_hat ** (-2) * K_hat[:, :, None])) return T
def Trans(k, K, u_10, fetch, azimuth, tsc): nk = k.shape[2] c_beta = 0.04 # wind wave growth parameter k_hat = wn_dless(k, u_10) K_hat = K * fv(u_10)**2 / const.g wind_exponent = np.zeros([tsc.shape[0], tsc.shape[1], nk]) mk = np.zeros([tsc.shape[0], tsc.shape[1], nk]) for ii in np.arange(k.shape[0]): for jj in np.arange(k.shape[1]): wind_exponent[ii, jj, :] = wind_exp(k[ii, jj, :]) mk[ii, jj, :] = wn_exp(k[ii, jj, :].reshape(nk, 1), u_10[ii, jj], fetch, azimuth)[:, 0] c_tau = wind_exponent / (2 * c_beta) # constant # divergence of the sea surface current divergence = np.gradient(tsc[:, :, 0], 1e3, axis=1) + np.gradient( tsc[:, :, 1], 1e3, axis=0) # transfer function T = c_tau * k_hat**( -3 / 2) * mk * fv(u_10)[:, :, None] * divergence[:, :, None] / ( const.g * (1 + 1j * c_tau * k_hat**(-2) * K_hat[:, :, None])) return T
def WB_emp(K, kr, u_10, tsc): # empirical wave breaking contrasts from Eq.17 in [Kudryavtsev, 2012] cq = 470 U = fv(u_10) kb = kr / 10 omegab = np.sqrt(const.g * kb + const.gamma * kb**3 / const.rho_water) divergence = np.gradient(tsc[:, :, 0], 1e3, axis=1) + np.gradient( tsc[:, :, 1], 1e3, axis=0) wb_c = -cq * np.log(U * kb / np.sqrt( const.g * K)) * const.g * divergence / (U**2 * kb * omegab) return wb_c
def divergence(sst, lat, lon, wind_speed, K, phi, phi_w, s): """ :param sst: sea surface temperature :param wind_speed: :param K: wave number vector :param phi: the direction of wave number vector :param phi_w: the direction of wind velocity vector :param s: sign of Coriolis parameter :return: """ # interpolate data sst = set_nan(sst) sst = nearest_nan(sst, lat, lon) sst = mean_zeros(sst) ## compute the divergence T = np.fft.fft2(sst) # sst in fourier space V = np.sqrt(const.rho_air/const.rho_water)*fv(wind_speed) # friction velocity in the water diver = 1j * const.alpha * const.g * V * (s * np.sin(phi_w - phi) + 1j * const.yita ** (3 / 4) * const.nb ** 0.5 * V * K / abs(const.f)) * K ** 2 * T / (const.yita ** 0.25 * const.nb ** 0.5 * const.f ** 2) # apply fan filter for divergence to show the structures a = np.array(range(0, int(sst.shape[1] / 2))) b = np.array(range(-int(sst.shape[1] / 2), 0)) n = np.append(a, b) a = np.array(range(0, int(sst.shape[0] / 2))) b = np.array(range(-int(sst.shape[0] / 2), 0)) m = np.append(a, b) mf = np.sinc(m / 500) mf[abs(m) > 500] = 0 nf = np.sinc(n / 500) nf[abs(n) > 500] = 0 fan = mf.reshape(mf.shape[0], 1) * nf diver = fan * diver D = np.fft.ifft2(diver) return D
def wn_dless_single(k, u_10): # dimensionless wave number of wind waves return k * fv(u_10)**2 / const.g
def wn_dless(k, u_10): # dimensionless wave number of wind waves return k * fv(u_10)[:, :, None]**2 / const.g
def MSS_em(K, u_10, tsc): # Empirical mss from Eq.17 in [Kudryavtsev, 2012] divergence = np.gradient(tsc[:, :, 0], 1e3, axis=1) + np.gradient(tsc[:, :, 1], 1e3, axis=0) cs = 180 U = fv(u_10) return -cs * divergence / (U * np.sqrt(const.ky * K))
def GoM_MSS_em(K, u_10, div): # Empirical mss from Eq.17 in [Kudryavtsev, 2012] cs = 180 U = fv(u_10) return -cs * div / (U * np.sqrt(const.ky * K))