1 #ifndef ERF_IBSEB_SOLAR_H
2 #define ERF_IBSEB_SOLAR_H
4 #include <AMReX_REAL.H>
5 #include <AMReX_GpuQualifiers.H>
6 #include <AMReX_Algorithm.H>
7 #include <AMReX_Array4.H>
43 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
46 return 2.0 *
PI * (day_of_year - 1.0) / 365.0;
54 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
57 return day0 + std::floor(t_utc_s / 86400.0);
61 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
66 - 0.399912 * std::cos(
gamma) + 0.070257 * std::sin(
gamma)
67 - 0.006758 * std::cos(2.0 *
gamma) + 0.000907 * std::sin(2.0 *
gamma)
68 - 0.002697 * std::cos(3.0 *
gamma) + 0.00148 * std::sin(3.0 *
gamma);
72 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
76 return 229.18 * (0.000075 + 0.001868 * std::cos(
gamma) - 0.032077 * std::sin(
gamma)
77 - 0.014615 * std::cos(2.0 *
gamma) - 0.040849 * std::sin(2.0 *
gamma));
86 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
87 amrex::Real
solar_hour_angle (amrex::Real time_utc_s, amrex::Real longitude_deg, amrex::Real day_of_year)
89 amrex::Real t_utc_h = std::fmod(time_utc_s / 3600.0, 24.0);
90 if (t_utc_h < 0.0) { t_utc_h += 24.0; }
91 const amrex::Real t_solar_h = t_utc_h + longitude_deg / 15.0 +
equation_of_time(day_of_year) / 60.0;
92 return 15.0 * (t_solar_h - 12.0) *
PI / 180.0;
104 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
107 const double two_pi = 2.0 * double(
PI);
108 double h = two_pi * (calday - std::floor(calday)) +
double(longitude_rad) - double(
PI);
109 h = std::fmod(h +
double(
PI), two_pi);
110 if (h < 0.0) { h += two_pi; }
111 return static_cast<amrex::Real
>(h - double(
PI));
115 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
116 amrex::Real
solar_zenith (amrex::Real latitude_deg, amrex::Real decl, amrex::Real hour_angle)
118 const amrex::Real lat = latitude_deg *
PI / 180.0;
119 amrex::Real cz = std::sin(lat) * std::sin(decl) + std::cos(lat) * std::cos(decl) * std::cos(hour_angle);
120 if (cz < -1.0) { cz = -1.0; }
121 if (cz > 1.0) { cz = 1.0; }
122 return std::acos(cz);
130 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
132 amrex::Real hour_angle, amrex::Real zenith)
134 const amrex::Real lat = latitude_deg *
PI / 180.0;
135 const amrex::Real sz = std::sin(zenith);
136 const amrex::Real cz = std::cos(zenith);
137 if (sz < 1.0e-6) {
return 0.0; }
138 const amrex::Real cos_lat = std::cos(lat);
139 if (std::abs(cos_lat) < 1.0e-6) {
return 0.0; }
142 const amrex::Real sin_az = -std::sin(hour_angle) * std::cos(decl) / sz;
143 const amrex::Real cos_az = (std::sin(decl) - cz * std::sin(lat)) / (sz * cos_lat);
144 amrex::Real az = std::atan2(sin_az, cos_az);
145 if (az < 0.0) { az += 2.0 *
PI; }
154 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
158 return 1.000110 + 0.034221 * std::cos(G) + 0.001280 * std::sin(G)
159 + 0.000719 * std::cos(2.0 * G) + 0.000077 * std::sin(2.0 * G);
163 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
165 amrex::Real& sx, amrex::Real& sy, amrex::Real& sz)
167 const amrex::Real s = std::sin(zenith);
168 sx = s * std::sin(azimuth);
169 sy = s * std::cos(azimuth);
170 sz = std::cos(zenith);
178 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
179 amrex::Real
clear_sky_dni (amrex::Real cos_zenith, amrex::Real S0, amrex::Real tau,
180 amrex::Real distance_factor)
182 if (cos_zenith <= 1.0e-3)
return 0.0;
183 return S0 * distance_factor * std::pow(tau, 1.0 / cos_zenith);
191 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
193 amrex::Real distance_factor, amrex::Real k_d)
195 if (cos_zenith <= 1.0e-3)
return 0.0;
196 const amrex::Real tr = std::pow(tau, 1.0 / cos_zenith);
197 return k_d * S0 * distance_factor * cos_zenith * (1.0 - tr);
220 amrex::Array4<const int>
top;
225 amrex::Real
dx = 0.0,
dy = 0.0,
dz = 0.0;
232 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
236 if (!
wrap_x) {
return false; }
239 if (cj <
top.begin[1] || cj >=
top.end[1]) {
240 if (!
wrap_y) {
return false; }
241 cj =
top.begin[1] + ((cj -
top.begin[1]) %
ny +
ny) %
ny;
247 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
250 const int kt =
top(
ci, cj,
top.begin[2]);
255 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
256 amrex::Real
centre_x (
int ci)
const noexcept {
return x_lo + (
static_cast<amrex::Real
>(
ci -
ilo) + amrex::Real(0.5)) *
dx; }
257 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
258 amrex::Real
centre_y (
int cj)
const noexcept {
return y_lo + (
static_cast<amrex::Real
>(cj -
jlo) + amrex::Real(0.5)) *
dy; }
271 if (
height <= 0.0) {
return 1; }
272 const amrex::Real cz = std::sqrt(amrex::max(amrex::Real(0.0), amrex::Real(1.0) - sz_min * sz_min));
273 if (sz_min <= 0.0 || cz <= 0.0) {
return std::numeric_limits<int>::max() / 4; }
275 if (
reach >= amrex::Real(std::numeric_limits<int>::max() / 8)) {
return std::numeric_limits<int>::max() / 4; }
276 return amrex::max(1,
static_cast<int>(std::ceil(
reach)) + 1);
290 const amrex::Real u_min = 0.5 / n_el, u_max = (n_el - 0.5) / n_el;
291 const amrex::Real roof = std::sqrt(1.0 - u_max);
292 const amrex::Real wall = std::sqrt(u_min) * std::sin(
PI / n_az);
293 return amrex::min(roof, wall);
302 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
305 const amrex::Real w = 1.0 /
static_cast<amrex::Real
>(n_az * n_el);
335 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
337 amrex::Real sx, amrex::Real sy, amrex::Real sz,
const RayMap& m,
338 bool windowed,
int oi,
int oj)
340 if (sz <= 0.0)
return true;
341 if (
z0 >= m.
z_max)
return false;
342 const amrex::Real
dx = m.
dx,
dy = m.
dy;
343 const amrex::Real
eps = 1.0e-6 * amrex::min(
dx,
dy);
344 const amrex::Real
t0 = 1.0e-3 * amrex::min(
dx,
dy);
345 amrex::Real
x = x0 +
t0 * sx,
y = y0 +
t0 * sy,
z =
z0 +
t0 * sz;
346 int ci = m.
ilo +
static_cast<int>(std::floor((
x - m.
x_lo) /
dx));
347 int cj = m.
jlo +
static_cast<int>(std::floor((
y - m.
y_lo) /
dy));
348 const int stepx = (sx > 0.0) ? 1 : ((sx < 0.0) ? -1 : 0);
349 const int stepy = (sy > 0.0) ? 1 : ((sy < 0.0) ? -1 : 0);
350 const amrex::Real big = 1.0e30;
351 const amrex::Real tdx = (stepx != 0) ?
dx / std::abs(sx) : big;
352 const amrex::Real tdy = (stepy != 0) ?
dy / std::abs(sy) : big;
354 amrex::Real tmx = big, tmy = big;
355 if (stepx > 0) tmx = ((m.
x_lo + (
ci - m.
ilo + 1) *
dx) -
x) / sx;
356 else if (stepx < 0) tmx = ((m.
x_lo + (
ci - m.
ilo) *
dx) -
x) / sx;
357 if (stepy > 0) tmy = ((m.
y_lo + (cj - m.
jlo + 1) *
dy) -
y) / sy;
358 else if (stepy < 0) tmy = ((m.
y_lo + (cj - m.
jlo) *
dy) -
y) / sy;
361 const amrex::Real t_max = (m.
z_max -
z) / sz;
362 const amrex::Real steps = amrex::min(t_max * (std::abs(sx) /
dx + std::abs(sy) /
dy), amrex::Real(m.
max_steps));
363 const int max_iter =
static_cast<int>(amrex::min(amrex::Real(1.0e9), steps)) + 8;
364 for (
int it = 0; it < max_iter; ++it) {
366 if (windowed && (std::abs(oi) > m.
reach_x || std::abs(oj) > m.
reach_y))
return false;
368 if (!m.
locate(
ci, cj))
return false;
372 if (tmx < tmy) {
t = tmx; tmx += tdx;
ci += stepx; oi += stepx; }
373 else {
t = tmy; tmy += tdy; cj += stepy; oj += stepy; }
374 z =
z0 +
t0 * sz +
t * sz;
375 if (
z >= m.
z_max)
return false;
386 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
388 amrex::Real sx, amrex::Real sy, amrex::Real sz,
const RayMap& m)
408 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
410 amrex::Real sx, amrex::Real sy, amrex::Real sz,
const RayMap& m,
411 int ci_ref,
int cj_ref)
414 true, ci0 - ci_ref, cj0 - cj_ref);
443 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
445 amrex::Real sx, amrex::Real sy, amrex::Real sz,
const RayMap& m,
446 bool& landed,
int& li,
int& lj)
448 landed =
false; li = 0; lj = 0;
449 const amrex::Real
dx = m.
dx,
dy = m.
dy;
450 const amrex::Real
eps = 1.0e-6 * amrex::min(
dx,
dy);
452 const amrex::Real
t0 = 1.0e-3 * amrex::min(
dx,
dy);
453 amrex::Real
x = x0 +
t0 * sx,
y = y0 +
t0 * sy,
z =
z0 +
t0 * sz;
455 int ui = m.
ilo +
static_cast<int>(std::floor((
x - m.
x_lo) /
dx));
456 int uj = m.
jlo +
static_cast<int>(std::floor((
y - m.
y_lo) /
dy));
457 const int stepx = (sx > 0.0) ? 1 : ((sx < 0.0) ? -1 : 0);
458 const int stepy = (sy > 0.0) ? 1 : ((sy < 0.0) ? -1 : 0);
459 const amrex::Real big = 1.0e30;
460 const amrex::Real tdx = (stepx != 0) ?
dx / std::abs(sx) : big;
461 const amrex::Real tdy = (stepy != 0) ?
dy / std::abs(sy) : big;
462 amrex::Real tmx = big, tmy = big;
463 if (stepx > 0) tmx = ((m.
x_lo + (ui - m.
ilo + 1) *
dx) -
x) / sx;
464 else if (stepx < 0) tmx = ((m.
x_lo + (ui - m.
ilo) *
dx) -
x) / sx;
465 if (stepy > 0) tmy = ((m.
y_lo + (uj - m.
jlo + 1) *
dy) -
y) / sy;
466 else if (stepy < 0) tmy = ((m.
y_lo + (uj - m.
jlo) *
dy) -
y) / sy;
467 if (stepx == 0 && stepy == 0) {
477 const bool level = (std::abs(sz) < 1.0e-9);
478 const amrex::Real t_max = (sz > 0.0) ? (m.
z_max -
z) / sz : ((sz < 0.0) ? (
z - m.
z_ground) / (-sz) : big);
479 const amrex::Real rounds = amrex::Real(2 * ((m.
top.end[0] - m.
top.begin[0]) + (m.
top.end[1] - m.
top.begin[1])));
480 const amrex::Real steps = level ? rounds
481 : amrex::min(t_max * (std::abs(sx) /
dx + std::abs(sy) /
dy), amrex::Real(m.
max_steps));
482 const int max_iter =
static_cast<int>(amrex::min(amrex::Real(1.0e9), steps)) + 8;
483 for (
int it = 0; it < max_iter; ++it) {
484 int ci = ui, cj = uj;
488 const amrex::Real t_next = amrex::min(tmx, tmy);
489 const amrex::Real z_out =
z0 +
t0 * sz + t_next * sz;
497 if (tmx < tmy) { tmx += tdx; ui += stepx; }
498 else { tmy += tdy; uj += stepy; }
506 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
507 int ray_hit (amrex::Real x0, amrex::Real y0, amrex::Real
z0,
508 amrex::Real sx, amrex::Real sy, amrex::Real sz,
const RayMap& m)
523 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
525 amrex::Real& sx, amrex::Real& sy, amrex::Real& sz)
527 const amrex::Real u = (ie + 0.5) / n_el;
528 const amrex::Real
theta = std::asin(std::sqrt(u));
529 const amrex::Real
phi = 2.0 *
PI * (ia + 0.5) / n_az;
530 const amrex::Real cn = std::cos(
theta), ct = std::sin(
theta) * std::cos(
phi), st = std::sin(
theta) * std::sin(
phi);
532 amrex::Real n[3] = {0.0, 0.0, 0.0}, t1[3] = {0.0, 0.0, 0.0}, t2[3] = {0.0, 0.0, 0.0};
534 if (dir == 0) { t1[1] = 1.0; t2[2] = 1.0; }
535 else if (dir == 1) { t1[0] = 1.0; t2[2] = 1.0; }
536 else { t1[0] = 1.0; t2[1] = 1.0; }
537 sx = cn * n[0] + ct * t1[0] + st * t2[0];
538 sy = cn * n[1] + ct * t1[1] + st * t2[1];
539 sz = cn * n[2] + ct * t1[2] + st * t2[2];
555 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
560 return std::abs(
di) <= rx && std::abs(dj) <= ry;
564 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
567 return (
static_cast<unsigned int>(
di + 32768) << 16) |
static_cast<unsigned int>(dj + 32768);
571 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
574 di =
static_cast<int>(w >> 16) - 32768;
575 dj =
static_cast<int>(w & 0xFFFFu) - 32768;
585 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
587 amrex::Real sx, amrex::Real sy, amrex::Real sz,
const RayMap& m,
604 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
607 return sz > 0.0 && beam_ground > 0.0;
628 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
629 amrex::Real
ground_view_lit (
int ci_f,
int cj_f,
int n_far,
const unsigned int* land,
const int* rays,
int n_land,
630 amrex::Real inv, amrex::Real sx, amrex::Real sy, amrex::Real sz,
const RayMap& m)
632 if (sz <= 0.0) {
return 0.0; }
634 for (
int n = 0; n < n_land; ++n) {
637 if (!
ray_blocked_near(ci_f +
di, cj_f + dj, sx, sy, sz, m, ci_f, cj_f)) { n_lit += rays[n]; }
std::vector< std::array< Box, 3 > > reach
Definition: ERF_ActuatorSpreading.cpp:222
GpuArray< Real, AMREX_SPACEDIM > dx
Definition: ERF_ActuatorSpreading.cpp:131
Real z0
Definition: ERF_InitCustomPertVels_ScalarAdvDiff.H:12
const Real dy
Definition: ERF_InitCustomPert_ABL.H:101
amrex::Real gamma
Definition: ERF_InitCustomPert_DataAssimilation_ISV.H:9
Real height
Definition: ERF_InitCustomPert_SquallLine.H:37
Dimensionless numeric literals and pure mathematical constants.
constexpr amrex::Real PI
Definition: ERF_NumericalConstants.H:46
@ theta
Definition: ERF_Kessler.H:26
@ U
Definition: ERF_IndexDefines.H:178
@ t
Definition: ERF_WSM6.H:295
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real eps()
Definition: ERF_ShocMoments.cpp:19
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real phi(amrex::Real d, amrex::Real z0, amrex::Real psi) noexcept
Definition: ERF_ImmersedWallCell.H:176
Definition: ERF_IBSEBBalance.H:51
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int ray_hit(amrex::Real x0, amrex::Real y0, amrex::Real z0, amrex::Real sx, amrex::Real sy, amrex::Real sz, const RayMap &m)
Definition: ERF_IBSEBSolar.H:507
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE unsigned int pack_landing(int di, int dj) noexcept
Definition: ERF_IBSEBSolar.H:565
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool ray_blocked_near(int ci0, int cj0, amrex::Real sx, amrex::Real sy, amrex::Real sz, const RayMap &m, int ci_ref, int cj_ref)
Definition: ERF_IBSEBSolar.H:409
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE unsigned int ray_landing_word(amrex::Real x0, amrex::Real y0, amrex::Real z0, amrex::Real sx, amrex::Real sy, amrex::Real sz, const RayMap &m, int ci_f, int cj_f)
Definition: ERF_IBSEBSolar.H:586
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void hemisphere_direction(int dir, int nsign, int ia, int ie, int n_az, int n_el, amrex::Real &sx, amrex::Real &sy, amrex::Real &sz)
Definition: ERF_IBSEBSolar.H:524
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool ray_blocked_walk(amrex::Real x0, amrex::Real y0, amrex::Real z0, amrex::Real sx, amrex::Real sy, amrex::Real sz, const RayMap &m, bool windowed, int oi, int oj)
Definition: ERF_IBSEBSolar.H:336
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int ray_hit_landing(amrex::Real x0, amrex::Real y0, amrex::Real z0, amrex::Real sx, amrex::Real sy, amrex::Real sz, const RayMap &m, bool &landed, int &li, int &lj)
Definition: ERF_IBSEBSolar.H:444
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real solar_zenith(amrex::Real latitude_deg, amrex::Real decl, amrex::Real hour_angle)
Definition: ERF_IBSEBSolar.H:116
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void unpack_landing(unsigned int w, int &di, int &dj) noexcept
Definition: ERF_IBSEBSolar.H:572
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real clear_sky_dni(amrex::Real cos_zenith, amrex::Real S0, amrex::Real tau, amrex::Real distance_factor)
Definition: ERF_IBSEBSolar.H:179
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real orbital_hour_angle(double calday, amrex::Real longitude_rad)
Definition: ERF_IBSEBSolar.H:105
amrex::Real hemisphere_min_sz(int n_az, int n_el)
Definition: ERF_IBSEBSolar.H:288
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real equation_of_time(amrex::Real day_of_year)
Definition: ERF_IBSEBSolar.H:73
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real earth_sun_distance_factor(amrex::Real day_of_year)
Definition: ERF_IBSEBSolar.H:155
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool ground_view_beam_up(amrex::Real sz, amrex::Real beam_ground) noexcept
Definition: ERF_IBSEBSolar.H:605
constexpr unsigned int landing_none
The ray does not end on the ground.
Definition: ERF_IBSEBSolar.H:551
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real hemisphere_ray_weight(int n_az, int n_el) noexcept
Definition: ERF_IBSEBSolar.H:303
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real ground_view_lit(int ci_f, int cj_f, int n_far, const unsigned int *land, const int *rays, int n_land, amrex::Real inv, amrex::Real sx, amrex::Real sy, amrex::Real sz, const RayMap &m)
Definition: ERF_IBSEBSolar.H:629
RayHit
What a ray from a face ends on.
Definition: ERF_IBSEBSolar.H:418
@ RAY_GROUND
Definition: ERF_IBSEBSolar.H:418
@ RAY_SKY
Definition: ERF_IBSEBSolar.H:418
@ RAY_BUILDING
Definition: ERF_IBSEBSolar.H:418
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void sun_vector(amrex::Real zenith, amrex::Real azimuth, amrex::Real &sx, amrex::Real &sy, amrex::Real &sz)
Definition: ERF_IBSEBSolar.H:164
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool ray_blocked(amrex::Real x0, amrex::Real y0, amrex::Real z0, amrex::Real sx, amrex::Real sy, amrex::Real sz, const RayMap &m)
Definition: ERF_IBSEBSolar.H:387
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real solar_azimuth(amrex::Real latitude_deg, amrex::Real decl, amrex::Real hour_angle, amrex::Real zenith)
Definition: ERF_IBSEBSolar.H:131
int ray_halo_cells(amrex::Real height, amrex::Real dx, amrex::Real sz_min)
Definition: ERF_IBSEBSolar.H:269
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real day_of_year_at(amrex::Real day0, amrex::Real t_utc_s)
Definition: ERF_IBSEBSolar.H:55
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real solar_declination(amrex::Real day_of_year)
Definition: ERF_IBSEBSolar.H:62
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real spencer_day_angle(amrex::Real day_of_year)
Definition: ERF_IBSEBSolar.H:44
constexpr unsigned int landing_far
The ray ends on the far field's open ground.
Definition: ERF_IBSEBSolar.H:552
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real solar_hour_angle(amrex::Real time_utc_s, amrex::Real longitude_deg, amrex::Real day_of_year)
Definition: ERF_IBSEBSolar.H:87
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool landing_kept(int di, int dj, const RayMap &m) noexcept
Definition: ERF_IBSEBSolar.H:556
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real clear_sky_diffuse_h(amrex::Real cos_zenith, amrex::Real S0, amrex::Real tau, amrex::Real distance_factor, amrex::Real k_d)
Definition: ERF_IBSEBSolar.H:192
constexpr int landing_offset_max
Definition: ERF_IBSEBSolar.H:550
real(c_double), parameter t0
Definition: ERF_module_model_constants.F90:39
real(c_double), private ci
Definition: ERF_module_mp_morr_two_moment.F90:203
real(c_double), private di
Definition: ERF_module_mp_morr_two_moment.F90:203
Definition: ERF_IBSEBSolar.H:219
amrex::Real x_lo
Definition: ERF_IBSEBSolar.H:224
amrex::Array4< const int > top
Column tops over the patch (any k index; use top.begin[2])
Definition: ERF_IBSEBSolar.H:220
int reach_x
Definition: ERF_IBSEBSolar.H:229
int ilo
Definition: ERF_IBSEBSolar.H:221
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real column_top(int ci, int cj) const noexcept
Definition: ERF_IBSEBSolar.H:248
amrex::Real y_lo
Physical position of the domain's low corner [m].
Definition: ERF_IBSEBSolar.H:224
amrex::Real z_max
Tallest column the map holds [m]; a ray above it meets nothing.
Definition: ERF_IBSEBSolar.H:227
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real centre_y(int cj) const noexcept
Definition: ERF_IBSEBSolar.H:258
bool wrap_x
Definition: ERF_IBSEBSolar.H:223
int ny
Columns of the domain in x and y.
Definition: ERF_IBSEBSolar.H:222
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real centre_x(int ci) const noexcept
Definition: ERF_IBSEBSolar.H:256
amrex::Real dx
Definition: ERF_IBSEBSolar.H:225
amrex::Real z_ground
Ground height [m].
Definition: ERF_IBSEBSolar.H:226
bool wrap_y
The patch spans the periodic domain in x / y.
Definition: ERF_IBSEBSolar.H:223
int max_steps
Columns a ray at the map's floor elevation crosses before it clears z_max (the halo's reach in x plus...
Definition: ERF_IBSEBSolar.H:228
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool locate(int &ci, int &cj) const noexcept
Definition: ERF_IBSEBSolar.H:233
amrex::Real dy
Definition: ERF_IBSEBSolar.H:225
amrex::Real dz
Cell sizes [m].
Definition: ERF_IBSEBSolar.H:225
int jlo
Low corner of the domain, in cells.
Definition: ERF_IBSEBSolar.H:221
int reach_y
The halo's reach in x and in y, in columns, before the domain cap: every patch holds that many column...
Definition: ERF_IBSEBSolar.H:229
int nx
Definition: ERF_IBSEBSolar.H:222