1 #ifndef ERF_PBL_RIB_CROSSING_H_
2 #define ERF_PBL_RIB_CROSSING_H_
4 #include <AMReX_REAL.H>
5 #include <AMReX_GpuQualifiers.H>
6 #include <AMReX_Algorithm.H>
46 template <
typename RibAt,
typename ZAt>
51 RibAt
const& rib_at, ZAt
const& z_at,
56 for (
int k = ksrf + 1; k <=
khi; ++k) {
60 if (rib_lo >= Ribcr) {
62 return RibCrossing{ksrf, amrex::max(amrex::min(z_lo, pblh_max), pblh_min),
true};
64 const amrex::Real pblh = z_lo + (z_k - z_lo) / (rib_k - rib_lo) * (Ribcr - rib_lo);
65 return RibCrossing{k, amrex::max(amrex::min(pblh, pblh_max), pblh_min),
true};
70 return RibCrossing{
khi, amrex::max(amrex::min(z_lo, pblh_max), pblh_min),
false};
const int khi
Definition: ERF_InitCustomPert_Bubble.H:25
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE RibCrossing find_rib_crossing(int ksrf, int khi, amrex::Real Ribcr, RibAt const &rib_at, ZAt const &z_at, amrex::Real pblh_min, amrex::Real pblh_max) noexcept
Definition: ERF_PBLRibCrossing.H:50
amrex::Real Real
Definition: ERF_ShocInterface.H:19
Definition: ERF_PBLRibCrossing.H:11
amrex::Real pblh
PBL height, kept in [pblh_min, pblh_max].
Definition: ERF_PBLRibCrossing.H:13
int kpbl
level where Rib first reaches Ribcr; khi when it never does
Definition: ERF_PBLRibCrossing.H:12
bool crossed
Rib reached Ribcr at or below khi.
Definition: ERF_PBLRibCrossing.H:14