7 using yakl::fortran::parallel_for;
8 using yakl::fortran::SimpleBounds;
13 const real2d& cldn,
const real2d& cliqwp,
const real2d& rel,
14 const real3d& liq_tau,
const real3d& liq_tau_w,
15 const real3d& liq_tau_w_g,
const real3d& liq_tau_w_f)
17 real1d wavmin(
"wavmin", nswbands);
18 real1d wavmax(
"wavmax", nswbands);
22 const real cldmin = 1.0e-80;
26 const real cldeps = 0.0;
31 real1d abarl(
"abarl", 4);
32 real1d bbarl(
"bbarl", 4);
33 real1d cbarl(
"cbarl", 4);
34 real1d dbarl(
"dbarl", 4);
35 real1d ebarl(
"ebarl", 4);
36 real1d fbarl(
"fbarl", 4);
37 parallel_for(SimpleBounds<1>(1), YAKL_LAMBDA (
int i)
68 const real rel_min = 4.2;
69 const real rel_max = 16.;
75 for (
auto ns=0; ns<nswbands; ++ns) {
82 if(wavmax(ns) <= 0.7) {
84 }
else if(wavmax(ns) <= 1.25) {
86 }
else if(wavmax(ns) <= 2.38) {
88 }
else if(wavmax(ns) > 2.38) {
94 parallel_for(SimpleBounds<2>(nlev, ncol), YAKL_LAMBDA (
int k,
int i)
96 auto abarli = abarl(indxsl);
97 auto bbarli = bbarl(indxsl);
98 auto cbarli = cbarl(indxsl);
99 auto dbarli = dbarl(indxsl);
100 auto ebarli = ebarl(indxsl);
101 auto fbarli = fbarl(indxsl);
102 real tmp1l, tmp2l, tmp3l, g;
106 if (cldn(i,k) >= cldmin && cldn(i,k) >= cldeps) {
107 tmp1l = abarli + bbarli/std::min(std::max(rel_min,rel(i,k)),rel_max);
108 liq_tau(ns,i,k) = 1000.*cliqwp(i,k)*tmp1l;
110 liq_tau(ns,i,k) = 0.0;
113 tmp2l = 1. - cbarli - dbarli*std::min(std::max(rel_min,rel(i,k)),rel_max);
114 tmp3l = fbarli*std::min(std::max(rel_min,rel(i,k)),rel_max);
118 liq_tau_w(ns,i,k) = liq_tau(ns,i,k) * std::min(tmp2l,.999999);
120 liq_tau_w_g(ns,i,k) = liq_tau_w(ns,i,k) * g;
121 liq_tau_w_f(ns,i,k) = liq_tau_w(ns,i,k) * g * g;
127 const real2d& iclwpth,
const real2d& iciwpth,
const real3d& abs_od)
129 real2d ficemr(
"ficemr", ncol, nlev);
130 real2d cwp(
"cwp", ncol, nlev);
131 real2d cldtau(
"cldtau", ncol, nlev);
133 parallel_for(SimpleBounds<2>(nlev, ncol), YAKL_LAMBDA (
int k,
int i)
135 cwp (i,k) = 1000.0 * iclwpth(i,k) + 1000.0 * iciwpth(i, k);
136 ficemr(i,k) = 1000.0 * iciwpth(i,k)/(std::max(1.e-18, cwp(i,k)));
139 parallel_for(SimpleBounds<2>(nlev, ncol), YAKL_LAMBDA (
int k,
int i)
146 real kabsl = 0.090361;
147 auto kabs = kabsl*(1.-ficemr(i,k));
148 cldtau(i,k) = kabs*cwp(i,k);
151 parallel_for(SimpleBounds<3>(nlwbands, ncol, nlev), YAKL_LAMBDA (
int lwband,
int icol,
int ilev)
153 abs_od(lwband,icol,ilev) = cldtau(icol,ilev);
@ micrometer
Definition: ERF_Rad_constants.H:109
static void get_sw_spectral_boundaries(real1d &low_boundaries, real1d &high_boundaries, Units units)
Definition: ERF_Rad_constants.H:205
Definition: ERF_Slingo.H:10
static void slingo_liq_optics_sw(int ncol, int nlev, int nswbands, const real2d &cldn, const real2d &cliqwp, const real2d &rel, const real3d &liq_tau, const real3d &liq_tau_w, const real3d &liq_tau_w_g, const real3d &liq_tau_w_f)
Definition: ERF_Slingo.H:12
static void slingo_liq_optics_lw(int ncol, int nlev, int nlwbands, const real2d &cldn, const real2d &iclwpth, const real2d &iciwpth, const real3d &abs_od)
Definition: ERF_Slingo.H:126