|
ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
|
Shortwave (solar) radiation kernels: Beer-Lambert direct beam and the two-stream layer solution for the diffuse field. More...
#include <AMReX_GpuControl.H>#include <AMReX_Math.H>#include <AMReX_REAL.H>#include <cmath>

Go to the source code of this file.
Classes | |
| struct | TwoStreamLayerSW |
| Two-stream reflectance and transmittance of one homogeneous layer. More... | |
Functions | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | compute_sw_direct_flux (amrex::Real tau_cumulative, amrex::Real S0, amrex::Real cos_zenith) |
| Compute Beer-Lambert direct-beam flux at a given optical depth. More... | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | compute_sw_heating_rate (amrex::Real flux_top, amrex::Real flux_bot, amrex::Real dz, amrex::Real rho, amrex::Real cp) |
| Compute the shortwave heating rate of a layer from the net (downward positive) flux at its top and bottom interfaces. More... | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE TwoStreamLayerSW | compute_sw_layer_two_stream (amrex::Real tau, amrex::Real omega, amrex::Real g, amrex::Real cos_zenith) |
| Compute the two-stream layer solution for shortwave radiation. More... | |
Shortwave (solar) radiation kernels: Beer-Lambert direct beam and the two-stream layer solution for the diffuse field.
The column model (ERF_TwoStreamColumn.H) treats the solar radiation as a direct beam plus a diffuse field with upward and downward streams:
With omega == 0 in every layer the diffuse field reduces to the reflected direct beam only, and the absorbed surface flux reduces exactly to (1 - alpha) times the Beer-Lambert direct beam.
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real compute_sw_direct_flux | ( | amrex::Real | tau_cumulative, |
| amrex::Real | S0, | ||
| amrex::Real | cos_zenith | ||
| ) |
Compute Beer-Lambert direct-beam flux at a given optical depth.
F_dir = S0 * cos_zenith * exp(-tau_cumulative / cos_zenith)
| [in] | tau_cumulative | Optical depth from the top of the atmosphere [unitless]. |
| [in] | S0 | Solar constant at the top of the atmosphere [W/m^2]. |
| [in] | cos_zenith | Cosine of the solar zenith angle [unitless]. |
Referenced by vertical_two_stream_sweep().

| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real compute_sw_heating_rate | ( | amrex::Real | flux_top, |
| amrex::Real | flux_bot, | ||
| amrex::Real | dz, | ||
| amrex::Real | rho, | ||
| amrex::Real | cp | ||
| ) |
Compute the shortwave heating rate of a layer from the net (downward positive) flux at its top and bottom interfaces.
Q = (F_net_top - F_net_bot) / (dz * rho * cp) [K/s]
Energy converging into the layer warms it. Returns 0 for unphysical inputs (dz, rho, cp <= 0) or a non-finite result.
| [in] | flux_top | Net downward flux at the top of the layer [W/m^2]. |
| [in] | flux_bot | Net downward flux at the bottom of the layer [W/m^2]. |
| [in] | dz | Vertical thickness of the layer [m]. Must be positive. For terrain-aware grids, pass dz = z_cc(k+1) - z_cc(k). |
| [in] | rho | Density [kg/m^3]. Must be positive. |
| [in] | cp | Specific heat at constant pressure [J/(kg·K)]. Must be positive. |
Referenced by vertical_two_stream_sweep().

| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE TwoStreamLayerSW compute_sw_layer_two_stream | ( | amrex::Real | tau, |
| amrex::Real | omega, | ||
| amrex::Real | g, | ||
| amrex::Real | cos_zenith | ||
| ) |
Compute the two-stream layer solution for shortwave radiation.
Gamma coefficients (practical improved flux method, Zdunkowski et al. 1980, as in RRTMGP): gamma1 = (8 - omega * (5 + 3 g)) / 4 gamma2 = 3 omega (1 - g) / 4 gamma3 = (2 - 3 g mu0) / 4 gamma4 = 1 - gamma3 k = sqrt(gamma1^2 - gamma2^2)
Diffuse incidence (Meador and Weaver 1980): R_dif = gamma2 (1 - e^{-2 k tau}) / D T_dif = 2 k e^{-k tau} / D, D = k (1 + e^{-2 k tau}) + gamma1 (1 - e^{-2 k tau})
Direct incidence (Meador and Weaver 1980, Eqs. 14-15), with alpha1 = gamma1 gamma4 + gamma2 gamma3, alpha2 = gamma1 gamma3 + gamma2 gamma4: R_dir = omega / (D (1 - k^2 mu0^2)) * [ (1 - k mu0)(alpha2 + k gamma3) - (1 + k mu0)(alpha2 - k gamma3) e^{-2 k tau}
The removable singularity at k mu0 = 1 is avoided by nudging mu0 slightly, and the results are clipped to the physical range (non-negative, and R_dir + T_dir <= 1 - T_noscat).
| [in] | tau | Optical depth of the layer [unitless]. |
| [in] | omega | Single-scattering albedo of the layer, in [0, 1]. |
| [in] | g | Asymmetry factor of the layer, in [-1, 1]. |
| [in] | cos_zenith | Cosine of the solar zenith angle, in (0, 1]. |
Referenced by vertical_two_stream_sweep().
