61 int1d trop_level(
"trop_level",
ncol);
65 real2d mmr_to_mass(
"mmr_to_mass",
ncol,
nlev);
66 parallel_for(SimpleBounds<2>(
ncol,
nlev) , YAKL_LAMBDA (
int icol,
int ilev)
68 mmr_to_mass(icol,ilev) =
rga *
pdeldry(icol,ilev);
72 yakl::memset(tau , -100.);
73 yakl::memset(tau_w , -100.);
74 yakl::memset(tau_w_g, -100.);
75 yakl::memset(tau_w_f, -100.);
76 yakl::memset(ext_cmip6_sw_inv_m, 1.0e-3);
80 parallel_for(SimpleBounds<2>(
ncol,
nswbands) , YAKL_LAMBDA (
int icol,
int isw)
82 tau (icol,1,isw) = 0.;
83 tau_w (icol,1,isw) = 0.;
84 tau_w_g(icol,1,isw) = 0.;
85 tau_w_f(icol,1,isw) = 0.;
92 parallel_for(SimpleBounds<2>(
ncol,
nlev), YAKL_LAMBDA (
int icol,
int ilev)
94 real es, qs, rh, rhtrunc;
96 rh =
qt(icol,ilev)/qs;
97 rhtrunc = std::min(rh,1.);
98 krh(icol, ilev) = std::min(std::floor(rhtrunc*
nrh )+1.,
nrh - 1.);
99 wrh(icol, ilev) = rhtrunc*
nrh-krh(icol, ilev);
107 yakl::memset(trop_level, 10000);
115 parallel_for(SimpleBounds<3>(
ncol,
nlev,
nswbands), YAKL_LAMBDA (
int icol,
int ilev,
int isw)
117 ext_cmip6_sw_inv_m(icol, ilev, isw) = 1.0e-3;
124 real1d strop(
"strop",1);
125 parallel_for(SimpleBounds<1>(
ncol), YAKL_LAMBDA (
int i)
129 for (
auto k =
nlev-1; k > 0; --k) {
130 real stobie = 0.03 *
temp(i,k) - std::log10(
pmid(i, k));
131 if (
pmid(i, k) <= 4000.)
break;
132 if (
pmid(i, k) >= 55000.)
continue;
133 if ((tlev == -1) || (stobie < strop(1))) {
138 if (tlev != -1) trop_level(i) = tlev;
142 if (yakl::intrinsics::any(yakl::componentwise::operator==(trop_level, -1))) {
143 amrex::Print() <<
"aer_rad_props.F90: subr aer_rad_props_sw: tropopause not found\n";
154 real2d ext_cmip6_sw_2d(
"ext_cmip6_sw",
ncol,
nlev);
155 parallel_for(SimpleBounds<3>(
ncol,
nlev,
nswbands), YAKL_LAMBDA (
int icol,
int ilev,
int isw)
162 trop_level, tau, tau_w, tau_w_g, tau_w_f, clear_rh);
164 yakl::memset(tau, 0.);
165 yakl::memset(tau_w, 0.);
166 yakl::memset(tau_w_g, 0.);
167 yakl::memset(tau_w_f, 0.);
174 tau, tau_w, tau_w_g, tau_w_f);
178 for (
auto iaero = 0; iaero <
num_aeroes; ++iaero) {
180 real2d aermmr(
"aermmr",
ncol,
nlev);
181 real2d aermass(
"aermass",
ncol,
nlev);
183 yakl::memset(aermmr, 1.0e-2);
186 parallel_for(SimpleBounds<2>(
ncol,
nlev), YAKL_LAMBDA (
int icol,
int ilev)
189 aermass(icol,ilev) = 0.;
191 aermass(icol,ilev) = aermmr(icol,ilev) * mmr_to_mass(icol,ilev);
195 std::string opticstype;
205 if (opticstype ==
"hygro") {
214 get_hygro_rad_props(
ncol, krh, wrh, aermass, h_ext, h_ssa, h_asm, ta, tw, twg, twf);
215 parallel_for(SimpleBounds<3>(
ncol,
nlev,
nswbands), YAKL_LAMBDA (
int icol,
int ilev,
int isw)
217 tau (icol,ilev,isw) = tau (icol,ilev,isw) + ta (icol,ilev,isw);
218 tau_w (icol,ilev,isw) = tau_w (icol,ilev,isw) + tw (icol,ilev,isw);
219 tau_w_g(icol,ilev,isw) = tau_w_g(icol,ilev,isw) + twg(icol,ilev,isw);
220 tau_w_f(icol,ilev,isw) = tau_w_f(icol,ilev,isw) + twf(icol,ilev,isw);
222 }
else if (opticstype ==
"nonhygro") {
225 real1d n_ext(
"n_ext",
ncol);
226 real1d n_ssa(
"n_ssa",
ncol);
227 real1d n_asm(
"n_asm",
ncol);
232 parallel_for(SimpleBounds<3>(
ncol,
nlev,
nswbands), YAKL_LAMBDA (
int icol,
int ilev,
int isw)
234 tau (icol,ilev,isw) = tau (icol,ilev,isw) + ta (icol,ilev,isw);
235 tau_w (icol,ilev,isw) = tau_w (icol,ilev,isw) + tw (icol,ilev,isw);
236 tau_w_g(icol,ilev,isw) = tau_w_g(icol,ilev,isw) + twg(icol,ilev,isw);
237 tau_w_f(icol,ilev,isw) = tau_w_f(icol,ilev,isw) + twf(icol,ilev,isw);
239 }
else if (opticstype ==
"volcanic") {
241 real1d n_ext(
"n_ext",
ncol);
242 real1d n_scat(
"n_scat",
ncol);
243 real1d n_ascat(
"n_ascat",
ncol);
248 parallel_for(SimpleBounds<3>(
ncol,
nlev,
nswbands), YAKL_LAMBDA (
int icol,
int ilev,
int isw)
250 tau (icol,ilev,isw) = tau (icol,ilev,isw) + ta (icol,ilev,isw);
251 tau_w (icol,ilev,isw) = tau_w (icol,ilev,isw) + tw (icol,ilev,isw);
252 tau_w_g(icol,ilev,isw) = tau_w_g(icol,ilev,isw) + twg(icol,ilev,isw);
253 tau_w_f(icol,ilev,isw) = tau_w_f(icol,ilev,isw) + twf(icol,ilev,isw);
255 }
else if (opticstype ==
"volcanic_radius") {
259 real2d r_ascat(
"r_ascat",
ncol,
nlev);
260 real1d r_mu(
"r_mu",
ncol);
276 parallel_for(SimpleBounds<3>(
ncol,
nlev,
nswbands), YAKL_LAMBDA (
int icol,
int ilev,
int isw)
278 tau (icol,ilev,isw) = tau (icol,ilev,isw) + ta (icol,ilev,isw);
279 tau_w (icol,ilev,isw) = tau_w (icol,ilev,isw) + tw (icol,ilev,isw);
280 tau_w_g(icol,ilev,isw) = tau_w_g(icol,ilev,isw) + twg(icol,ilev,isw);
281 tau_w_f(icol,ilev,isw) = tau_w_f(icol,ilev,isw) + twf(icol,ilev,isw);
284 amrex::Print() <<
"aer_rad_props_sw: unsupported opticstype\n";
real3d ssa_cmip6_sw
Definition: ERF_AeroRadProps.H:133
void get_volcanic_radius_rad_props(const int &ncol, const real2d &mass, const real2d &r_ext, const real2d &r_scat, const real2d &r_ascat, const real1d &r_mu, const real3d &tau, const real3d &tau_w, const real3d &tau_w_g, const real3d &tau_w_f)
Definition: ERF_AeroRadProps.cpp:560
void get_hygro_rad_props(const int &ncol, const int2d &krh, const real2d &wrh, const real2d &mass, const real2d &ext, const real2d &ssa, const real2d &assm, const real3d &tau, const real3d &tau_w, const real3d &tau_w_g, const real3d &tau_w_f)
Definition: ERF_AeroRadProps.cpp:513
void get_volcanic_rad_props(const int &ncol, const real2d &mass, const real1d &ext, const real1d &scat, const real1d &ascat, const real3d &tau, const real3d &tau_w, const real3d &tau_w_g, const real3d &tau_w_f)
Definition: ERF_AeroRadProps.cpp:681
void volcanic_cmip_sw(const int1d &trop_level, const real2d &zi, const real3d &ext_cmip6_sw_inv_m, const real3d &ssa_cmip6_sw, const real3d &af_cmip6_sw, const real3d &tau, const real3d &tau_w, const real3d &tau_w_g, const real3d &tau_w_f)
Definition: ERF_AeroRadProps.cpp:624
int nswbands
Definition: ERF_AeroRadProps.H:115
int ngas
Definition: ERF_AeroRadProps.H:112
int num_aeroes
Definition: ERF_AeroRadProps.H:112
void get_nonhygro_rad_props(const int &ncol, const real2d &mass, const real1d &ext, const real1d &ssa, const real1d &assm, const real3d &tau, const real3d &tau_w, const real3d &tau_w_g, const real3d &tau_w_f)
Definition: ERF_AeroRadProps.cpp:538
real3d af_cmip6_sw
Definition: ERF_AeroRadProps.H:133
void modal_aero_sw(int list_idx, real dt, int nnite, const int1d &idxnite, const bool &is_cmip6_volc, const real2d &pdeldry, const real2d &pmid, const real2d &temperature, const real2d &qt, const real2d &ext_cmip6_sw, const int1d &trop_level, const real3d &tauxar, const real3d &wa, const real3d &ga, const real3d &fa, const real2d &clear_rh)
Definition: ERF_Mam4Aero.H:321
void get_aer_r_sw_scat(int list_idx, int aer_idx, real2d &r_sw_scat) const
Definition: ERF_Mam4Constitutents.H:1121
void get_aer_r_sw_ascat(int list_idx, int aer_idx, real2d &r_sw_ascat) const
Definition: ERF_Mam4Constitutents.H:1130
void get_aer_sw_nonhygro_scat(int list_idx, int aer_idx, real1d &sw_nonhygro_scat) const
Definition: ERF_Mam4Constitutents.H:1061
void get_aer_r_sw_ext(int list_idx, int aer_idx, real2d &r_sw_ext) const
Definition: ERF_Mam4Constitutents.H:1112
void get_aer_sw_nonhygro_ext(int list_idx, int aer_idx, real1d &sw_nonhygro_ext) const
Definition: ERF_Mam4Constitutents.H:1034
void get_aer_sw_nonhygro_asm(int list_idx, int aer_idx, real1d &sw_nonhygro_asm) const
Definition: ERF_Mam4Constitutents.H:1052
void get_aer_sw_nonhygro_ascat(int list_idx, int aer_idx, real1d &sw_nonhygro_ascat) const
Definition: ERF_Mam4Constitutents.H:1070
void get_ngas(int list_idx, int &ngas) const
Definition: ERF_Mam4Constitutents.H:356
void get_aer_sw_hygro_asm(int list_idx, int aer_idx, real2d &sw_hygro_asm) const
Definition: ERF_Mam4Constitutents.H:1016
void get_aer_sw_hygro_ssa(int list_idx, int aer_idx, real2d &sw_hygro_ssa) const
Definition: ERF_Mam4Constitutents.H:1007
void get_aer_sw_nonhygro_ssa(int list_idx, int aer_idx, real1d &sw_nonhygro_ssa) const
Definition: ERF_Mam4Constitutents.H:1043
void get_aer_sw_hygro_ext(int list_idx, int aer_idx, real2d &sw_hygro_ext) const
Definition: ERF_Mam4Constitutents.H:998
static constexpr int idx_sw_diag
Definition: ERF_RadConstants.H:60