Skip to content

Commit

Permalink
Limit surface roughness to on land value. (#1659)
Browse files Browse the repository at this point in the history
  • Loading branch information
AMLattanzi authored Jun 25, 2024
1 parent e571ffe commit 9f72a4d
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Source/BoundaryConditions/MOSTStress.H
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ struct adiabatic_wave_coupled
u_star_arr(i,j,k) = mdata.kappa * umm_arr(i,j,k) / std::log(mdata.zref / z0_arr(i,j,k));
do {
ustar = u_star_arr(i,j,k);
z0 = std::max(1200.0 * Hwave_arr(i,j,k) * std::pow( Hwave_arr(i,j,k)/(Lwave_arr(i,j,k)+eps), 4.5 )
+ 0.11 * eta_arr(ie,je,k,EddyDiff::Mom_v) / ustar, z0_eps);
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 )
+ 0.11 * eta_arr(ie,je,k,EddyDiff::Mom_v) / ustar, z0_eps), z0_max );
u_star_arr(i,j,k) = mdata.kappa * umm_arr(i,j,k) / std::log(mdata.zref / z0);
++iter;
} while ((std::abs(u_star_arr(i,j,k) - ustar) > tol) && iter <= max_iters);
Expand All @@ -273,6 +273,7 @@ private:
const amrex::Real tol = 1.0e-5;
const amrex::Real eps = 1e-15;
const amrex::Real z0_eps = 1.0e-6;
const amrex::Real z0_max = 0.1;
};


Expand Down Expand Up @@ -515,8 +516,8 @@ struct surface_flux_wave_coupled
u_star_arr(i,j,k) = mdata.kappa * umm_arr(i,j,k) / std::log(mdata.zref / z0_arr(i,j,k));
do {
ustar = u_star_arr(i,j,k);
z0 = std::max(1200.0 * Hwave_arr(i,j,k) * std::pow( Hwave_arr(i,j,k)/(Lwave_arr(i,j,k)+eps), 4.5 )
+ 0.11 * eta_arr(ie,je,k,EddyDiff::Mom_v) / ustar, z0_eps);
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 )
+ 0.11 * eta_arr(ie,je,k,EddyDiff::Mom_v) / ustar, z0_eps), z0_max );
Olen = -ustar * ustar * ustar * tm_arr(i,j,k) /
(mdata.kappa * mdata.gravity * mdata.surf_temp_flux);
zeta = mdata.zref / Olen;
Expand All @@ -539,6 +540,7 @@ private:
const amrex::Real tol = 1.0e-5;
const amrex::Real eps = 1e-15;
const amrex::Real z0_eps = 1.0e-6;
const amrex::Real z0_max = 0.1;
};


Expand Down Expand Up @@ -788,8 +790,8 @@ struct surface_temp_wave_coupled
u_star_arr(i,j,k) = mdata.kappa * umm_arr(i,j,k) / std::log(mdata.zref / z0_arr(i,j,k));
do {
ustar = u_star_arr(i,j,k);
z0 = std::max(1200.0 * Hwave_arr(i,j,k) * std::pow( Hwave_arr(i,j,k)/(Lwave_arr(i,j,k)+eps), 4.5 )
+ 0.11 * eta_arr(ie,je,k,EddyDiff::Mom_v) / ustar, z0_eps);
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 )
+ 0.11 * eta_arr(ie,je,k,EddyDiff::Mom_v) / ustar, z0_eps), z0_max );
tflux = -(tm_arr(i,j,k) - t_surf_arr(i,j,k)) * ustar * mdata.kappa /
(std::log(mdata.zref / z0) - psi_h);
Olen = -ustar * ustar * ustar * tm_arr(i,j,k) /
Expand All @@ -813,6 +815,7 @@ private:
const amrex::Real tol = 1.0e-5;
const amrex::Real eps = 1e-15;
const amrex::Real z0_eps = 1.0e-6;
const amrex::Real z0_max = 0.1;
};


Expand Down

0 comments on commit 9f72a4d

Please sign in to comment.