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 <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 
)
65  {
66  return (amrex::max(b,qmin_arg)-c)
67  /(Real(1.0)+d*d/(rv_arg*e)*c/(a*a));
68 }
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 
)
23  {
24  return cpd_arg*(Real(1.0)-amrex::max(x,qmin_arg))
25  +amrex::max(x,qmin_arg)*cpv_arg;
26 }

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 
)
50  {
51  return d*a*a/(wsm6_xka(c,d)*rv_arg*c*c)
52  +Real(1.0)/(e*wsm6_diffus(c,b));
53 }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real wsm6_xka(Real x, Real y)
Definition: ERF_AdvanceWSM6.cpp:44
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real wsm6_diffus(Real x, Real y)
Definition: ERF_AdvanceWSM6.cpp:34

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 
)
34  {
35  return Real(8.794e-5)*std::exp(std::log(x)*Real(1.81))/y;
36 }

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 
)
87  {
88  return std::sqrt(std::sqrt(pidn0g_arg/(x*y)));
89 }

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 
)
77  {
78  return std::sqrt(std::sqrt(pidn0r_arg/(x*y)));
79 }

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 
)
82  {
83  return std::sqrt(std::sqrt(pidn0s_arg*z/(x*y)));
84 }

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

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

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 
)
207 {
208  if (qg <= qcrmin_arg) {
209  rslope = rslopegmax_arg;
210  rslopeb = rslopegbmax_arg;
211  rslope2 = rslopeg2max_arg;
212  rslope3 = rslopeg3max_arg;
213  } else {
214  rslope = Real(1.0)/wsm6_lamdag(qg,den,pidn0g_arg);
215  rslopeb = std::pow(rslope,bvtg_arg);
216  rslope2 = rslope*rslope;
217  rslope3 = rslope2*rslope;
218  }
219  vt = pvtg_arg*rslopeb*denfac;
220  if (qg <= Real(0.0)) vt = Real(0.0);
221 }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real wsm6_lamdag(Real x, Real y, Real pidn0g_arg)
Definition: ERF_AdvanceWSM6.cpp:87
@ qg
Definition: ERF_WSM6.H:29

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 
)
153 {
154  if (qr <= qcrmin_arg) {
155  rslope = rslopermax_arg;
156  rslopeb = rsloperbmax_arg;
157  rslope2 = rsloper2max_arg;
158  rslope3 = rsloper3max_arg;
159  } else {
160  rslope = Real(1.0)/wsm6_lamdar(qr,den,pidn0r_arg);
161  rslopeb = std::pow(rslope,bvtr_arg);
162  rslope2 = rslope*rslope;
163  rslope3 = rslope2*rslope;
164  }
165  vt = pvtr_arg*rslopeb*denfac;
166  if (qr <= Real(0.0)) vt = Real(0.0);
167 }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real wsm6_lamdar(Real x, Real y, Real pidn0r_arg)
Definition: ERF_AdvanceWSM6.cpp:77

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 
)
180 {
181  Real supcol = t0c_arg - t;
182  n0sfac = amrex::max(amrex::min(std::exp(alpha_arg*supcol),
183  n0smax_arg/n0s_arg), Real(1.0));
184  if (qs <= qcrmin_arg) {
185  rslope = rslopesmax_arg;
186  rslopeb = rslopesbmax_arg;
187  rslope2 = rslopes2max_arg;
188  rslope3 = rslopes3max_arg;
189  } else {
190  rslope = Real(1.0)/wsm6_lamdas(qs,den,n0sfac,pidn0s_arg);
191  rslopeb = std::pow(rslope,bvts_arg);
192  rslope2 = rslope*rslope;
193  rslope3 = rslope2*rslope;
194  }
195  vt = pvts_arg*rslopeb*denfac;
196  if (qs <= Real(0.0)) vt = Real(0.0);
197 }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real wsm6_lamdas(Real x, Real y, Real z, Real pidn0s_arg)
Definition: ERF_AdvanceWSM6.cpp:82
@ qs
Definition: ERF_WSM6.H:28
@ n0sfac
Definition: ERF_WSM6.H:229
@ t
Definition: ERF_WSM6.H:168

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 
)
56  {
57  return std::exp(std::log(wsm6_viscos(b,c)/wsm6_diffus(b,a))
58  *Real(0.3333333))
59  /std::sqrt(wsm6_viscos(b,c))
60  *std::sqrt(std::sqrt(den0_arg/c));
61 }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real wsm6_viscos(Real x, Real y)
Definition: ERF_AdvanceWSM6.cpp:39

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 
)
39  {
40  return Real(1.496e-6)*(x*std::sqrt(x))/(x+Real(120.0))/y;
41 }

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 
)
44  {
45  return Real(1.414e3)*wsm6_viscos(x,y)*y;
46 }

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 
)
29  {
30  return xlv0_arg - xlv1_arg*(x - t0c_arg);
31 }

Referenced by WSM6::Advance().

Here is the caller graph for this function: