19 using namespace amrex;
20 using yakl::intrinsics::size;
21 using yakl::fortran::parallel_for;
22 using yakl::fortran::SimpleBounds;
26 const real2d& ni,
const real2d& qs,
const real2d& ns,
27 const real2d& cld,
const real2d&
pres,
const real2d& tk,
28 const real2d& effl,
const real2d& effi,
29 const real2d& deffi,
const real2d& lamcrad,
30 const real2d& pgamrad,
const real2d& des)
33 const real pi = 3.1415926535897932384626434;
34 const real qsmall = 1.0e-14;
35 const real rhow = 997.;
36 const real rhoi = 500.;
37 const real dcs = 125.e-6;
38 const real ci = rhoi*pi/6.;
42 const real
rhos = 100.;
43 const real cs =
rhos*pi/6.;
45 const real mincld = 0.0001;
47 int ncol =
pres.extent(0);
48 int nlev =
pres.extent(1);
50 parallel_for (SimpleBounds<2> (ncol, nlev), YAKL_LAMBDA (
int i,
int j)
52 auto rho =
pres(i,j)/(287.15*tk(i,j));
53 auto cldm = std::max(cld(i,j), mincld);
54 auto qlic = std::min(5.e-3, std::max(0., ql(i,j)/cldm));
55 auto qiic = std::min(5.e-3, std::max(0., qi(i,j)/cldm));
56 auto nlic = std::max(nl(i,j), 0.)/cldm;
57 auto niic = std::max(ni(i,j), 0.)/cldm;
60 if(qs(i,j) > 1.0e-7) {
61 auto lammaxs=1./10.e-6;
62 auto lammins=1./2000.e-6;
63 auto lams = std::pow((std::tgamma(1.+ds)*cs*ns(i,j)/qs(i,j)), (1./ds));
64 lams = std::min(lammaxs, std::max(lams,lammins));
73 des(i,j) = res*
rhos/917.*2.;
76 if( qiic >= qsmall ) {
77 niic = std::min(niic, qiic*1.e20);
78 auto lammax = 1./1.e-6;
79 auto lammin = 1./(2.*dcs+100.e-6);
80 auto lami = std::pow((std::tgamma(1.+di)*ci*niic/qiic), (1./di));
81 lami = std::min(lammax, std::max(lami, lammin));
82 effi(i,j) = 1.5/lami*1.e6;
91 deffi(i,j) = effi(i,j)*rhoi/917.*2.;
94 if( qlic >= qsmall ) {
97 nlic = std::min(nlic, qlic*1.e20);
104 auto pgam = 0.0005714*(nlic*
rho/1.e6) + 0.2714;
105 pgam = 1./std::pow(pgam, 2.0)-1.;
106 pgam = std::min(10., std::max(pgam,2.));
107 auto laml = std::pow((pi/6.*rhow*nlic*std::tgamma(pgam+4.)/(qlic*std::tgamma(pgam+1.))), (1./3.));
108 auto lammin = (pgam+1.)/50.e-6;
109 auto lammax = (pgam+1.)/2.e-6;
113 laml = std::min(std::max(laml, lammin),lammax);
114 effl(i,j) = std::tgamma(pgam+4.)/std::tgamma(pgam+3.)/laml/2.*1.e6;
constexpr amrex::Real rhos
Definition: ERF_Constants.H:29
YAKL_INLINE void m2005_effradius(const real2d &ql, const real2d &nl, const real2d &qi, const real2d &ni, const real2d &qs, const real2d &ns, const real2d &cld, const real2d &pres, const real2d &tk, const real2d &effl, const real2d &effi, const real2d &deffi, const real2d &lamcrad, const real2d &pgamrad, const real2d &des)
Definition: ERF_m2005_effradius.H:25
@ pres
Definition: ERF_Kessler.H:33
@ rho
Definition: ERF_Kessler.H:30
Definition: ERF_console_io.cpp:12