2 #ifndef ERF_EBERT_CURRY_H_
3 #define ERF_EBERT_CURRY_H_
4 using yakl::fortran::parallel_for;
5 using yakl::fortran::SimpleBounds;
12 const real2d& cldn,
const real2d& cicewp,
const real2d& rei,
13 const real3d& ice_tau,
const real3d& ice_tau_w,
14 const real3d& ice_tau_w_g,
const real3d& ice_tau_w_f)
16 real1d wavmin(
"wavmin", nswbands);
17 real1d wavmax(
"wavmax", nswbands);
20 real1d abari(
"abari", 4);
21 real1d bbari(
"bbari", 4);
22 real1d cbari(
"cbari", 4);
23 real1d dbari(
"dbari", 4);
24 real1d ebari(
"ebari", 4);
25 real1d fbari(
"fbari", 4);
27 parallel_for(SimpleBounds<1>(1), YAKL_LAMBDA (
int i)
57 constexpr real cldmin = 1.0e-80;
61 constexpr real cldeps = 0.0;
65 constexpr real rei_min = 13.;
66 constexpr real rei_max = 130.;
73 for (
auto ns=0; ns<nswbands; ++ns) {
74 if(wavmax(ns) <= 0.7) {
76 }
else if(wavmax(ns) <= 1.25) {
78 }
else if(wavmax(ns) <= 2.38) {
80 }
else if(wavmax(ns) > 2.38) {
83 parallel_for(SimpleBounds<2>(nlev, ncol), YAKL_LAMBDA (
int k,
int i)
85 real tmp1i, tmp2i, tmp3i, g;
86 auto abarii = abari(indxsl);
87 auto bbarii = bbari(indxsl);
88 auto cbarii = cbari(indxsl);
89 auto dbarii = dbari(indxsl);
90 auto ebarii = ebari(indxsl);
91 auto fbarii = fbari(indxsl);
95 if (cldn(i,k) >= cldmin && cldn(i,k) >= cldeps) {
96 tmp1i = abarii + bbarii/std::max(rei_min,std::min(
scalefactor*rei(i,k),rei_max));
97 ice_tau(ns,i,k) = 1000. * cicewp(i,k) * tmp1i;
99 ice_tau(ns,i,k) = 0.0;
102 tmp2i = 1. - cbarii - dbarii*std::min(std::max(rei_min,
scalefactor*rei(i,k)),rei_max);
103 tmp3i = fbarii*std::min(std::max(rei_min,
scalefactor*rei(i,k)),rei_max);
107 ice_tau_w(ns,i,k) = ice_tau(ns,i,k) * std::min(tmp2i,.999999);
109 ice_tau_w_g(ns,i,k) = ice_tau_w(ns,i,k) * g;
110 ice_tau_w_f(ns,i,k) = ice_tau_w(ns,i,k) * g * g;
117 const real2d& cldn,
const real2d& iclwpth,
118 const real2d& iciwpth,
const real2d& rei,
const real3d& abs_od)
120 real2d ficemr(
"ficemr",ncol,nlev);
121 real2d cwp(
"cwp",ncol,nlev);
122 real2d cldtau(
"cldtau",ncol,nlev);
129 const real rei_min = 13.;
130 const real rei_max = 130.;
132 parallel_for(SimpleBounds<2>(nlev, ncol), YAKL_LAMBDA (
int k,
int i)
134 cwp(i,k) = 1000.0 *iciwpth(i,k) + 1000.0 *iclwpth(i,k);
135 ficemr(i,k) = 1000.0*iciwpth(i,k)/(std::max(1.e-18,cwp(i,k)));
138 parallel_for(SimpleBounds<2>(nlev, ncol), YAKL_LAMBDA (
int k,
int i)
145 auto kabsi = 0.005 + 1./std::min(std::max(rei_min,
scalefactor*rei(i,k)),rei_max);
146 auto kabs = kabsi*ficemr(i,k);
147 cldtau(i,k) = kabs*cwp(i,k);
150 parallel_for(SimpleBounds<3>(nlwbands, ncol, nlev), YAKL_LAMBDA (
int lwband,
int icol,
int ilev)
152 abs_od(lwband,icol,ilev)=cldtau(icol,ilev);
Definition: ERF_EbertCurry.H:7
static constexpr real scalefactor
Definition: ERF_EbertCurry.H:9
static void ec_ice_optics_lw(int ncol, int nlev, int nlwbands, const real2d &cldn, const real2d &iclwpth, const real2d &iciwpth, const real2d &rei, const real3d &abs_od)
Definition: ERF_EbertCurry.H:116
static void ec_ice_optics_sw(int ncol, int nlev, int nswbands, const real2d &cldn, const real2d &cicewp, const real2d &rei, const real3d &ice_tau, const real3d &ice_tau_w, const real3d &ice_tau_w_g, const real3d &ice_tau_w_f)
Definition: ERF_EbertCurry.H:11
@ micrometer
Definition: ERF_RadConstants.H:109
static void get_sw_spectral_boundaries(real1d &low_boundaries, real1d &high_boundaries, Units units)
Definition: ERF_RadConstants.H:205