1199 amrex::Real ustar = 0.0;
1200 amrex::Real wstar = 0.0;
1201 amrex::Real z0 = 0.0;
1202 amrex::Real tflux = 0.0;
1203 amrex::Real zeta = 0.0;
1204 amrex::Real psi_m = 0.0;
1205 amrex::Real psi_h = 0.0;
1206 amrex::Real Olen = 0.0;
1208 ie = i < lbound(eta_arr).x ? lbound(eta_arr).x : i;
1209 je = j < lbound(eta_arr).y ? lbound(eta_arr).y : j;
1210 ie = ie > ubound(eta_arr).x ? ubound(eta_arr).x : ie;
1211 je = je > ubound(eta_arr).y ? ubound(eta_arr).y : je;
1212 amrex::Real umm = std::max(umm_arr(i,j,k),
WSMIN);
1215 ustar = u_star_arr(i,j,k);
1216 z0 = std::min( std::max(1200.0 * Hwave_arr(i,j,k) * std::pow( Hwave_arr(i,j,k)/(Lwave_arr(i,j,k)+
eps), 4.5 )
1218 tflux = -(tm_arr(i,j,k) - t_surf_arr(i,j,k)) * ustar *
mdata.
kappa /
1220 tflux *= (1 + 0.61*qvm_arr(i,j,k));
1221 tflux += 0.61*tm_arr(i,j,k) * -ustar*q_star_arr(i,j,k);
1224 w_star_arr(i,j,k) =
calc_wstar(tflux, pblh_arr(i,j,k), tvm_arr(i,j,k));
1226 umm = std::sqrt(umm_arr(i,j,k)*umm_arr(i,j,k) + wstar*wstar);
1227 umm = std::max(umm,
WSMIN);
1235 }
while ((std::abs(u_star_arr(i,j,k) - ustar) >
tol) && iter <= max_iters);
1236 AMREX_ASSERT_WITH_MESSAGE(iter < max_iters,
"Maximum number of MOST iterations reached.");
1238 t_star_arr(i,j,k) =
mdata.
kappa * (tm_arr(i,j,k) - t_surf_arr(i,j,k)) /
1240 olen_arr(i,j,k) = Olen;
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real calc_wstar(const amrex::Real &ust, const amrex::Real &tst, const amrex::Real &qst, const amrex::Real &pblh, const amrex::Real &th, const amrex::Real &thv, const amrex::Real &qv=0.0)
Definition: ERF_Wstar.H:13
@ Mom_v
Definition: ERF_IndexDefines.H:156
amrex::Real kappa
von Karman constant
Definition: ERF_MOSTStress.H:17
amrex::Real gravity
Acceleration due to gravity (m/s^2)
Definition: ERF_MOSTStress.H:18
const amrex::Real Bjr_beta
Definition: ERF_MOSTStress.H:28
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_psi_m(amrex::Real zeta) const
Definition: ERF_MOSTStress.H:40
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_psi_h(amrex::Real zeta) const
Definition: ERF_MOSTStress.H:54
const amrex::Real eps
Definition: ERF_MOSTStress.H:1248
const amrex::Real tol
Definition: ERF_MOSTStress.H:1247
const amrex::Real z0_eps
Definition: ERF_MOSTStress.H:1249
similarity_funs sfuns
Definition: ERF_MOSTStress.H:1246
const amrex::Real z0_max
Definition: ERF_MOSTStress.H:1250
const amrex::Real WSMIN
Definition: ERF_MOSTStress.H:1251