ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_AdvanceWSM6.cpp File Reference
#include "ERF_WSM6.H"
#include "ERF_WSM6_Fortran_Interface.H"
#include "ERF_MicrophysicsConstants.H"
#include "ERF_Constants.H"
#include <AMReX_Reduce.H>
#include <algorithm>
#include <array>
#include <cctype>
#include <cstdio>
#include <cmath>
#include <cstdint>
#include <cstring>
#include <string>
#include <vector>
Include dependency graph for ERF_AdvanceWSM6.cpp:

Namespaces

 WSM6SedCellScratch
 
 WSM6SedNodeScratch
 

Enumerations

enum  {
  WSM6SedCellScratch::wd = 0 , WSM6SedCellScratch::wa , WSM6SedCellScratch::wa2 , WSM6SedCellScratch::qn ,
  WSM6SedCellScratch::qn2 , WSM6SedCellScratch::dz , WSM6SedCellScratch::ww , WSM6SedCellScratch::qq ,
  WSM6SedCellScratch::qq2 , WSM6SedCellScratch::was , WSM6SedCellScratch::den , WSM6SedCellScratch::denfac ,
  WSM6SedCellScratch::tk , WSM6SedCellScratch::qr , WSM6SedCellScratch::qr2 , WSM6SedCellScratch::tmp ,
  WSM6SedCellScratch::tmp1 , WSM6SedCellScratch::tmp2 , WSM6SedCellScratch::tmp3 , WSM6SedCellScratch::workr_col ,
  WSM6SedCellScratch::worka_col , WSM6SedCellScratch::denqrs1_col , WSM6SedCellScratch::denqrs2_col , WSM6SedCellScratch::denqrs3_col ,
  WSM6SedCellScratch::qsum_col , WSM6SedCellScratch::work1c_col , WSM6SedCellScratch::denqci_col , WSM6SedCellScratch::NumComps
}
 
enum  {
  WSM6SedNodeScratch::wi = 0 , WSM6SedNodeScratch::zi , WSM6SedNodeScratch::za , WSM6SedNodeScratch::dza ,
  WSM6SedNodeScratch::qa , WSM6SedNodeScratch::qa2 , WSM6SedNodeScratch::qmi , WSM6SedNodeScratch::qpi ,
  WSM6SedNodeScratch::NumComps
}
 

Functions

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real wsm6_cpmcal (Real x, Real qmin_arg, Real cpd_arg, Real cpv_arg)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real wsm6_xlcal (Real x, Real xlv0_arg, Real xlv1_arg, Real t0c_arg)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real wsm6_diffus (Real x, Real y)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real wsm6_viscos (Real x, Real y)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real wsm6_xka (Real x, Real y)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real wsm6_diffac (Real a, Real b, Real c, Real d, Real e, Real rv_arg)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real wsm6_venfac (Real a, Real b, Real c, Real den0_arg)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real wsm6_conden (Real a, Real b, Real c, Real d, Real e, Real qmin_arg, Real rv_arg)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real wsm6_lamdar (Real x, Real y, Real pidn0r_arg)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real wsm6_lamdas (Real x, Real y, Real z, Real pidn0s_arg)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real wsm6_lamdag (Real x, Real y, Real pidn0g_arg)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void wsm6_slope_rain_cell (Real qr, Real den, Real denfac, Real pidn0r_arg, Real qcrmin_arg, Real rslopermax_arg, Real rsloperbmax_arg, Real rsloper2max_arg, Real rsloper3max_arg, Real bvtr_arg, Real pvtr_arg, Real &rslope, Real &rslopeb, Real &rslope2, Real &rslope3, Real &vt)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void wsm6_slope_snow_cell (Real qs, Real den, Real denfac, Real t, Real pidn0s_arg, Real alpha_arg, Real n0smax_arg, Real n0s_arg, Real t0c_arg, Real qcrmin_arg, Real rslopesmax_arg, Real rslopesbmax_arg, Real rslopes2max_arg, Real rslopes3max_arg, Real bvts_arg, Real pvts_arg, Real &rslope, Real &rslopeb, Real &rslope2, Real &rslope3, Real &vt, Real &n0sfac)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void wsm6_slope_graup_cell (Real qg, Real den, Real denfac, Real pidn0g_arg, Real qcrmin_arg, Real rslopegmax_arg, Real rslopegbmax_arg, Real rslopeg2max_arg, Real rslopeg3max_arg, Real bvtg_arg, Real pvtg_arg, Real &rslope, Real &rslopeb, Real &rslope2, Real &rslope3, Real &vt)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void wsm6_nislfv_rain_plm_scratch (int km, int ww_comp, int rq_comp, Real *precip, Real dt, int iter, Array4< Real > const &sed_cell, Array4< Real > const &sed_node, int i_s, int j_s, int klo_s)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void wsm6_nislfv_rain_plm6_scratch (int km, int ww_comp, int rq_comp, int rq2_comp, Real *precip1, Real *precip2, Real dt, int iter, Array4< Real > const &sed_cell, Array4< Real > const &sed_node, int i_s, int j_s, int klo_s)
 

Function Documentation

◆ wsm6_conden()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real wsm6_conden ( Real  a,
Real  b,
Real  c,
Real  d,
Real  e,
Real  qmin_arg,
Real  rv_arg 
)
67  {
68  return (amrex::max(b,qmin_arg)-c)
69  /(Real(1.0)+d*d/(rv_arg*e)*c/(a*a));
70 }
amrex::Real Real
Definition: ERF_ShocInterface.H:19

Referenced by WSM6::Advance().

Here is the caller graph for this function:

◆ wsm6_cpmcal()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real wsm6_cpmcal ( Real  x,
Real  qmin_arg,
Real  cpd_arg,
Real  cpv_arg 
)
25  {
26  return cpd_arg*(Real(1.0)-amrex::max(x,qmin_arg))
27  +amrex::max(x,qmin_arg)*cpv_arg;
28 }

Referenced by WSM6::Advance().

Here is the caller graph for this function:

◆ wsm6_diffac()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real wsm6_diffac ( Real  a,
Real  b,
Real  c,
Real  d,
Real  e,
Real  rv_arg 
)
52  {
53  return d*a*a/(wsm6_xka(c,d)*rv_arg*c*c)
54  +Real(1.0)/(e*wsm6_diffus(c,b));
55 }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real wsm6_xka(Real x, Real y)
Definition: ERF_AdvanceWSM6.cpp:46
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real wsm6_diffus(Real x, Real y)
Definition: ERF_AdvanceWSM6.cpp:36

Referenced by WSM6::Advance().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wsm6_diffus()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real wsm6_diffus ( Real  x,
Real  y 
)
36  {
37  return Real(8.794e-5)*std::exp(std::log(x)*Real(1.81))/y;
38 }

Referenced by wsm6_diffac(), and wsm6_venfac().

Here is the caller graph for this function:

◆ wsm6_lamdag()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real wsm6_lamdag ( Real  x,
Real  y,
Real  pidn0g_arg 
)
89  {
90  return std::sqrt(std::sqrt(pidn0g_arg/(x*y)));
91 }

Referenced by wsm6_slope_graup_cell().

Here is the caller graph for this function:

◆ wsm6_lamdar()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real wsm6_lamdar ( Real  x,
Real  y,
Real  pidn0r_arg 
)
79  {
80  return std::sqrt(std::sqrt(pidn0r_arg/(x*y)));
81 }

Referenced by wsm6_slope_rain_cell().

Here is the caller graph for this function:

◆ wsm6_lamdas()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real wsm6_lamdas ( Real  x,
Real  y,
Real  z,
Real  pidn0s_arg 
)
84  {
85  return std::sqrt(std::sqrt(pidn0s_arg*z/(x*y)));
86 }

Referenced by wsm6_slope_snow_cell().

Here is the caller graph for this function:

◆ wsm6_nislfv_rain_plm6_scratch()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void wsm6_nislfv_rain_plm6_scratch ( int  km,
int  ww_comp,
int  rq_comp,
int  rq2_comp,
Real precip1,
Real precip2,
Real  dt,
int  iter,
Array4< Real > const &  sed_cell,
Array4< Real > const &  sed_node,
int  i_s,
int  j_s,
int  klo_s 
)
509 {
510  auto DZ = [&](int k) -> amrex::Real& {
511  return sed_cell(i_s, j_s, klo_s + k, WSM6SedCellScratch::dz);
512  };
513  auto WW = [&](int k) -> amrex::Real& {
514  return sed_cell(i_s, j_s, klo_s + k, WSM6SedCellScratch::ww);
515  };
516  auto QQ = [&](int k) -> amrex::Real& {
517  return sed_cell(i_s, j_s, klo_s + k, WSM6SedCellScratch::qq);
518  };
519  auto QQ2 = [&](int k) -> amrex::Real& {
520  return sed_cell(i_s, j_s, klo_s + k, WSM6SedCellScratch::qq2);
521  };
522  auto WD = [&](int k) -> amrex::Real& {
523  return sed_cell(i_s, j_s, klo_s + k, WSM6SedCellScratch::wd);
524  };
525  auto WA = [&](int k) -> amrex::Real& {
526  return sed_cell(i_s, j_s, klo_s + k, WSM6SedCellScratch::wa);
527  };
528  auto WA2 = [&](int k) -> amrex::Real& {
529  return sed_cell(i_s, j_s, klo_s + k, WSM6SedCellScratch::wa2);
530  };
531  auto WAS = [&](int k) -> amrex::Real& {
532  return sed_cell(i_s, j_s, klo_s + k, WSM6SedCellScratch::was);
533  };
534  auto DEN = [&](int k) -> amrex::Real& {
535  return sed_cell(i_s, j_s, klo_s + k, WSM6SedCellScratch::den);
536  };
537  auto DENFAC = [&](int k) -> amrex::Real& {
538  return sed_cell(i_s, j_s, klo_s + k, WSM6SedCellScratch::denfac);
539  };
540  auto TK = [&](int k) -> amrex::Real& {
541  return sed_cell(i_s, j_s, klo_s + k, WSM6SedCellScratch::tk);
542  };
543  auto QN = [&](int k) -> amrex::Real& {
544  return sed_cell(i_s, j_s, klo_s + k, WSM6SedCellScratch::qn);
545  };
546  auto QN2 = [&](int k) -> amrex::Real& {
547  return sed_cell(i_s, j_s, klo_s + k, WSM6SedCellScratch::qn2);
548  };
549  auto QR = [&](int k) -> amrex::Real& {
550  return sed_cell(i_s, j_s, klo_s + k, WSM6SedCellScratch::qr);
551  };
552  auto QR2 = [&](int k) -> amrex::Real& {
553  return sed_cell(i_s, j_s, klo_s + k, WSM6SedCellScratch::qr2);
554  };
555  auto TMP = [&](int k) -> amrex::Real& {
556  return sed_cell(i_s, j_s, klo_s + k, WSM6SedCellScratch::tmp);
557  };
558  auto TMP1 = [&](int k) -> amrex::Real& {
559  return sed_cell(i_s, j_s, klo_s + k, WSM6SedCellScratch::tmp1);
560  };
561  auto TMP2 = [&](int k) -> amrex::Real& {
562  return sed_cell(i_s, j_s, klo_s + k, WSM6SedCellScratch::tmp2);
563  };
564  auto TMP3 = [&](int k) -> amrex::Real& {
565  return sed_cell(i_s, j_s, klo_s + k, WSM6SedCellScratch::tmp3);
566  };
567 
568  auto WI = [&](int k) -> amrex::Real& {
569  return sed_node(i_s, j_s, klo_s + k, WSM6SedNodeScratch::wi);
570  };
571  auto ZI = [&](int k) -> amrex::Real& {
572  return sed_node(i_s, j_s, klo_s + k, WSM6SedNodeScratch::zi);
573  };
574  auto ZA = [&](int k) -> amrex::Real& {
575  return sed_node(i_s, j_s, klo_s + k, WSM6SedNodeScratch::za);
576  };
577  auto DZA = [&](int k) -> amrex::Real& {
578  return sed_node(i_s, j_s, klo_s + k, WSM6SedNodeScratch::dza);
579  };
580  auto QA = [&](int k) -> amrex::Real& {
581  return sed_node(i_s, j_s, klo_s + k, WSM6SedNodeScratch::qa);
582  };
583  auto QA2 = [&](int k) -> amrex::Real& {
584  return sed_node(i_s, j_s, klo_s + k, WSM6SedNodeScratch::qa2);
585  };
586  auto QMI = [&](int k) -> amrex::Real& {
587  return sed_node(i_s, j_s, klo_s + k, WSM6SedNodeScratch::qmi);
588  };
589  auto QPI = [&](int k) -> amrex::Real& {
590  return sed_node(i_s, j_s, klo_s + k, WSM6SedNodeScratch::qpi);
591  };
592 
593  constexpr Real pi = Real(3.141592653589793238462643383279502884);
594  auto rgmma = [](Real x) -> Real {
595  if (x == Real(1.0)) return Real(0.0);
596  constexpr Real euler = Real(0.577215664901532);
597  Real rg = x * std::exp(euler * x);
598  for (int ii = 1; ii <= 10000; ++ii) {
599  const Real y = static_cast<Real>(ii);
600  rg = rg * (Real(1.0) + x / y) * std::exp(-x / y);
601  }
602  return Real(1.0) / rg;
603  };
604 
605  const Real dens = WSM6::dens_snow;
606  const Real n0g = Real(4.0e6);
607  const Real deng = Real(500.0);
608  const Real avtg = Real(330.0);
609  const Real bvtg = Real(0.8);
610  const Real lamdagmax = Real(6.0e4);
611 
612  const Real pidn0s = pi * dens * WSM6::n0s;
613  const Real pidn0g = pi * deng * n0g;
614  const Real rslopesmax = Real(1.0) / WSM6::lamdasmax;
615  const Real rslopesbmax = std::pow(rslopesmax, WSM6::bvts);
618  const Real rslopegmax = Real(1.0) / lamdagmax;
619  const Real rslopegbmax = std::pow(rslopegmax, bvtg);
622  const Real pvts = WSM6::avts * rgmma(Real(4.0) + WSM6::bvts) / Real(6.0);
623  const Real pvtg = avtg * rgmma(Real(4.0) + bvtg) / Real(6.0);
624 
625  Real allold = Real(0.0);
626  for (int k = 0; k < km; ++k) {
627  QQ(k) = sed_cell(i_s, j_s, klo_s + k, rq_comp);
628  QQ2(k) = sed_cell(i_s, j_s, klo_s + k, rq2_comp);
629  WW(k) = sed_cell(i_s, j_s, klo_s + k, ww_comp);
630  WD(k) = WW(k);
631  allold += QQ(k) + QQ2(k);
632  }
633 
634  precip1[0] = Real(0.0);
635  precip2[0] = Real(0.0);
636  if (allold <= Real(0.0)) {
637  return;
638  }
639 
640  ZI(0) = Real(0.0);
641  for (int k = 0; k < km; ++k) {
642  ZI(k + 1) = ZI(k) + DZ(k);
643  }
644 
645  auto update_wind_and_state = [&](void) {
646  WI(0) = WW(0);
647  WI(km) = WW(km - 1);
648  for (int k = 1; k < km; ++k) {
649  WI(k) = (WW(k) * DZ(k - 1) + WW(k - 1) * DZ(k)) / (DZ(k - 1) + DZ(k));
650  }
651 
652  WI(0) = WW(0);
653  WI(1) = Real(0.5) * (WW(1) + WW(0));
654  for (int k = 2; k < km - 1; ++k) {
655  WI(k) = Real(9.0) / Real(16.0) * (WW(k) + WW(k - 1))
656  - Real(1.0) / Real(16.0) * (WW(k + 1) + WW(k - 2));
657  }
658  if (km > 1) {
659  WI(km - 1) = Real(0.5) * (WW(km - 1) + WW(km - 2));
660  WI(km) = WW(km - 1);
661  }
662 
663  for (int k = 1; k < km; ++k) {
664  if (WW(k) == Real(0.0)) WI(k) = WW(k - 1);
665  }
666 
667  const Real con1 = Real(0.05);
668  for (int k = km - 1; k >= 0; --k) {
669  const Real decfl = (WI(k + 1) - WI(k)) * dt / DZ(k);
670  if (decfl > con1) {
671  WI(k) = WI(k + 1) - con1 * DZ(k) / dt;
672  }
673  }
674 
675  for (int k = 0; k <= km; ++k) {
676  ZA(k) = ZI(k) - WI(k) * dt;
677  }
678 
679  for (int k = 0; k < km; ++k) {
680  DZA(k) = ZA(k + 1) - ZA(k);
681  if (DZA(k) <= Real(0.0)) DZA(k) = DZ(k);
682  }
683  DZA(km) = ZI(km) - ZA(km);
684  if (DZA(km) <= Real(0.0)) DZA(km) = DZ(km > 0 ? km - 1 : 0);
685  for (int k = 0; k < km; ++k) {
686  QA(k) = QQ(k) * DZ(k) / DZA(k);
687  QA2(k) = QQ2(k) * DZ(k) / DZA(k);
688  QR(k) = QA(k) / DEN(k);
689  QR2(k) = QA2(k) / DEN(k);
690  }
691  QA(km) = Real(0.0);
692  QA2(km) = Real(0.0);
693  };
694 
695  update_wind_and_state();
696 
697  if (iter > 0) {
698  Real n0sfac_dummy;
699  for (int k = 0; k < km; ++k) {
700  wsm6_slope_snow_cell(QR(k), DEN(k), DENFAC(k), TK(k), pidn0s,
701  Real(0.12), Real(1.0e11), Real(2.0e6),
702  Real(273.15), Real(WSM6::qcrmin),
705  TMP(k), TMP1(k), TMP2(k), TMP3(k),
706  WA(k), n0sfac_dummy);
707  wsm6_slope_graup_cell(QR2(k), DEN(k), DENFAC(k), pidn0g,
710  Real(0.8), pvtg,
711  TMP(k), TMP1(k), TMP2(k), TMP3(k),
712  WA2(k));
713  }
714  for (int k = 0; k < km; ++k) {
715  const Real tmpq = amrex::max(QR(k) + QR2(k), Real(1.0e-15));
716  if (tmpq > Real(1.0e-15)) {
717  WA(k) = (WA(k) * QR(k) + WA2(k) * QR2(k)) / tmpq;
718  } else {
719  WA(k) = Real(0.0);
720  }
721  }
722  for (int k = 0; k < km; ++k) {
723  WW(k) = Real(0.5) * (WD(k) + WA(k));
724  WAS(k) = WA(k);
725  }
726  update_wind_and_state();
727  }
728 
729  for (int ist = 0; ist < 2; ++ist) {
730  const int qn_comp = (ist == 0)
733  const int qa_comp = (ist == 0)
736  auto QN_DST = [&](int k) -> Real& {
737  return sed_cell(i_s,j_s,klo_s+k,qn_comp);
738  };
739  auto QA_SRC = [&](int k) -> Real& {
740  return sed_node(i_s,j_s,klo_s+k,qa_comp);
741  };
742  Real* precip_dst = (ist == 0) ? &precip1[0] : &precip2[0];
743 
744  for (int k = 1; k < km; ++k) {
745  const Real dip = (QA_SRC(k + 1) - QA_SRC(k)) / (DZA(k + 1) + DZA(k));
746  const Real dim = (QA_SRC(k) - QA_SRC(k - 1)) / (DZA(k - 1) + DZA(k));
747  if (dip * dim <= Real(0.0)) {
748  QMI(k) = QA_SRC(k);
749  QPI(k) = QA_SRC(k);
750  } else {
751  QPI(k) = QA_SRC(k) + Real(0.5) * (dip + dim) * DZA(k);
752  QMI(k) = Real(2.0) * QA_SRC(k) - QPI(k);
753  if (QPI(k) < Real(0.0) || QMI(k) < Real(0.0)) {
754  QPI(k) = QA_SRC(k);
755  QMI(k) = QA_SRC(k);
756  }
757  }
758  }
759  QPI(0) = QA_SRC(0);
760  QMI(0) = QA_SRC(0);
761  QMI(km) = QA_SRC(km);
762  QPI(km) = QA_SRC(km);
763 
764  for (int k = 0; k < km; ++k) {
765  QN_DST(k) = Real(0.0);
766  }
767 
768  int kb = 0;
769  int kt = 0;
770  for (int k = 0; k < km; ++k) {
771  if (ZI(k) >= ZA(km)) {
772  break;
773  }
774 
775  for (int kk = kb; kk < km; ++kk) {
776  if (ZI(k) <= ZA(kk + 1)) {
777  kb = kk;
778  break;
779  }
780  }
781 
782  for (int kk = kt; kk < km; ++kk) {
783  if (ZI(k + 1) <= ZA(kk)) {
784  kt = kk;
785  break;
786  }
787  }
788  kt = amrex::max(kt - 1, 0);
789 
790  if (kt == kb) {
791  const Real tl = (ZI(k) - ZA(kb)) / DZA(kb);
792  const Real th = (ZI(k + 1) - ZA(kb)) / DZA(kb);
793  const Real tl2 = tl * tl;
794  const Real th2 = th * th;
795  const Real qqd = Real(0.5) * (QPI(kb) - QMI(kb));
796  const Real qqh = qqd * th2 + QMI(kb) * th;
797  const Real qql = qqd * tl2 + QMI(kb) * tl;
798  QN_DST(k) = (qqh - qql) / (th - tl);
799  } else if (kt > kb) {
800  const Real tl = (ZI(k) - ZA(kb)) / DZA(kb);
801  const Real tl2 = tl * tl;
802  const Real qqd = Real(0.5) * (QPI(kb) - QMI(kb));
803  const Real qql = qqd * tl2 + QMI(kb) * tl;
804  const Real dql = QA_SRC(kb) - qql;
805  Real zsum = (Real(1.0) - tl) * DZA(kb);
806  Real qsum = dql * DZA(kb);
807  if (kt - kb > 1) {
808  for (int m = kb + 1; m < kt; ++m) {
809  zsum += DZA(m);
810  qsum += QA_SRC(m) * DZA(m);
811  }
812  }
813  const Real th = (ZI(k + 1) - ZA(kt)) / DZA(kt);
814  const Real th2 = th * th;
815  const Real dqh = Real(0.5) * (QPI(kt) - QMI(kt)) * th2 + QMI(kt) * th;
816  zsum += th * DZA(kt);
817  qsum += dqh * DZA(kt);
818  QN_DST(k) = qsum / zsum;
819  }
820  }
821 
822  Real precip = Real(0.0);
823  for (int k = 0; k < km; ++k) {
824  if (ZA(k) < Real(0.0) && ZA(k + 1) < Real(0.0)) {
825  precip += QA_SRC(k) * DZA(k);
826  } else if (ZA(k) < Real(0.0) && ZA(k + 1) >= Real(0.0)) {
827  precip += QA_SRC(k) * (Real(0.0) - ZA(k));
828  break;
829  } else {
830  break;
831  }
832  }
833  *precip_dst = precip;
834  }
835 
836  for (int k = 0; k < km; ++k) {
837  sed_cell(i_s, j_s, klo_s + k, rq_comp) = QN(k);
838  sed_cell(i_s, j_s, klo_s + k, rq2_comp) = QN2(k);
839  sed_cell(i_s, j_s, klo_s + k, ww_comp) = WW(k);
840  }
841 }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void wsm6_slope_snow_cell(Real qs, Real den, Real denfac, Real t, Real pidn0s_arg, Real alpha_arg, Real n0smax_arg, Real n0s_arg, Real t0c_arg, Real qcrmin_arg, Real rslopesmax_arg, Real rslopesbmax_arg, Real rslopes2max_arg, Real rslopes3max_arg, Real bvts_arg, Real pvts_arg, Real &rslope, Real &rslopeb, Real &rslope2, Real &rslope3, Real &vt, Real &n0sfac)
Definition: ERF_AdvanceWSM6.cpp:172
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void wsm6_slope_graup_cell(Real qg, Real den, Real denfac, Real pidn0g_arg, Real qcrmin_arg, Real rslopegmax_arg, Real rslopegbmax_arg, Real rslopeg2max_arg, Real rslopeg3max_arg, Real bvtg_arg, Real pvtg_arg, Real &rslope, Real &rslopeb, Real &rslope2, Real &rslope3, Real &vt)
Definition: ERF_AdvanceWSM6.cpp:202
static constexpr amrex::Real qcrmin
Definition: ERF_WSM6.H:154
static constexpr amrex::Real lamdasmax
Definition: ERF_WSM6.H:149
static constexpr amrex::Real n0s
Definition: ERF_WSM6.H:159
static constexpr amrex::Real dens_snow
Definition: ERF_WSM6.H:156
static constexpr amrex::Real bvts
Definition: ERF_WSM6.H:147
static constexpr amrex::Real avts
Definition: ERF_WSM6.H:146
@ n0g
Definition: ERF_AdvanceMorrison.cpp:45
@ QR
Definition: ERF_IndexDefines.H:142
constexpr int DZ
Definition: ERF_TwoStreamColumn.H:599
@ qsum
Definition: ERF_WSM6.H:323
@ qq2
Definition: ERF_AdvanceWSM6.cpp:109
@ qq
Definition: ERF_AdvanceWSM6.cpp:108
@ qn2
Definition: ERF_AdvanceWSM6.cpp:105
@ tmp
Definition: ERF_AdvanceWSM6.cpp:116
@ wa
Definition: ERF_AdvanceWSM6.cpp:102
@ qn
Definition: ERF_AdvanceWSM6.cpp:104
@ was
Definition: ERF_AdvanceWSM6.cpp:110
@ tmp3
Definition: ERF_AdvanceWSM6.cpp:119
@ wa2
Definition: ERF_AdvanceWSM6.cpp:103
@ wd
Definition: ERF_AdvanceWSM6.cpp:101
@ qr2
Definition: ERF_AdvanceWSM6.cpp:115
@ tmp1
Definition: ERF_AdvanceWSM6.cpp:117
@ den
Definition: ERF_AdvanceWSM6.cpp:111
@ dz
Definition: ERF_AdvanceWSM6.cpp:106
@ tk
Definition: ERF_AdvanceWSM6.cpp:113
@ tmp2
Definition: ERF_AdvanceWSM6.cpp:118
@ denfac
Definition: ERF_AdvanceWSM6.cpp:112
@ qr
Definition: ERF_AdvanceWSM6.cpp:114
@ ww
Definition: ERF_AdvanceWSM6.cpp:107
@ wi
Definition: ERF_AdvanceWSM6.cpp:134
@ qmi
Definition: ERF_AdvanceWSM6.cpp:140
@ qa2
Definition: ERF_AdvanceWSM6.cpp:139
@ qpi
Definition: ERF_AdvanceWSM6.cpp:141
@ qa
Definition: ERF_AdvanceWSM6.cpp:138
@ dza
Definition: ERF_AdvanceWSM6.cpp:137
@ zi
Definition: ERF_AdvanceWSM6.cpp:135
@ za
Definition: ERF_AdvanceWSM6.cpp:136
real(c_double), parameter, private pi
Definition: ERF_module_mp_morr_two_moment.F90:100
real(kind=kind_phys), save rslopes3max
Definition: ERF_module_mp_wdm6.F90:100
real(kind=kind_phys), save rslopegmax
Definition: ERF_module_mp_wdm6.F90:100
real(kind=kind_phys), save rslopesmax
Definition: ERF_module_mp_wdm6.F90:100
real(kind=kind_phys), save pidn0s
Definition: ERF_module_mp_wdm6.F90:100
real(kind=kind_phys), save rslopeg3max
Definition: ERF_module_mp_wdm6.F90:100
real(kind=kind_phys), save deng
Definition: ERF_module_mp_wdm6.F90:100
real(kind=kind_phys), save avtg
Definition: ERF_module_mp_wdm6.F90:100
real(kind=kind_phys), save pvtg
Definition: ERF_module_mp_wdm6.F90:100
real(kind=kind_phys), parameter, private dens
Definition: ERF_module_mp_wdm6.F90:61
real(kind=kind_phys), save lamdagmax
Definition: ERF_module_mp_wdm6.F90:100
real(kind=kind_phys), save bvtg
Definition: ERF_module_mp_wdm6.F90:100
real(kind=kind_phys), save pvts
Definition: ERF_module_mp_wdm6.F90:100
real(kind=kind_phys), save rslopeg2max
Definition: ERF_module_mp_wdm6.F90:100
real(kind=kind_phys) function rgmma(x)
Definition: ERF_module_mp_wdm6.F90:2174
real(kind=kind_phys), save rslopesbmax
Definition: ERF_module_mp_wdm6.F90:100
real(kind=kind_phys), save pidn0g
Definition: ERF_module_mp_wdm6.F90:100
real(kind=kind_phys), save rslopegbmax
Definition: ERF_module_mp_wdm6.F90:100
real(kind=kind_phys), save rslopes2max
Definition: ERF_module_mp_wdm6.F90:100

Referenced by WSM6::Advance().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wsm6_nislfv_rain_plm_scratch()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void wsm6_nislfv_rain_plm_scratch ( int  km,
int  ww_comp,
int  rq_comp,
Real precip,
Real  dt,
int  iter,
Array4< Real > const &  sed_cell,
Array4< Real > const &  sed_node,
int  i_s,
int  j_s,
int  klo_s 
)
234 {
235  auto DZ = [&](int k) -> amrex::Real& {
236  return sed_cell(i_s, j_s, klo_s + k, WSM6SedCellScratch::dz);
237  };
238  auto WW = [&](int k) -> amrex::Real& {
239  return sed_cell(i_s, j_s, klo_s + k, WSM6SedCellScratch::ww);
240  };
241  auto QQ = [&](int k) -> amrex::Real& {
242  return sed_cell(i_s, j_s, klo_s + k, WSM6SedCellScratch::qq);
243  };
244  auto WD = [&](int k) -> amrex::Real& {
245  return sed_cell(i_s, j_s, klo_s + k, WSM6SedCellScratch::wd);
246  };
247  auto WA = [&](int k) -> amrex::Real& {
248  return sed_cell(i_s, j_s, klo_s + k, WSM6SedCellScratch::wa);
249  };
250  auto WAS = [&](int k) -> amrex::Real& {
251  return sed_cell(i_s, j_s, klo_s + k, WSM6SedCellScratch::was);
252  };
253  auto DEN = [&](int k) -> amrex::Real& {
254  return sed_cell(i_s, j_s, klo_s + k, WSM6SedCellScratch::den);
255  };
256  auto DENFAC = [&](int k) -> amrex::Real& {
257  return sed_cell(i_s, j_s, klo_s + k, WSM6SedCellScratch::denfac);
258  };
259  auto QN = [&](int k) -> amrex::Real& {
260  return sed_cell(i_s, j_s, klo_s + k, WSM6SedCellScratch::qn);
261  };
262  auto QR = [&](int k) -> amrex::Real& {
263  return sed_cell(i_s, j_s, klo_s + k, WSM6SedCellScratch::qr);
264  };
265  auto TMP = [&](int k) -> amrex::Real& {
266  return sed_cell(i_s, j_s, klo_s + k, WSM6SedCellScratch::tmp);
267  };
268  auto TMP1 = [&](int k) -> amrex::Real& {
269  return sed_cell(i_s, j_s, klo_s + k, WSM6SedCellScratch::tmp1);
270  };
271  auto TMP2 = [&](int k) -> amrex::Real& {
272  return sed_cell(i_s, j_s, klo_s + k, WSM6SedCellScratch::tmp2);
273  };
274  auto TMP3 = [&](int k) -> amrex::Real& {
275  return sed_cell(i_s, j_s, klo_s + k, WSM6SedCellScratch::tmp3);
276  };
277 
278  auto WI = [&](int k) -> amrex::Real& {
279  return sed_node(i_s, j_s, klo_s + k, WSM6SedNodeScratch::wi);
280  };
281  auto ZI = [&](int k) -> amrex::Real& {
282  return sed_node(i_s, j_s, klo_s + k, WSM6SedNodeScratch::zi);
283  };
284  auto ZA = [&](int k) -> amrex::Real& {
285  return sed_node(i_s, j_s, klo_s + k, WSM6SedNodeScratch::za);
286  };
287  auto DZA = [&](int k) -> amrex::Real& {
288  return sed_node(i_s, j_s, klo_s + k, WSM6SedNodeScratch::dza);
289  };
290  auto QA = [&](int k) -> amrex::Real& {
291  return sed_node(i_s, j_s, klo_s + k, WSM6SedNodeScratch::qa);
292  };
293  auto QMI = [&](int k) -> amrex::Real& {
294  return sed_node(i_s, j_s, klo_s + k, WSM6SedNodeScratch::qmi);
295  };
296  auto QPI = [&](int k) -> amrex::Real& {
297  return sed_node(i_s, j_s, klo_s + k, WSM6SedNodeScratch::qpi);
298  };
299 
300  constexpr Real pi = Real(3.141592653589793238462643383279502884);
301  auto rgmma = [](Real x) -> Real {
302  if (x == Real(1.0)) return Real(0.0);
303  constexpr Real euler = Real(0.577215664901532);
304  Real rg = x * std::exp(euler * x);
305  for (int ii = 1; ii <= 10000; ++ii) {
306  const Real y = static_cast<Real>(ii);
307  rg = rg * (Real(1.0) + x / y) * std::exp(-x / y);
308  }
309  return Real(1.0) / rg;
310  };
311 
312  const Real pidn0r = pi * Real(rhoh2o) * WSM6::n0r;
313  const Real rslopermax = Real(1.0) / WSM6::lamdarmax;
314  const Real rsloperbmax = std::pow(rslopermax, WSM6::bvtr);
317  const Real pvtr = WSM6::avtr * rgmma(Real(4.0) + WSM6::bvtr) / Real(6.0);
318 
319  Real allold = Real(0.0);
320  for (int k = 0; k < km; ++k) {
321  QQ(k) = sed_cell(i_s, j_s, klo_s + k, rq_comp);
322  WW(k) = sed_cell(i_s, j_s, klo_s + k, ww_comp);
323  WD(k) = WW(k);
324  allold += QQ(k);
325  }
326 
327  precip[0] = Real(0.0);
328  if (allold <= Real(0.0)) {
329  return;
330  }
331 
332  ZI(0) = Real(0.0);
333  for (int k = 0; k < km; ++k) {
334  ZI(k + 1) = ZI(k) + DZ(k);
335  }
336 
337  auto update_wind_and_state = [&](void) {
338  WI(0) = WW(0);
339  WI(km) = WW(km - 1);
340  for (int k = 1; k < km; ++k) {
341  WI(k) = (WW(k) * DZ(k - 1) + WW(k - 1) * DZ(k)) / (DZ(k - 1) + DZ(k));
342  }
343 
344  WI(0) = WW(0);
345  WI(1) = Real(0.5) * (WW(1) + WW(0));
346  for (int k = 2; k < km - 1; ++k) {
347  WI(k) = Real(9.0) / Real(16.0) * (WW(k) + WW(k - 1))
348  - Real(1.0) / Real(16.0) * (WW(k + 1) + WW(k - 2));
349  }
350  if (km > 1) {
351  WI(km - 1) = Real(0.5) * (WW(km - 1) + WW(km - 2));
352  WI(km) = WW(km - 1);
353  }
354 
355  for (int k = 1; k < km; ++k) {
356  if (WW(k) == Real(0.0)) WI(k) = WW(k - 1);
357  }
358 
359  const Real con1 = Real(0.05);
360  for (int k = km - 1; k >= 0; --k) {
361  const Real decfl = (WI(k + 1) - WI(k)) * dt / DZ(k);
362  if (decfl > con1) {
363  WI(k) = WI(k + 1) - con1 * DZ(k) / dt;
364  }
365  }
366 
367  for (int k = 0; k <= km; ++k) {
368  ZA(k) = ZI(k) - WI(k) * dt;
369  }
370 
371  for (int k = 0; k < km; ++k) {
372  DZA(k) = ZA(k + 1) - ZA(k);
373  if (DZA(k) <= Real(0.0)) DZA(k) = DZ(k);
374  }
375  DZA(km) = ZI(km) - ZA(km);
376  if (DZA(km) <= Real(0.0)) DZA(km) = DZ(km > 0 ? km - 1 : 0);
377  for (int k = 0; k < km; ++k) {
378  QA(k) = QQ(k) * DZ(k) / DZA(k);
379  QR(k) = QA(k) / DEN(k);
380  }
381  QA(km) = Real(0.0);
382  };
383 
384  update_wind_and_state();
385 
386  if (iter > 0) {
387  for (int k = 0; k < km; ++k) {
388  wsm6_slope_rain_cell(QR(k), DEN(k), DENFAC(k), pidn0r,
389  WSM6::qcrmin,
392  TMP(k), TMP1(k), TMP2(k), TMP3(k), WA(k));
393  }
394  for (int k = 0; k < km; ++k) {
395  WW(k) = Real(0.5) * (WD(k) + WA(k));
396  WAS(k) = WA(k);
397  }
398  update_wind_and_state();
399  }
400 
401  for (int k = 1; k < km; ++k) {
402  const Real dip = (QA(k + 1) - QA(k)) / (DZA(k + 1) + DZA(k));
403  const Real dim = (QA(k) - QA(k - 1)) / (DZA(k - 1) + DZA(k));
404  if (dip * dim <= Real(0.0)) {
405  QMI(k) = QA(k);
406  QPI(k) = QA(k);
407  } else {
408  QPI(k) = QA(k) + Real(0.5) * (dip + dim) * DZA(k);
409  QMI(k) = Real(2.0) * QA(k) - QPI(k);
410  if (QPI(k) < Real(0.0) || QMI(k) < Real(0.0)) {
411  QPI(k) = QA(k);
412  QMI(k) = QA(k);
413  }
414  }
415  }
416  QPI(0) = QA(0);
417  QMI(0) = QA(0);
418  QMI(km) = QA(km);
419  QPI(km) = QA(km);
420 
421  for (int k = 0; k < km; ++k) {
422  QN(k) = Real(0.0);
423  }
424 
425  int kb = 0;
426  int kt = 0;
427  for (int k = 0; k < km; ++k) {
428  kb = amrex::max(kb - 1, 0);
429  kt = amrex::max(kt - 1, 0);
430 
431  if (ZI(k) >= ZA(km)) {
432  break;
433  }
434 
435  for (int kk = kb; kk < km; ++kk) {
436  if (ZI(k) <= ZA(kk + 1)) {
437  kb = kk;
438  break;
439  }
440  }
441 
442  for (int kk = kt; kk < km; ++kk) {
443  if (ZI(k + 1) <= ZA(kk)) {
444  kt = kk;
445  break;
446  }
447  }
448  kt = amrex::max(kt - 1, 0);
449 
450  if (kt == kb) {
451  const Real tl = (ZI(k) - ZA(kb)) / DZA(kb);
452  const Real th = (ZI(k + 1) - ZA(kb)) / DZA(kb);
453  const Real tl2 = tl * tl;
454  const Real th2 = th * th;
455  const Real qqd = Real(0.5) * (QPI(kb) - QMI(kb));
456  const Real qqh = qqd * th2 + QMI(kb) * th;
457  const Real qql = qqd * tl2 + QMI(kb) * tl;
458  QN(k) = (qqh - qql) / (th - tl);
459  } else if (kt > kb) {
460  const Real tl = (ZI(k) - ZA(kb)) / DZA(kb);
461  const Real tl2 = tl * tl;
462  const Real qqd = Real(0.5) * (QPI(kb) - QMI(kb));
463  const Real qql = qqd * tl2 + QMI(kb) * tl;
464  const Real dql = QA(kb) - qql;
465  Real zsum = (Real(1.0) - tl) * DZA(kb);
466  Real qsum = dql * DZA(kb);
467  if (kt - kb > 1) {
468  for (int m = kb + 1; m < kt; ++m) {
469  zsum += DZA(m);
470  qsum += QA(m) * DZA(m);
471  }
472  }
473  const Real th = (ZI(k + 1) - ZA(kt)) / DZA(kt);
474  const Real th2 = th * th;
475  const Real dqh = Real(0.5) * (QPI(kt) - QMI(kt)) * th2 + QMI(kt) * th;
476  zsum += th * DZA(kt);
477  qsum += dqh * DZA(kt);
478  QN(k) = qsum / zsum;
479  }
480  }
481 
482  for (int k = 0; k < km; ++k) {
483  if (ZA(k) < Real(0.0) && ZA(k + 1) < Real(0.0)) {
484  precip[0] += QA(k) * DZA(k);
485  } else if (ZA(k) < Real(0.0) && ZA(k + 1) >= Real(0.0)) {
486  precip[0] += QA(k) * (Real(0.0) - ZA(k));
487  break;
488  } else {
489  break;
490  }
491  }
492 
493  for (int k = 0; k < km; ++k) {
494  sed_cell(i_s, j_s, klo_s + k, rq_comp) = QN(k);
495  sed_cell(i_s, j_s, klo_s + k, ww_comp) = WW(k);
496  }
497 }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void wsm6_slope_rain_cell(Real qr, Real den, Real denfac, Real pidn0r_arg, Real qcrmin_arg, Real rslopermax_arg, Real rsloperbmax_arg, Real rsloper2max_arg, Real rsloper3max_arg, Real bvtr_arg, Real pvtr_arg, Real &rslope, Real &rslopeb, Real &rslope2, Real &rslope3, Real &vt)
Definition: ERF_AdvanceWSM6.cpp:147
constexpr amrex::Real rhoh2o
Definition: ERF_MicrophysicsConstants.H:42
static constexpr amrex::Real avtr
Definition: ERF_WSM6.H:140
static constexpr amrex::Real n0r
Definition: ERF_WSM6.H:139
static constexpr amrex::Real lamdarmax
Definition: ERF_WSM6.H:148
static constexpr amrex::Real bvtr
Definition: ERF_WSM6.H:141
real(kind=kind_phys), save pvtr
Definition: ERF_module_mp_wdm6.F90:100
real(kind=kind_phys), save rsloper2max
Definition: ERF_module_mp_wdm6.F90:100
real(kind=kind_phys), save rsloperbmax
Definition: ERF_module_mp_wdm6.F90:100
real(kind=kind_phys), save rsloper3max
Definition: ERF_module_mp_wdm6.F90:100
real(kind=kind_phys), save rslopermax
Definition: ERF_module_mp_wdm6.F90:100
real(kind=kind_phys), save pidn0r
Definition: ERF_module_mp_wdm6.F90:100

Referenced by WSM6::Advance().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wsm6_slope_graup_cell()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void wsm6_slope_graup_cell ( Real  qg,
Real  den,
Real  denfac,
Real  pidn0g_arg,
Real  qcrmin_arg,
Real  rslopegmax_arg,
Real  rslopegbmax_arg,
Real  rslopeg2max_arg,
Real  rslopeg3max_arg,
Real  bvtg_arg,
Real  pvtg_arg,
Real rslope,
Real rslopeb,
Real rslope2,
Real rslope3,
Real vt 
)
209 {
210  if (qg <= qcrmin_arg) {
211  rslope = rslopegmax_arg;
212  rslopeb = rslopegbmax_arg;
213  rslope2 = rslopeg2max_arg;
214  rslope3 = rslopeg3max_arg;
215  } else {
216  rslope = Real(1.0)/wsm6_lamdag(qg,den,pidn0g_arg);
217  rslopeb = std::pow(rslope,bvtg_arg);
218  rslope2 = rslope*rslope;
219  rslope3 = rslope2*rslope;
220  }
221  vt = pvtg_arg*rslopeb*denfac;
222  if (qg <= Real(0.0)) vt = Real(0.0);
223 }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real wsm6_lamdag(Real x, Real y, Real pidn0g_arg)
Definition: ERF_AdvanceWSM6.cpp:89
@ qg
Definition: ERF_WDM6.H:31

Referenced by WSM6::Advance(), and wsm6_nislfv_rain_plm6_scratch().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wsm6_slope_rain_cell()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void wsm6_slope_rain_cell ( Real  qr,
Real  den,
Real  denfac,
Real  pidn0r_arg,
Real  qcrmin_arg,
Real  rslopermax_arg,
Real  rsloperbmax_arg,
Real  rsloper2max_arg,
Real  rsloper3max_arg,
Real  bvtr_arg,
Real  pvtr_arg,
Real rslope,
Real rslopeb,
Real rslope2,
Real rslope3,
Real vt 
)
155 {
156  if (qr <= qcrmin_arg) {
157  rslope = rslopermax_arg;
158  rslopeb = rsloperbmax_arg;
159  rslope2 = rsloper2max_arg;
160  rslope3 = rsloper3max_arg;
161  } else {
162  rslope = Real(1.0)/wsm6_lamdar(qr,den,pidn0r_arg);
163  rslopeb = std::pow(rslope,bvtr_arg);
164  rslope2 = rslope*rslope;
165  rslope3 = rslope2*rslope;
166  }
167  vt = pvtr_arg*rslopeb*denfac;
168  if (qr <= Real(0.0)) vt = Real(0.0);
169 }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real wsm6_lamdar(Real x, Real y, Real pidn0r_arg)
Definition: ERF_AdvanceWSM6.cpp:79

Referenced by WSM6::Advance(), and wsm6_nislfv_rain_plm_scratch().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wsm6_slope_snow_cell()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void wsm6_slope_snow_cell ( Real  qs,
Real  den,
Real  denfac,
Real  t,
Real  pidn0s_arg,
Real  alpha_arg,
Real  n0smax_arg,
Real  n0s_arg,
Real  t0c_arg,
Real  qcrmin_arg,
Real  rslopesmax_arg,
Real  rslopesbmax_arg,
Real  rslopes2max_arg,
Real  rslopes3max_arg,
Real  bvts_arg,
Real  pvts_arg,
Real rslope,
Real rslopeb,
Real rslope2,
Real rslope3,
Real vt,
Real n0sfac 
)
182 {
183  Real supcol = t0c_arg - t;
184  n0sfac = amrex::max(amrex::min(std::exp(alpha_arg*supcol),
185  n0smax_arg/n0s_arg), Real(1.0));
186  if (qs <= qcrmin_arg) {
187  rslope = rslopesmax_arg;
188  rslopeb = rslopesbmax_arg;
189  rslope2 = rslopes2max_arg;
190  rslope3 = rslopes3max_arg;
191  } else {
192  rslope = Real(1.0)/wsm6_lamdas(qs,den,n0sfac,pidn0s_arg);
193  rslopeb = std::pow(rslope,bvts_arg);
194  rslope2 = rslope*rslope;
195  rslope3 = rslope2*rslope;
196  }
197  vt = pvts_arg*rslopeb*denfac;
198  if (qs <= Real(0.0)) vt = Real(0.0);
199 }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real wsm6_lamdas(Real x, Real y, Real z, Real pidn0s_arg)
Definition: ERF_AdvanceWSM6.cpp:84
@ qs
Definition: ERF_WDM6.H:30
@ n0sfac
Definition: ERF_WSM6.H:333
@ t
Definition: ERF_WSM6.H:272

Referenced by WSM6::Advance(), and wsm6_nislfv_rain_plm6_scratch().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wsm6_venfac()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real wsm6_venfac ( Real  a,
Real  b,
Real  c,
Real  den0_arg 
)
58  {
59  return std::exp(std::log(wsm6_viscos(b,c)/wsm6_diffus(b,a))
60  *Real(0.3333333))
61  /std::sqrt(wsm6_viscos(b,c))
62  *std::sqrt(std::sqrt(den0_arg/c));
63 }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real wsm6_viscos(Real x, Real y)
Definition: ERF_AdvanceWSM6.cpp:41

Referenced by WSM6::Advance().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wsm6_viscos()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real wsm6_viscos ( Real  x,
Real  y 
)
41  {
42  return Real(1.496e-6)*(x*std::sqrt(x))/(x+Real(120.0))/y;
43 }

Referenced by wsm6_venfac(), and wsm6_xka().

Here is the caller graph for this function:

◆ wsm6_xka()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real wsm6_xka ( Real  x,
Real  y 
)
46  {
47  return Real(1.414e3)*wsm6_viscos(x,y)*y;
48 }

Referenced by WSM6::Advance(), and wsm6_diffac().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wsm6_xlcal()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real wsm6_xlcal ( Real  x,
Real  xlv0_arg,
Real  xlv1_arg,
Real  t0c_arg 
)
31  {
32  return xlv0_arg - xlv1_arg*(x - t0c_arg);
33 }

Referenced by WSM6::Advance().

Here is the caller graph for this function: