ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_MOSTRoughness.H
Go to the documentation of this file.
1 #include <ERF_Constants.H>
2 
3 /**
4  * COARE3.0, following WRF phys/module_sf_mynn.F
5  */
6 AMREX_GPU_DEVICE
7 AMREX_FORCE_INLINE
10  amrex::Real umm,
11  amrex::Real ustar)
12 {
13  amrex::Real ws10m = umm*std::log(amrex::Real(10.)/1e-4) / std::log(zref/1e-4);
14  amrex::Real Czc = amrex::Real(0.011) + amrex::Real(0.007)*std::min(std::max((ws10m-amrex::Real(10.))/amrex::Real(8.), amrex::Real(0.0)), amrex::Real(1.0));
15  amrex::Real z0 = (Czc / CONST_GRAV) * ustar * ustar;
16  // From Davis et al 2008 MWR, but their lower limit is amrex::Real(0.125e-6) -- WRF typo?
17  return std::min(std::max(z0, amrex::Real(1.27e-7)), amrex::Real(2.85e-3));
18 }
19 
20 /**
21  * Updated Donelan 2004 as found in AHW
22  *
23  * Matches implementations in WRF phys/physics_mmm/sf_sfclayrev.F90 and
24  * phys/module_sf_mynn.F
25  */
26 AMREX_GPU_DEVICE
27 AMREX_FORCE_INLINE
30 {
31  constexpr amrex::Real ozo{amrex::Real(1.59e-5)};
32  amrex::Real zw = std::min(std::pow(ustar/amrex::Real(1.06), amrex::Real(0.3)),amrex::Real(1.0));
33  amrex::Real zn1 = amrex::Real(0.011)*ustar*ustar/CONST_GRAV + ozo;
34  amrex::Real zn2 = amrex::Real(10.)*std::exp(-amrex::Real(9.5)*std::pow(ustar, -amrex::Real(.3333)))
35  + amrex::Real(0.11)*amrex::Real(1.5e-5)/std::max(ustar,amrex::Real(0.01));
36  amrex::Real z0 = (amrex::Real(1.0)-zw) * zn1 + zw * zn2;
37  // From Davis et al 2008 MWR, but their lower limit is amrex::Real(0.125e-6) -- WRF typo?
38  return std::min(std::max(z0, amrex::Real(1.27e-7)), amrex::Real(2.85e-3));
39 }
constexpr amrex::Real CONST_GRAV
Definition: ERF_Constants.H:31
Real z0
Definition: ERF_InitCustomPertVels_ScalarAdvDiff.H:8
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Donelan_roughness(amrex::Real ustar)
Definition: ERF_MOSTRoughness.H:29
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real COARE3_roughness(amrex::Real zref, amrex::Real umm, amrex::Real ustar)
Definition: ERF_MOSTRoughness.H:9
amrex::Real Real
Definition: ERF_ShocInterface.H:19