Compute vertical diffusivity using the Medium-Range Forecast (MRF) boundary layer scheme.
229 int klo = geom.Domain().smallEnd(2);
230 int khi = geom.Domain().bigEnd(2);
235 MultiFab pblh_mf(eddyViscosity.boxArray(), eddyViscosity.DistributionMap(), 1, 0);
249 const auto widen_sfc = [&] (
const MultiFab* mf) -> std::unique_ptr<MultiFab> {
250 if (mf ==
nullptr || std::min(mf->nGrowVect()[0], mf->nGrowVect()[1]) >= ng_pblh) {
254 [&] (MultiFab& wide) { SurfLayer->fill_planar_boundary(level, wide); });
256 const std::unique_ptr<MultiFab> u_star_wide = widen_sfc(SurfLayer->get_u_star(level));
257 const std::unique_ptr<MultiFab> t_star_wide = widen_sfc(SurfLayer->get_t_star(level));
258 const std::unique_ptr<MultiFab> q_star_wide = widen_sfc(SurfLayer->get_q_star(level));
259 const std::unique_ptr<MultiFab> olen_wide = widen_sfc(SurfLayer->get_olen(level));
260 const MultiFab* u_star_src = (u_star_wide) ? u_star_wide.get() : SurfLayer->get_u_star(level);
261 const MultiFab* t_star_src = (t_star_wide) ? t_star_wide.get() : SurfLayer->get_t_star(level);
262 const MultiFab* q_star_src = (q_star_wide) ? q_star_wide.get() : SurfLayer->get_q_star(level);
263 const MultiFab* olen_src = (olen_wide) ? olen_wide.get() : SurfLayer->get_olen(level);
266 int ng_avail = std::min({cons_in.nGrowVect()[0], cons_in.nGrowVect()[1],
267 xvel.nGrowVect()[0],
xvel.nGrowVect()[1],
268 yvel.nGrowVect()[0],
yvel.nGrowVect()[1],
269 u_star_src->nGrowVect()[0], u_star_src->nGrowVect()[1],
270 olen_src->nGrowVect()[0], olen_src->nGrowVect()[1],
271 (terrain_blank) ? terrain_blank->nGrowVect()[0] : 1000,
272 (terrain_blank) ? terrain_blank->nGrowVect()[1] : 1000});
275 auto limit_by = [&ng_avail] (
const auto* mf) {
276 if (mf) { ng_avail = std::min({ng_avail, mf->nGrowVect()[0], mf->nGrowVect()[1]}); }
278 limit_by(t_star_src);
279 limit_by(q_star_src);
280 limit_by(SurfLayer->get_mac_avg(level, 3));
281 limit_by(SurfLayer->get_mac_avg(level, 4));
282 limit_by(SurfLayer->get_lmask(level));
283 limit_by((use_terrain_fitted_coords) ? z_phys_nd.get() :
nullptr);
284 limit_by((use_terrain_fitted_coords) ? z_sfc_nd.get() :
nullptr);
285 if (ng_pblh > ng_avail) {
287 +
" needs " + std::to_string(ng_pblh) +
" halo columns, but the fields the "
288 "PBLH passes read carry only " + std::to_string(ng_avail)
289 +
"; reduce erf.pblh_smoothing_passes to at most " + std::to_string(ng_avail));
295 const int ng_fire = std::min(Q_fire_atm->nGrowVect()[0], Q_fire_atm->nGrowVect()[1]);
296 if (ng_fire < ng_pblh) {
297 amrex::Abort(
"erf.pbl_mrf_fire_thermal_excess reads the fire heat flux in "
298 + std::to_string(ng_pblh) +
" halo columns, but the flux carries only "
299 + std::to_string(ng_fire) +
"; reduce erf.pblh_smoothing_passes to at most "
300 + std::to_string(ng_fire));
306 Real fire_pblh_max_pred = Real(0);
307 Real fire_pblh_max_corr = Real(0);
308 Real fire_wstar_max = Real(0);
309 Real fire_kbfs_max = Real(0);
312 #pragma omp parallel if (Gpu::notInLaunchRegion()) \
313 reduction(max:fire_pblh_max_pred,fire_pblh_max_corr,fire_wstar_max,fire_kbfs_max)
316 for (MFIter mfi(eddyViscosity,
TileNoZ()); mfi.isValid(); ++mfi) {
319 const Box& gbx = mfi.growntilebox(IntVect(1,1,0));
321 gbx.bigEnd(2) ==
khi );
324 const GeometryData gdata = geom.data();
325 const Box xybx = PerpendicularBox<ZDir>(gbx, IntVect{0, 0, 0});
335 ? amrex::grow(mfi.tilebox(), IntVect(ng_pblh,ng_pblh,0)) : gbx;
336 const Box xybx_work = PerpendicularBox<ZDir>(gbx_work, IntVect{0, 0, 0});
337 const Box xybx_tile = PerpendicularBox<ZDir>(mfi.tilebox(), IntVect{0, 0, 0});
344 FArrayBox pbl_height_predictor(xybx_work, 1, The_Async_Arena());
345 FArrayBox pbl_height_corrector(xybx_work, 1, The_Async_Arena());
346 IArrayBox pbl_index(xybx_work, 1, The_Async_Arena());
347 IArrayBox pbl_index_zero_ri(xybx_work, 1, The_Async_Arena());
348 FArrayBox hgamt_fab(xybx_work, 1, The_Async_Arena());
349 FArrayBox hgamq_fab(xybx_work, 1, The_Async_Arena());
350 FArrayBox wstar_fab(xybx_work, 1, The_Async_Arena());
351 FArrayBox vpert_fab(xybx_work, 1, The_Async_Arena());
352 FArrayBox kbfs_fire_fab(xybx_work, 1, The_Async_Arena());
353 FArrayBox pblh_floor_fab(xybx_work, 1, The_Async_Arena());
354 const auto& pblh_pred_arr = pbl_height_predictor.array();
355 const auto& pblh_corr_arr = pbl_height_corrector.array();
356 const auto& pblh_floor_arr = pblh_floor_fab.array();
357 const auto& pbli_arr = pbl_index.array();
358 const auto& pbli_zero_arr = pbl_index_zero_ri.array();
359 const auto& hgamt_arr = hgamt_fab.array();
360 const auto& hgamq_arr = hgamq_fab.array();
361 const auto& wstar_arr = wstar_fab.array();
362 const auto& vpert_arr = vpert_fab.array();
363 const auto& kbfs_fire_arr = kbfs_fire_fab.array();
366 const auto& cell_data = cons_in.const_array(mfi);
367 const auto& uvel =
xvel.const_array(mfi);
368 const auto& vvel =
yvel.const_array(mfi);
371 const auto& u_star_arr = u_star_src->const_array(mfi);
372 const auto& t_star_arr = t_star_src->const_array(mfi);
373 const auto& l_obuk_arr = olen_src->const_array(mfi);
374 const auto& t10av_arr = SurfLayer->get_mac_avg(level, 3)->const_array(mfi);
375 const auto& q10av_arr = SurfLayer->get_mac_avg(level, 4)->const_array(mfi);
376 const auto& lmask_arr = (SurfLayer->get_lmask(level)) ?
377 SurfLayer->get_lmask(level)->const_array(mfi) :
380 const Array4<Real const> z_nd_arr = use_terrain_fitted_coords ? z_phys_nd->array(mfi)
381 : Array4<Real const>{};
382 const Array4<Real const> z_sfc_arr = use_terrain_fitted_coords ? z_sfc_nd->const_array(mfi)
383 : Array4<Real const>{};
387 const Array4<Real const> Q_fire_arr = use_fire_correction
388 ? Q_fire_atm->const_array(mfi)
389 : Array4<Real const>{};
400 const amrex::MultiFab* q_star_mf = q_star_src;
401 Array4<Real const> q_star_arr = (q_star_mf !=
nullptr) ? q_star_mf->const_array(mfi)
402 : Array4<Real const>{};
415 const bool l_ib = turbChoice.
pbl_ib_aware && (terrain_blank !=
nullptr);
417 "erf.pbl_ib_aware is not supported with terrain-fitted coordinates");
418 const Array4<Real const> blank_arr = l_ib ? terrain_blank->const_array(mfi) : Array4<Real const>{};
419 IArrayBox ksurf_fab(xybx_work, 1, The_Async_Arena());
420 FArrayBox zib_fab(xybx_work, 1, The_Async_Arena());
421 FArrayBox us_eff_fab(xybx_work, 1, The_Async_Arena()), ts_eff_fab(xybx_work, 1, The_Async_Arena());
422 FArrayBox qs_eff_fab(xybx_work, 1, The_Async_Arena()), ol_eff_fab(xybx_work, 1, The_Async_Arena());
423 FArrayBox t10_eff_fab(xybx_work, 1, The_Async_Arena()), q10_eff_fab(xybx_work, 1, The_Async_Arena());
424 const auto& ksurf_arr = ksurf_fab.array();
425 const auto& zib_arr = zib_fab.array();
426 const auto& us_eff_arr = us_eff_fab.array();
const auto& ts_eff_arr = ts_eff_fab.array();
427 const auto& qs_eff_arr = qs_eff_fab.array();
const auto& ol_eff_arr = ol_eff_fab.array();
428 const auto& t10_eff_arr = t10_eff_fab.array();
const auto& q10_eff_arr = q10_eff_fab.array();
430 const Real dz_ib = geom.CellSize(2);
432 const Array4<Real const>& uv_ib =
xvel.const_array(mfi);
433 const Array4<Real const>& vv_ib =
yvel.const_array(mfi);
434 const bool have_qstar = (q_star_mf !=
nullptr);
435 ParallelFor(xybx_work, [=] AMREX_GPU_DEVICE(
int i,
int j,
int) noexcept
439 for (
int kk =
klo; kk <=
khi; ++kk) {
if (blank_arr(i, j, kk) >= Real(0.5)) {
ks = kk + 1; } }
442 ksurf_arr(i, j, 0) =
ks;
443 zib_arr(i, j, 0) = (
ks -
klo) * dz_ib;
446 const Real u_top =
myhalf * (uv_ib(i, j,
ks) + uv_ib(i + 1, j,
ks));
447 const Real v_top =
myhalf * (vv_ib(i, j,
ks) + vv_ib(i, j + 1,
ks));
448 const Real ws_top = std::sqrt(u_top * u_top + v_top * v_top);
449 us_eff_arr(i, j, 0) = amrex::max(
KAPPA * ws_top / std::log(
myhalf * dz_ib / z0_ib), Real(1.0e-3));
450 ts_eff_arr(i, j, 0) = Real(0);
451 qs_eff_arr(i, j, 0) = Real(0);
455 ? cell_data(i, j,
ks, moisture_indices.
qv) / cell_data(i, j,
ks,
Rho_comp) : Real(0);
457 us_eff_arr(i, j, 0) = u_star_arr(i, j, 0);
458 ts_eff_arr(i, j, 0) = t_star_arr(i, j, 0);
459 qs_eff_arr(i, j, 0) = have_qstar ? q_star_arr(i, j, 0) : Real(0);
460 ol_eff_arr(i, j, 0) = l_obuk_arr(i, j, 0);
461 t10_eff_arr(i, j, 0) = t10av_arr(i, j, 0);
462 q10_eff_arr(i, j, 0) =
use_moisture ? q10av_arr(i, j, 0) : Real(0);
469 const GpuArray<Real, AMREX_SPACEDIM> dxInv_floor = geom.InvCellSizeArray();
471 ParallelFor(xybx_work, [=] AMREX_GPU_DEVICE(
int i,
int j,
int) noexcept
473 const int ksrf = ksurf_arr(i, j, 0);
474 const Real zib = zib_arr(i, j, 0);
475 amrex::ignore_unused(zib);
476 const Real t_layer = t10_eff_arr(i, j, 0);
477 const Real moisture_fraction =
use_moisture ? q10_eff_arr(i, j, 0) : Real(0);
478 const Real t_layer_v = t_layer * (
one +
epsv * moisture_fraction);
484 zval = (use_terrain_fitted_coords)
486 : ((kpbl +
myhalf) * gdata.CellSize(2) - zib);
487 const Real theta_v =
GetThetav(i, j, kpbl, cell_data, moisture_indices);
488 const Real theta_v_klo = amrex::max(
GetThetav(i, j, ksrf, cell_data, moisture_indices), Real(1.0));
489 const Real ws2_raw =
fourth * ( (uvel(i, j, kpbl) + uvel(i + 1, j, kpbl)) *
490 (uvel(i, j, kpbl) + uvel(i + 1, j, kpbl)) +
491 (vvel(i, j, kpbl) + vvel(i, j + 1, kpbl)) *
492 (vvel(i, j, kpbl) + vvel(i, j + 1, kpbl)) );
499 : amrex::max(ws2_raw, Real(1.0));
500 Rib =
CONST_GRAV * zval * (theta_v - t_layer_v) / (ws2 * theta_v_klo);
503 Real zval0 = zval, Rib0 = Rib;
504 bool above_critical =
false;
505 while (!above_critical && ((kpbl + 1) <=
khi)) {
510 zval = (use_terrain_fitted_coords)
512 : ((kpbl +
myhalf) * gdata.CellSize(2) - zib);
513 const Real theta_v =
GetThetav(i, j, kpbl, cell_data, moisture_indices);
514 const Real theta_v_klo = amrex::max(
GetThetav(i, j, ksrf, cell_data, moisture_indices), Real(1.0));
515 const Real ws2_raw =
fourth * ( (uvel(i, j, kpbl) + uvel(i + 1, j, kpbl)) *
516 (uvel(i, j, kpbl) + uvel(i + 1, j, kpbl)) +
517 (vvel(i, j, kpbl) + vvel(i, j + 1, kpbl)) *
518 (vvel(i, j, kpbl) + vvel(i, j + 1, kpbl)) );
523 : amrex::max(ws2_raw, Real(1.0));
524 Rib =
CONST_GRAV * zval * (theta_v - t_layer_v) / (ws2 * theta_v_klo);
525 above_critical = (Rib >= Ribcr);
531 const Real zl1 = (use_terrain_fitted_coords)
533 :
myhalf * gdata.CellSize(2);
534 const Real dz1 = (use_terrain_fitted_coords)
537 const Real z_max = (use_terrain_fitted_coords)
539 : ((
khi +
myhalf) * gdata.CellSize(2) - zib);
540 const Real pblh_max = Real(0.9) * z_max;
543 if (above_critical) {
545 const Real rib_diff = Rib - Rib0;
550 }
else if (std::abs(rib_diff) > Real(1.0e-10)) {
551 pblh_interp = zval0 + (zval - zval0) / rib_diff * (Ribcr - Rib0);
556 pblh_pred_arr(i, j, 0) = amrex::max(amrex::min(pblh_interp, pblh_max), pblh_min);
557 pbli_arr(i, j, 0) = kpbl;
562 pblh_pred_arr(i, j, 0) = amrex::max(amrex::min(zval, pblh_max), pblh_min);
563 pbli_arr(i, j, 0) = kpbl;
569 constexpr Real prmin = Real(0.5);
570 constexpr Real prmax = Real(4.0);
571 constexpr Real GAMCRT = Real(3.0);
572 constexpr Real GAMCRQ = Real(2.e-3);
583 ParallelFor(xybx_work, [=,zero_d=
zero] AMREX_GPU_DEVICE(
int i,
int j,
int) noexcept
585 const int ksrf = ksurf_arr(i, j, 0);
586 const Real zib = zib_arr(i, j, 0);
587 amrex::ignore_unused(zib);
588 const Real t_layer = t10_eff_arr(i, j, 0);
589 Real obuk_val = ol_eff_arr(i, j, 0);
590 if (std::abs(obuk_val) < amrex::Real(1.0e-10)) {
591 obuk_val = (obuk_val >= zero_d) ? amrex::Real(1.0e-10) : amrex::Real(-1.0e-10);
595 const Real HOL = sf * pblh_pred_arr(i, j, 0) / obuk_val;
596 const Real HOL_bounded = amrex::max(amrex::min(HOL, Real(100.0)), Real(-100.0));
600 const Real HOL_abs = std::abs(HOL_bounded);
601 const Real one_quarter = Real(0.25);
602 const Real phiM = (obuk_val > 0)
603 ? (1 + 5 * HOL_bounded)
604 : std::pow(1 + 16 * HOL_abs, -one_quarter);
605 const Real phiM_safe = amrex::max(phiM, Real(0.01));
616 const Real theta_v0 = amrex::max(
GetThetav(i, j, ksrf, cell_data, moisture_indices), Real(1.0));
617 const Real wthv0 = amrex::max(-us_eff_arr(i,j,0) * ts_eff_arr(i,j,0), Real(0.0));
618 const Real
zi = amrex::max(pblh_pred_arr(i, j, 0), Real(10.0));
619 const Real wstar_conv = std::cbrt(
CONST_GRAV / theta_v0 *
zi * wthv0);
621 Real wstar_shear = us_eff_arr(i, j, 0) / phiM_safe;
625 Real wstar = std::cbrt(wstar_shear*wstar_shear*wstar_shear +
626 wstar_conv*wstar_conv*wstar_conv);
628 wstar = amrex::max(wstar, Real(0.01));
629 wstar = amrex::min(wstar, Real(5.0));
634 constexpr Real Cp_d_fire = Real(1004.64);
635 Real kbfs_fire = zero_d;
636 if (use_fire_correction && Q_fire_arr) {
637 const Real rho_sfc = cell_data(i, j, ksrf,
Rho_comp);
638 const Real q_fire = Q_fire_arr(i, j, 0);
639 if (q_fire > mrf_fire_q_thresh && rho_sfc > zero_d) {
641 kbfs_fire = q_fire / (amrex::max(rho_sfc, Real(1.0e-10)) * Cp_d_fire);
644 kbfs_fire_arr(i, j, 0) = kbfs_fire;
646 bool SFCFLG = (obuk_val <= zero_d);
647 const Real HGAMT = (SFCFLG && enable_mrf_countergradient)
648 ? amrex::min(-const_b * us_eff_arr(i, j, 0) * ts_eff_arr(i, j, 0) / wstar, GAMCRT)
651 Real HGAMQ = Real(0);
652 if (SFCFLG &&
use_moisture && enable_mrf_countergradient) {
653 const Real q_star = qs_eff_arr(i, j, 0);
654 const Real HGAMQ_calc = -const_b * us_eff_arr(i, j, 0) * q_star / wstar;
655 HGAMQ = amrex::max(amrex::min(HGAMQ_calc, GAMCRQ), Real(0));
658 bool is_land = (lmask_arr(i,j,0) == 1);
659 if (!is_land) HGAMQ = zero_d;
662 if (moisture_indices.
qv >= 0) {
663 Real qv_klo = cell_data(i, j, ksrf, moisture_indices.
qv) / cell_data(i, j, ksrf,
Rho_comp);
667 Real qsat_klo = zero_d;
669 Real rh_klo = (qsat_klo > Real(1.0e-10)) ? (qv_klo / qsat_klo) : Real(0);
670 if (rh_klo > Real(0.95)) {
671 Real rh_scaling = amrex::max(zero_d, (Real(1) - rh_klo) / Real(0.05));
680 if (pbli_arr(i, j, 0) <= ksrf + 1 || !enable_mrf_countergradient) {
681 vpert_arr(i, j, 0) = zero_d;
683 const Real VPERT_raw = HGAMT +
epsv * t_layer * HGAMQ;
684 const Real VPERT_capped = enable_mrf_unbounded_vpert
686 : amrex::min(VPERT_raw, GAMCRT);
687 vpert_arr(i, j, 0) = amrex::max(VPERT_capped, zero_d);
700 AMREX_GPU_DEVICE(
int i,
int j,
int) noexcept
702 const int ksrf = ksurf_arr(i, j, 0);
703 const Real zib = zib_arr(i, j, 0);
704 amrex::ignore_unused(zib);
705 const Real t_layer = t10_eff_arr(i, j, 0);
706 const Real moisture_fraction =
use_moisture ? q10_eff_arr(i, j, 0) : Real(0);
708 const Real t_layer_v = t_layer * (
one +
epsv * moisture_fraction)
709 + vpert_arr(i, j, 0);
711 Real obuk_val = ol_eff_arr(i, j, 0);
712 if (std::abs(obuk_val) < amrex::Real(1.0e-10)) {
713 obuk_val = (obuk_val >=
zero) ? amrex::Real(1.0e-10) : amrex::Real(-1.0e-10);
719 zval = (use_terrain_fitted_coords)
721 : ((kpbl +
myhalf) * gdata.CellSize(2) - zib);
722 const Real theta_v =
GetThetav(i, j, kpbl, cell_data, moisture_indices);
723 const Real theta_v_klo = amrex::max(
GetThetav(i, j, ksrf, cell_data, moisture_indices), one_d);
724 const Real ws2_raw =
fourth * ( (uvel(i, j, kpbl) + uvel(i + 1, j, kpbl)) *
725 (uvel(i, j, kpbl) + uvel(i + 1, j, kpbl)) +
726 (vvel(i, j, kpbl) + vvel(i, j + 1, kpbl)) *
727 (vvel(i, j, kpbl) + vvel(i, j + 1, kpbl)) );
731 : amrex::max(ws2_raw, one_d);
732 Rib =
CONST_GRAV * zval * (theta_v - t_layer_v) / (ws2 * theta_v_klo);
734 Real zval0 = zval, Rib0 = Rib;
736 bool above_critical =
false;
737 while (!above_critical && ((kpbl + 1) <=
khi)) {
742 zval = (use_terrain_fitted_coords)
744 : ((kpbl +
myhalf) * gdata.CellSize(2) - zib);
745 const Real theta_v =
GetThetav(i, j, kpbl, cell_data, moisture_indices);
746 const Real theta_v_klo = amrex::max(
GetThetav(i, j, ksrf, cell_data, moisture_indices), one_d);
747 const Real ws2_raw =
fourth * ( (uvel(i, j, kpbl) + uvel(i + 1, j, kpbl)) *
748 (uvel(i, j, kpbl) + uvel(i + 1, j, kpbl)) +
749 (vvel(i, j, kpbl) + vvel(i, j + 1, kpbl)) *
750 (vvel(i, j, kpbl) + vvel(i, j + 1, kpbl)) );
754 : amrex::max(ws2_raw, one_d);
755 Rib =
CONST_GRAV * zval * (theta_v - t_layer_v) / (ws2 * theta_v_klo);
756 above_critical = (Rib >= Ribcr);
762 const Real zl1 = (use_terrain_fitted_coords)
764 :
myhalf * gdata.CellSize(2);
765 const Real dz1 = (use_terrain_fitted_coords)
768 const Real z_max = (use_terrain_fitted_coords)
770 : ((
khi +
myhalf) * gdata.CellSize(2) - zib);
771 const Real pblh_max = Real(0.9) * z_max;
774 if (above_critical) {
776 const Real rib_diff = Rib - Rib0;
781 }
else if (std::abs(rib_diff) > Real(1.0e-10)) {
782 pblh_interp = zval0 + (zval - zval0) / rib_diff * (Ribcr - Rib0);
787 pblh_corr_arr(i, j, 0) = amrex::max(amrex::min(pblh_interp, pblh_max), pblh_min);
788 pbli_arr(i, j, 0) = kpbl;
793 pblh_corr_arr(i, j, 0) = amrex::max(amrex::min(zval, pblh_max), pblh_min);
794 pbli_arr(i, j, 0) = kpbl;
796 pblh_floor_arr(i, j, 0) = pblh_min;
812 ParallelFor(xybx_work, [=] AMREX_GPU_DEVICE(
int i,
int j,
int) noexcept {
813 pblh_corr_arr(i, j, 0) += zib_arr(i, j, 0);
818 geom.Domain(), geom.periodicity());
819 ParallelFor(xybx_work, [=] AMREX_GPU_DEVICE(
int i,
int j,
int) noexcept {
820 pblh_corr_arr(i, j, 0) = amrex::max(pblh_corr_arr(i, j, 0) - zib_arr(i, j, 0), pblh_floor_arr(i, j, 0));
830 auto pblh_out = pblh_mf.array(mfi);
831 const Box& tbx = mfi.tilebox();
836 ParallelFor(tbx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k) noexcept {
837 pblh_out(i, j, k) = pblh_corr_arr(i, j, 0) + zib_arr(i, j, 0);
847 ParallelFor(xybx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int) noexcept
849 const int ksrf = ksurf_arr(i, j, 0);
850 const Real zib = zib_arr(i, j, 0);
851 amrex::ignore_unused(zib);
853 Real obuk_val = ol_eff_arr(i, j, 0);
854 if (std::abs(obuk_val) < amrex::Real(1.0e-10)) {
855 obuk_val = (obuk_val >= Real(0)) ? amrex::Real(1.0e-10) : amrex::Real(-1.0e-10);
859 const Real HOL = sf * pblh_corr_arr(i, j, 0) / obuk_val;
860 const Real HOL_bounded = amrex::max(amrex::min(HOL, Real(100.0)), Real(-100.0));
864 const Real HOL_abs = std::abs(HOL_bounded);
865 const Real one_quarter = Real(0.25);
868 const Real qnse_am_d = turbChoice.
qnse_am;
869 const Real qnse_bm_d = turbChoice.
qnse_bm;
870 const Real phiM = (obuk_val > 0)
871 ? (enable_qnse_d > Real(0.5)
872 ? (1 + qnse_am_d * HOL_bounded) / (1 + qnse_bm_d * HOL_bounded)
873 : (1 + 5 * HOL_bounded))
874 : std::pow(1 + 16 * HOL_abs, -one_quarter);
875 const Real phiM_safe = amrex::max(phiM, Real(0.01));
880 const Real theta_v0 = amrex::max(
GetThetav(i, j, ksrf, cell_data, moisture_indices), Real(1.0));
881 const Real wthv0 = amrex::max(-us_eff_arr(i,j,0) * ts_eff_arr(i,j,0), Real(0.0));
885 const Real
zi = amrex::max(pblh_corr_arr(i, j, 0), Real(10.0));
886 const Real wstar_conv = std::cbrt(
CONST_GRAV / theta_v0 *
zi * wthv0);
888 Real wstar_shear = us_eff_arr(i, j, 0) / phiM_safe;
892 Real wstar = std::cbrt(wstar_shear*wstar_shear*wstar_shear +
893 wstar_conv*wstar_conv*wstar_conv);
895 wstar = amrex::max(wstar, Real(0.01));
896 wstar = amrex::min(wstar, Real(5.0));
904 const Real kbfs_fire = kbfs_fire_arr(i, j, 0);
905 const Real kbfs_total = amrex::max(-us_eff_arr(i, j, 0) * ts_eff_arr(i, j, 0) + kbfs_fire,
907 const Real wstar_fire = std::cbrt(
CONST_GRAV / amrex::max(t10_eff_arr(i, j, 0), Real(1.0))
908 * kbfs_total * pblh_corr_arr(i, j, 0));
909 wstar_arr(i, j, 0) = (kbfs_fire > Real(0)) ? amrex::max(wstar_fire, wstar) : wstar;
910 bool SFCFLG = (obuk_val <= Real(0));
920 const Real HGAMT = (SFCFLG && enable_mrf_countergradient)
921 ? amrex::max(amrex::min(-const_b * us_eff_arr(i, j, 0)
922 * ts_eff_arr(i, j, 0) / wstar, GAMCRT), Real(0))
925 Real HGAMQ = Real(0);
926 if (SFCFLG &&
use_moisture && enable_mrf_countergradient) {
927 const Real q_star = qs_eff_arr(i, j, 0);
928 const Real HGAMQ_calc = -const_b * us_eff_arr(i, j, 0) * q_star / wstar;
929 HGAMQ = amrex::max(amrex::min(HGAMQ_calc, GAMCRQ), Real(0));
932 bool is_land = (lmask_arr(i,j,0) == 1);
933 if (!is_land) HGAMQ = Real(0);
936 if (moisture_indices.
qv >= 0) {
937 Real qv_klo = cell_data(i, j, ksrf, moisture_indices.
qv) / cell_data(i, j, ksrf,
Rho_comp);
941 Real qsat_klo = Real(0);
943 Real rh_klo = (qsat_klo > Real(1.0e-10)) ? (qv_klo / qsat_klo) : Real(0);
944 if (rh_klo > Real(0.95)) {
945 Real rh_scaling = amrex::max(Real(0), (Real(1) - rh_klo) / Real(0.05));
951 if (pbli_arr(i, j, 0) <= ksrf + 1) {
952 hgamt_arr(i, j, 0) = Real(0);
953 hgamq_arr(i, j, 0) = Real(0);
955 const Real pblh = pblh_corr_arr(i, j, 0);
956 if (pblh > Real(1.0e-10)) {
957 hgamt_arr(i, j, 0) = (enable_mrf_countergradient) ? HGAMT / pblh : Real(0);
958 hgamq_arr(i, j, 0) = (enable_mrf_countergradient &&
use_moisture) ? HGAMQ / pblh : Real(0);
960 hgamt_arr(i, j, 0) = Real(0);
961 hgamq_arr(i, j, 0) = Real(0);
971 constexpr Real Ribcr_zero = Real(0);
973 AMREX_GPU_DEVICE(
int i,
int j,
int) noexcept
975 const int ksrf = ksurf_arr(i, j, 0);
976 const Real zib = zib_arr(i, j, 0);
977 amrex::ignore_unused(zib);
978 const Real t_layer = t10_eff_arr(i, j, 0);
980 const Real t_layer_v = t_layer * (
one +
epsv * moisture_fraction);
981 const Real t_layer_v_enhanced = t_layer_v + vpert_arr(i, j, 0);
983 int kpbl_zero = ksrf;
984 Real zval_zero, Rib_zero;
986 zval_zero = (use_terrain_fitted_coords)
988 : ((kpbl_zero +
myhalf) * gdata.CellSize(2) - zib);
989 const Real theta_v =
GetThetav(i, j, kpbl_zero, cell_data, moisture_indices);
990 const Real theta_v_klo = amrex::max(
GetThetav(i, j, ksrf, cell_data, moisture_indices), one_d);
991 const Real ws2_raw =
fourth * ( (uvel(i, j, kpbl_zero) + uvel(i + 1, j, kpbl_zero)) *
992 (uvel(i, j, kpbl_zero) + uvel(i + 1, j, kpbl_zero)) +
993 (vvel(i, j, kpbl_zero) + vvel(i, j + 1, kpbl_zero)) *
994 (vvel(i, j, kpbl_zero) + vvel(i, j + 1, kpbl_zero)) );
998 : amrex::max(ws2_raw, one_d);
999 Rib_zero =
CONST_GRAV * zval_zero * (theta_v - t_layer_v_enhanced) / (ws2 * theta_v_klo);
1002 bool above_critical_zero =
false;
1003 while (!above_critical_zero && ((kpbl_zero + 1) <=
khi)) {
1005 zval_zero = (use_terrain_fitted_coords)
1007 : ((kpbl_zero +
myhalf) * gdata.CellSize(2) - zib);
1008 const Real theta_v =
GetThetav(i, j, kpbl_zero, cell_data, moisture_indices);
1009 const Real theta_v_klo = amrex::max(
GetThetav(i, j, ksrf, cell_data, moisture_indices), one_d);
1010 const Real ws2_raw =
fourth * ( (uvel(i, j, kpbl_zero) + uvel(i + 1, j, kpbl_zero)) *
1011 (uvel(i, j, kpbl_zero) + uvel(i + 1, j, kpbl_zero)) +
1012 (vvel(i, j, kpbl_zero) + vvel(i, j + 1, kpbl_zero)) *
1013 (vvel(i, j, kpbl_zero) + vvel(i, j + 1, kpbl_zero)) );
1017 : amrex::max(ws2_raw, one_d);
1018 Rib_zero =
CONST_GRAV * zval_zero * (theta_v - t_layer_v_enhanced) / (ws2 * theta_v_klo);
1019 above_critical_zero = (Rib_zero >= Ribcr_zero);
1022 if (above_critical_zero) {
1023 pbli_zero_arr(i, j, 0) = kpbl_zero;
1027 pbli_zero_arr(i, j, 0) = kpbl_zero;
1032 if (use_fire_correction) {
1033 fire_pblh_max_pred = amrex::max(fire_pblh_max_pred, pbl_height_predictor.max<RunOn::Device>(0));
1034 fire_pblh_max_corr = amrex::max(fire_pblh_max_corr, pbl_height_corrector.max<RunOn::Device>(0));
1035 fire_wstar_max = amrex::max(fire_wstar_max, wstar_fab.max<RunOn::Device>(0));
1036 fire_kbfs_max = amrex::max(fire_kbfs_max, kbfs_fire_fab.max<RunOn::Device>(0));
1041 const Array4<Real>& K_turb = eddyViscosity.array(mfi);
1050 const auto&
dxInv = geom.InvCellSizeArray();
1051 const Real dz_inv = geom.InvCellSize(2);
1052 const int izmin = geom.Domain().smallEnd(2);
1053 const int izmax = geom.Domain().bigEnd(2);
1057 const amrex::Real l_blend_cs = turbChoice.
pbl_blend_cs;
1060 const amrex::Real scalar_Sc_t = turbChoice.
pbl_mrf_Sc_t;
1061 const amrex::Real Pr_t_in = turbChoice.
Pr_t;
1067 const bool l_use_mf = (mf_m[0] !=
nullptr && mf_m[1] !=
nullptr);
1068 const Array4<const Real> mf_mx = (l_use_mf) ? mf_m[0]->const_array(mfi) : Array4<const Real>{};
1069 const Array4<const Real> mf_my = (l_use_mf) ? mf_m[1]->const_array(mfi) : Array4<const Real>{};
1071 ParallelFor(gbx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k) noexcept
1073 const int ksrf = ksurf_arr(i, j, 0);
1074 const Real zib = zib_arr(i, j, 0);
1075 amrex::ignore_unused(zib);
1076 Real obuk_val = ol_eff_arr(i, j, 0);
1077 if (std::abs(obuk_val) < amrex::Real(1.0e-10)) {
1078 obuk_val = (obuk_val >= Real(0)) ? amrex::Real(1.0e-10) : amrex::Real(-1.0e-10);
1081 const Real zval = (use_terrain_fitted_coords)
1083 : ((k +
myhalf) * gdata.CellSize(2) - zib);
1090 if (
rho <= Real(0) || k < ksrf) {
1100 const Real met_h_zeta = (use_terrain_fitted_coords)
1102 const Real dz_terrain = met_h_zeta / dz_inv;
1104 constexpr Real qc_threshold = Real(1.0e-4);
1105 Real qc_mix = Real(0);
1106 Real qi_mix = Real(0);
1108 if (moisture_indices.
qc >= 0) {
1109 qc_mix = cell_data(i, j, k, moisture_indices.
qc) /
rho;
1111 if (moisture_indices.
qi >= 0) {
1112 qi_mix = cell_data(i, j, k, moisture_indices.
qi) /
rho;
1115 const Real total_qcloud = qc_mix + qi_mix;
1120 if (k < pbli_extent) {
1121 const Real HOL = sf * pblh_corr_arr(i, j, 0) / obuk_val;
1122 const Real HOL_bounded = amrex::max(amrex::min(HOL, Real(100.0)), Real(-100.0));
1126 const Real HOL_abs = std::abs(HOL_bounded);
1128 const Real one_quarter = Real(0.25);
1131 const Real qnse_am_d = turbChoice.
qnse_am;
1132 const Real qnse_bm_d = turbChoice.
qnse_bm;
1133 const Real qnse_ah_d = turbChoice.
qnse_ah;
1134 const Real qnse_bh_d = turbChoice.
qnse_bh;
1135 const Real phiM = (obuk_val > 0)
1136 ? (enable_qnse_d > Real(0.5)
1137 ? (1 + qnse_am_d * HOL_bounded) / (1 + qnse_bm_d * HOL_bounded)
1138 : (1 + 5 * HOL_bounded))
1139 : std::pow(1 + 16 * HOL_abs, -one_quarter);
1140 const Real phit = (obuk_val > 0)
1141 ? (enable_qnse_d > Real(0.5)
1142 ? (1 + qnse_ah_d * HOL_bounded) / (1 + qnse_bh_d * HOL_bounded)
1143 : (1 + 5 * HOL_bounded))
1144 : std::pow(1 + 16 * HOL_abs, -Real(0.5));
1146 Real phit_cloud = phit;
1147 Real phiM_cloud = phiM;
1148 if (has_cloud && obuk_val > Real(0)) {
1149 Real reduction_factor = Real(1) - Real(0.15) * amrex::min(total_qcloud / qc_threshold, Real(1));
1151 if (enable_qnse_d > Real(0.5)) {
1152 phiM_cloud = ((1 + qnse_am_d * HOL_bounded * reduction_factor) / (1 + qnse_bm_d * HOL_bounded));
1153 phit_cloud = ((1 + qnse_ah_d * HOL_bounded * reduction_factor) / (1 + qnse_bh_d * HOL_bounded));
1155 phiM_cloud = Real(1) + Real(5.0) * reduction_factor * sf * pblh_corr_arr(i, j, 0) / obuk_val;
1156 phit_cloud = Real(1) + Real(5.0) * reduction_factor * sf * pblh_corr_arr(i, j, 0) / obuk_val;
1158 }
else if (has_cloud && obuk_val <= Real(0)) {
1159 Real cloud_boost = Real(1.0) + Real(0.05) * amrex::min(total_qcloud / qc_threshold, Real(1));
1160 phiM_cloud = std::pow(Real(1) + Real(16.0) * HOL_abs / cloud_boost, -one_quarter);
1161 phit_cloud = std::pow(Real(1) + Real(16.0) * HOL_abs / cloud_boost, -Real(0.5));
1164 const Real phiM_eff = phiM_cloud;
1165 const Real phit_eff = phit_cloud;
1167 Real Prt_base = phit_eff / phiM_eff;
1168 const Real Prt = amrex::min(amrex::max(Prt_base + const_b *
KAPPA * sf, prmin), prmax);
1173 const Real wstar = wstar_arr(i, j, 0);
1186 const Real zl1 = (use_terrain_fitted_coords)
1188 : ((ksrf +
myhalf) * gdata.CellSize(2) - zib);
1189 const Real pblh = pblh_corr_arr(i, j, 0);
1195 const Real pblh_rel = amrex::max(pblh - zl1, Real(1.0e-4));
1196 const Real zfac = amrex::max(Real(1) - (zval - zl1) / pblh_rel, Real(1.0e-8));
1203 }
else if (k >= pbli_extent) {
1207 const Real lambda = Real(150.0);
1208 const Real lscale = (
KAPPA * zval * lambda) / (
KAPPA * zval + lambda);
1209 Real dthetadz, dudz, dvdz;
1210 ComputeVerticalDerivativesPBL(i, j, k, uvel, vvel, cell_data, izmin, izmax, pbl_derivative_dz_inv(i,j,k),
1211 c_ext_dir_on_zlo, c_ext_dir_on_zhi, u_ext_dir_on_zlo,
1212 u_ext_dir_on_zhi, v_ext_dir_on_zlo, v_ext_dir_on_zhi, dthetadz,
1213 dudz, dvdz, moisture_indices, pbl_strat);
1215 const Real dudz_safe = (k < izmax) ? dudz : Real(0);
1216 const Real dvdz_safe = (k < izmax) ? dvdz : Real(0);
1217 const Real wind_shear = dudz_safe * dudz_safe + dvdz_safe * dvdz_safe;
1218 const Real wind_shear_safe = std::max(wind_shear, Real(1.0e-8));
1219 const Real theta_v = amrex::max(
GetThetav(i, j, k, cell_data, moisture_indices), Real(1.0));
1220 const Real dtheta_v_dz = dthetadz;
1222 Real grad_Ri =
CONST_GRAV / theta_v * dtheta_v_dz / wind_shear_safe;
1223 grad_Ri = std::max(std::min(grad_Ri, Real(100.0)), -Real(100.0));
1225 const Real grad_Ri_safe = amrex::max(grad_Ri, -Real(100.0));
1233 const Real sqrt_neg_Ri = std::sqrt(std::abs(grad_Ri_safe));
1234 Real Pr = Real(1) + Real(2.1) * grad_Ri;
1235 const Real fm = (grad_Ri_safe > 0)
1236 ? Real(1) / ((Real(1) + Real(5.0) * grad_Ri_safe) * (Real(1) + Real(5.0) * grad_Ri_safe))
1237 : 1 - 8 * grad_Ri_safe / (1 + Real(1.746) * sqrt_neg_Ri);
1238 const Real ft = (grad_Ri_safe > 0)
1239 ? Real(1) / ((Real(1) + Real(5.0) * grad_Ri_safe) * (Real(1) + Real(5.0) * grad_Ri_safe))
1240 : 1 - 8 * grad_Ri_safe / (1 + Real(1.286) * sqrt_neg_Ri);
1241 const Real rl2wsp =
rho * lscale * lscale * std::sqrt(wind_shear);
1243 Pr = std::max(amrex::Real(0.25), std::min(Pr, Real(4.0)));
1251 const Real Pr_mom = (grad_Ri_safe > 0) ? Pr : Real(1);
1268 if (l_blend_length > 0.0) {
1269 const Real rho_inv = Real(1.0) /
rho;
1270 const Real l_dx_phys = (l_use_mf) ? l_dx / std::sqrt(mf_mx(i,j,0) * mf_my(i,j,0)) : l_dx;
1275 l_dx_phys, l_blend_length, l_blend_cs, l_blend_cmax,
1276 amrex::Real(-1.0),
false);
1280 l_dx_phys, l_blend_length, l_blend_cs, l_blend_cmax,
1281 amrex::Real(-1.0),
false);
1285 l_dx_phys, l_blend_length, l_blend_cs, l_blend_cmax,
1286 amrex::Real(-1.0),
false);
1292 Real rhoKmin, rhoKmax;
1294 constexpr Real ckz = Real(0.001);
1295 constexpr Real Kmax = Real(1000.0);
1296 rhoKmin = ckz * dz_terrain *
rho;
1297 rhoKmax =
rho * Kmax;
1299 constexpr Real Kmin = Real(0.1);
1300 constexpr Real Kmax = Real(300.0);
1301 rhoKmin =
rho * Kmin;
1302 rhoKmax =
rho * Kmax;
1310 std::min(K_turb(i, j, k,
EddyDiff::Q_v), rhoKmax), rhoKmin);
1315 if (scalar_Sc_t > Real(0)) {
1335 if (k < pbli_extent) {
1345 ParallelFor(xybx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int ) noexcept
1364 if (use_fire_correction) {
1365 ParallelDescriptor::ReduceRealMax({fire_pblh_max_pred, fire_pblh_max_corr,
1366 fire_wstar_max, fire_kbfs_max});
1367 amrex::Print() <<
"[MRF FIRE] level " << level <<
" fire w* boost"
1368 <<
" pblh_predictor_max=" << fire_pblh_max_pred <<
" m"
1369 <<
" pblh_corrector_max=" << fire_pblh_max_corr <<
" m"
1370 <<
" wstar_max=" << fire_wstar_max <<
" m/s"
1371 <<
" kbfs_fire_max=" << fire_kbfs_max <<
" K m/s\n";
1376 SurfLayer->set_pblh(level, pblh_mf);
constexpr amrex::Real epsv
Definition: ERF_Constants.H:56
constexpr amrex::Real KAPPA
Definition: ERF_Constants.H:71
constexpr amrex::Real CONST_GRAV
Definition: ERF_Constants.H:72
constexpr amrex::Real immersed_neutral_obukhov_length
Definition: ERF_Constants.H:31
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real getTgivenRandRTh(const amrex::Real rho, const amrex::Real rhotheta, const amrex::Real qv=amrex::Real(0))
Definition: ERF_EOS.H:46
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real getPgivenRTh(const amrex::Real rhotheta, const amrex::Real qv=amrex::Real(0))
Definition: ERF_EOS.H:81
#define Rho_comp
Definition: ERF_IndexDefines.H:61
#define RhoTheta_comp
Definition: ERF_IndexDefines.H:62
amrex::GpuArray< Real, AMREX_SPACEDIM > dxInv
Definition: ERF_InitCustomPertVels_ParticleTests.H:16
const bool use_moisture
Definition: ERF_InitCustomPert_ABL.H:127
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(axis >=0 &&axis< AMREX_SPACEDIM, "prob.axis must be 0, 1 or 2")
const int khi
Definition: ERF_InitCustomPert_Bubble.H:25
AMREX_ALWAYS_ASSERT(bx.length()[2]==khi+1)
const int klo
Definition: ERF_InitCustomPert_KE.H:9
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > LengthScaleCellSize(const amrex::Geometry &geom)
Definition: ERF_LengthScaleCellSize.H:28
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void erf_qsatw(amrex::Real t, amrex::Real p, amrex::Real &qsatw)
Definition: ERF_MicrophysicsUtils.H:265
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real GetThetav(const int &i, const int &j, const int &k, const amrex::Array4< amrex::Real const > &cell_data, const MoistureComponentIndices &moisture_indices)
Definition: ERF_MoistUtils.H:93
ParallelFor(fab_box, [=] AMREX_GPU_DEVICE(int i, int j, int k) { qrcuten_arr(i, j, k)=Real(0);qscuten_arr(i, j, k)=Real(0);qicuten_arr(i, j, k)=Real(0);})
constexpr amrex::Real one
Definition: ERF_NumericalConstants.H:37
constexpr amrex::Real fourth
Definition: ERF_NumericalConstants.H:42
constexpr amrex::Real zero
Definition: ERF_NumericalConstants.H:36
constexpr amrex::Real myhalf
Definition: ERF_NumericalConstants.H:41
std::unique_ptr< amrex::MultiFab > WidenForPBLH(const amrex::MultiFab &src, const int ng, const std::function< void(amrex::MultiFab &)> &fill)
Definition: ERF_PBLModels.H:789
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void ComputeVerticalDerivativesPBL(int i, int j, int k, const amrex::Array4< const amrex::Real > &uvel, const amrex::Array4< const amrex::Real > &vvel, const amrex::Array4< const amrex::Real > &cell_data, const int izmin, const int izmax, const PBLDerivativeDzInv &dz_inv, const bool c_ext_dir_on_zlo, const bool c_ext_dir_on_zhi, const bool u_ext_dir_on_zlo, const bool u_ext_dir_on_zhi, const bool v_ext_dir_on_zlo, const bool v_ext_dir_on_zhi, amrex::Real &dthetadz, amrex::Real &dudz, amrex::Real &dvdz, const MoistureComponentIndices &moisture_indices, const StratType strat=StratType::thetav)
Definition: ERF_PBLModels.H:291
void ApplyPBLHSmoothing(amrex::FArrayBox &pblh_fab, const amrex::Box &xybx_valid, const amrex::Real weight, const int passes, const amrex::Box &domain, const amrex::Periodicity &periodicity)
Apply spatial smoothing to PBLH field using 5-point stencil.
Definition: ERF_PBLModels.H:706
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real pblh_floor(amrex::Real zl1, amrex::Real dz1) noexcept
Definition: ERF_PBLRibCrossing.H:36
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real pbl_kh_blend_and_cap(amrex::Real K_h, amrex::Real dx, amrex::Real L_blend, amrex::Real C_s, amrex::Real c_max, amrex::Real SmnSmn, bool use_smag) noexcept
Apply scale-aware blending and ceiling to a single K_h value.
Definition: ERF_PBLScaleAwareBlending.H:132
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_Zrel_AtCellCenter(const int &i, const int &j, const int &k, const amrex::Array4< const amrex::Real > &z_sfc_nd, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:764
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_zeta_AtCellCenter(const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:202
AMREX_FORCE_INLINE amrex::IntVect TileNoZ()
Definition: ERF_TileNoZ.H:11
@ yvel_bc
Definition: ERF_IndexDefines.H:139
@ cons_bc
Definition: ERF_IndexDefines.H:122
@ xvel_bc
Definition: ERF_IndexDefines.H:138
@ ext_dir
Definition: ERF_IndexDefines.H:317
@ Theta_v
Definition: ERF_IndexDefines.H:267
@ Turb_lengthscale
Definition: ERF_IndexDefines.H:271
@ Scalar_v
Definition: ERF_IndexDefines.H:269
@ Q_v
Definition: ERF_IndexDefines.H:270
@ Mom_v
Definition: ERF_IndexDefines.H:266
@ HGAMQ_v
Definition: ERF_IndexDefines.H:278
@ HGAMT_v
Definition: ERF_IndexDefines.H:277
@ ks
Definition: ERF_SLM.H:76
@ rho
Definition: ERF_Kessler.H:25
@ xvel
Definition: ERF_IndexDefines.H:232
@ yvel
Definition: ERF_IndexDefines.H:233
@ zi
Definition: ERF_AdvanceWDM6.cpp:277
int qi
cloud ice
Definition: ERF_DataStruct.H:292
int qv
water vapor
Definition: ERF_DataStruct.H:290
int qc
cloud liquid water
Definition: ERF_DataStruct.H:291
Functor for inverse vertical spacings for terrain-following grids using cell-center heights.
Definition: ERF_PBLModels.H:652
amrex::Real pbl_mrf_Sc_t
MRF turbulent Schmidt number of the passive scalars (erf.pbl_mrf_Sc_t): their vertical diffusivity is...
Definition: ERF_TurbStruct.H:1128
bool enable_mrf_unbounded_vpert
Whether MRF leaves VPERT unlimited by GAMCRT.
Definition: ERF_TurbStruct.H:1129
amrex::Real pbl_blend_length
Boutle blending length L [m]. 0 = off.
Definition: ERF_TurbStruct.H:1119
bool pbl_mrf_use_zero_ri_extent
Whether MRF uses the Ri=0 K-profile extent.
Definition: ERF_TurbStruct.H:1130
amrex::Real qnse_ah
Definition: ERF_TurbStruct.H:1142
amrex::Real mrf_fire_q_threshold
Definition: ERF_TurbStruct.H:1132
StratType pbl_strat_type
Definition: ERF_TurbStruct.H:951
bool enable_vh96_shear_correction
Whether Vogelezang & Holtslag (1996) shear-correction term is enabled.
Definition: ERF_TurbStruct.H:1106
bool enable_mrf_cloud_adjustment
Whether MRF cloud-aware stability adjustments are enabled.
Definition: ERF_TurbStruct.H:1126
amrex::Real pbl_mrf_const_b
MRF constant used to compute PBL height.
Definition: ERF_TurbStruct.H:1114
amrex::Real pblh_smoothing_weight
Center-cell weight in PBLH smoothing stencil (must be in [0,1]).
Definition: ERF_TurbStruct.H:1110
amrex::Real pbl_blend_cs
Smagorinsky coeff for K_h ceiling.
Definition: ERF_TurbStruct.H:1120
amrex::Real qnse_bm
Definition: ERF_TurbStruct.H:1141
amrex::Real pbl_blend_c_max
Power-law ceiling coeff [m^(2/3)/s].
Definition: ERF_TurbStruct.H:1121
amrex::Real qnse_bh
Definition: ERF_TurbStruct.H:1143
bool enable_qnse_stable_functions
Definition: ERF_TurbStruct.H:1138
bool enable_mrf_countergradient
Whether MRF countergradient corrections are enabled.
Definition: ERF_TurbStruct.H:1123
bool enable_pblh_smoothing
Whether spatial smoothing of diagnosed PBLH is enabled.
Definition: ERF_TurbStruct.H:1108
int pblh_smoothing_passes
Number of PBLH smoothing iterations to apply.
Definition: ERF_TurbStruct.H:1109
amrex::Real pbl_ib_z0
Definition: ERF_TurbStruct.H:1125
bool pbl_ib_aware
Definition: ERF_TurbStruct.H:1124
bool pbl_mrf_highres_bounds
Whether MRF applies high-resolution grid-dependent diffusivity bounds.
Definition: ERF_TurbStruct.H:1127
bool mrf_fire_thermal_excess
Definition: ERF_TurbStruct.H:1131
amrex::Real vh96_shear_const_b
Vogelezang & Holtslag (1996) shear-correction constant b.
Definition: ERF_TurbStruct.H:1107
amrex::Real pbl_mrf_Ribcr
Critical bulk Richardson number for the MRF PBL scheme.
Definition: ERF_TurbStruct.H:1113
amrex::Real qnse_am
Definition: ERF_TurbStruct.H:1140
amrex::Real pbl_mrf_sf
MRF surface flux value used to compute PBL height.
Definition: ERF_TurbStruct.H:1115
amrex::Real Pr_t
Turbulent Prandtl number.
Definition: ERF_TurbStruct.H:912