|
ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
|
Longwave (thermal) radiation using gray-gas two-stream model. More...
#include <AMReX_GpuControl.H>#include <AMReX_Math.H>#include <AMReX_FArrayBox.H>#include <AMReX_REAL.H>#include <cmath>

Go to the source code of this file.
Functions | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | compute_thermal_intensity (amrex::Real T, amrex::Real sigma) |
| Compute thermal (LW) intensity for a given temperature. More... | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | compute_lw_transmit (amrex::Real tau_lw) |
| Compute transmission coefficient through an absorbing layer. More... | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | compute_lw_flux_up (amrex::Real F_up_below, amrex::Real T_layer, amrex::Real sigma, amrex::Real tau_lw) |
| Compute upwelling LW flux in one layer of a two-stream sweep. More... | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | compute_lw_flux_down (amrex::Real F_down_above, amrex::Real T_layer, amrex::Real sigma, amrex::Real tau_lw) |
| Compute downwelling LW flux in one layer of a two-stream sweep. More... | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | compute_lw_heating_rate (amrex::Real F_net_top, amrex::Real F_net_bot, amrex::Real dz, amrex::Real rho, amrex::Real cp) |
| Compute LW heating rate from net flux divergence. More... | |
Variables | |
| constexpr amrex::Real | stefan_boltzmann = amrex::Real(5.670374419e-8) |
| Stefan-Boltzmann constant [W/(m^2 K^4)] used by the two-stream LW model. More... | |
Longwave (thermal) radiation using gray-gas two-stream model.
Implements a simplified, clear-sky longwave radiation model using the gray-gas two-stream approximation (Toon et al. 1989):
Vertical orientation follows ERF: the vertical index k increases upward, so layer k = kmin touches the surface and k = kmax the top of the domain. Fluxes live on layer interfaces m = k - kmin (bottom of layer k) and m + 1 (top of layer k); m = 0 is the surface, m = nlev the TOA.
F_up(m+1) = F_up(m) * exp(-tau_lw) + sigma * T(k)^4 * (1 - exp(-tau_lw))
Initial condition: F_up(0) = emissivity * sigma * T_surface^4
F_down(m) = F_down(m+1) * exp(-tau_lw) + sigma * T(k)^4 * (1 - exp(-tau_lw))
Initial condition: F_down(nlev) = 0 (no incoming from space)
F_net(m) = F_up(m) - F_down(m) (positive upward) Q_lw(k) = -(1 / (rho * cp)) * [F_net(m+1) - F_net(m)] / dz(k) [K/s]
A layer that emits more than it absorbs has F_net increasing with height, so Q_lw < 0 (radiative cooling).
Layer temperature T(k) is the absolute temperature obtained from rho*theta through the Exner function (see get_temperature_from_rhotheta() in ERF_TwoStreamRadiation.cpp), not the potential temperature.
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real compute_lw_flux_down | ( | amrex::Real | F_down_above, |
| amrex::Real | T_layer, | ||
| amrex::Real | sigma, | ||
| amrex::Real | tau_lw | ||
| ) |
Compute downwelling LW flux in one layer of a two-stream sweep.
Implements the downward flux formula in the gray-gas two-stream model:
F_down_current = F_down_above * exp(-tau_lw) + sigma * T^4 * (1 - exp(-tau_lw))
This is called iteratively from the TOA (where F_down_toa = 0) downward to the surface.
| [in] | F_down_above | Downwelling flux from the layer above [W/m^2]. |
| [in] | T_layer | Temperature of the current layer [K]. |
| [in] | sigma | Stefan-Boltzmann constant [W/(m^2·K^4)]. |
| [in] | tau_lw | Optical depth of the current layer [unitless]. |
Referenced by vertical_two_stream_sweep().


| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real compute_lw_flux_up | ( | amrex::Real | F_up_below, |
| amrex::Real | T_layer, | ||
| amrex::Real | sigma, | ||
| amrex::Real | tau_lw | ||
| ) |
Compute upwelling LW flux in one layer of a two-stream sweep.
Implements the upward flux formula in the gray-gas two-stream model:
F_up_current = F_up_below * exp(-tau_lw) + sigma * T^4 * (1 - exp(-tau_lw))
This is called iteratively from the surface (where F_up_surface = emissivity * sigma * T_surface^4 + (1 - emissivity) * F_down_surface) upward to the TOA.
| [in] | F_up_below | Upwelling flux from the layer below [W/m^2]. |
| [in] | T_layer | Temperature of the current layer [K]. |
| [in] | sigma | Stefan-Boltzmann constant [W/(m^2·K^4)]. |
| [in] | tau_lw | Optical depth of the current layer [unitless]. |
Referenced by vertical_two_stream_sweep().


| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real compute_lw_heating_rate | ( | amrex::Real | F_net_top, |
| amrex::Real | F_net_bot, | ||
| amrex::Real | dz, | ||
| amrex::Real | rho, | ||
| amrex::Real | cp | ||
| ) |
Compute LW heating rate from net flux divergence.
Given the net LW flux (F_up - F_down, positive upward) at the top and bottom interfaces of a layer, compute the radiative heating rate:
dF_net/dz = [F_net_top - F_net_bot] / dz Q_lw = -dF_net/dz / (rho * cp) [K/s]
Net upward flux increasing with height means the layer loses more energy through its top than it gains through its bottom, i.e. the layer cools (Q_lw < 0). This is the same sign convention as the SW heating rate: energy converging into the layer warms it.
Nonuniform dz Support & Sanity Checks
This function accepts per-level dz values to support terrain-aware or nonuniform vertical grids. When dz <= 0, or rho <= 0, or cp <= 0, returns 0 (heating rate is undefined or unphysical).
The computed heating rate is guarded against NaN/Inf via the same parameter validation.
| [in] | F_net_top | Net flux at the top of the layer [W/m^2]. |
| [in] | F_net_bot | Net flux at the bottom of the layer [W/m^2]. |
| [in] | dz | Vertical thickness of the layer [m]. Must be positive. For nonuniform grids, use per-level spacing. |
| [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 amrex::Real compute_lw_transmit | ( | amrex::Real | tau_lw | ) |
Compute transmission coefficient through an absorbing layer.
For a layer with optical depth tau_lw, the fraction of incident radiation that is transmitted (not absorbed or scattered) is:
transmit = exp(-tau_lw)
The fraction absorbed/scattered is:
absorb = 1 - exp(-tau_lw)
This is used in the two-stream upward/downward sweep formulas.
| [in] | tau_lw | Optical depth of the layer [unitless]. Must be ≥ 0. |
Referenced by compute_lw_flux_down(), and compute_lw_flux_up().

| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real compute_thermal_intensity | ( | amrex::Real | T, |
| amrex::Real | sigma | ||
| ) |
Compute thermal (LW) intensity for a given temperature.
Using the Stefan-Boltzmann law, compute the upwelling or downwelling thermal radiation intensity:
I_rad = sigma * T^4
where sigma is the Stefan-Boltzmann constant and T is absolute temperature.
This is a GPU-safe inline function.
| [in] | T | Absolute temperature [K]. Must be positive. |
| [in] | sigma | Stefan-Boltzmann constant [W/(m^2·K^4)]. |
Referenced by compute_lw_flux_down(), compute_lw_flux_up(), and vertical_two_stream_sweep().

|
constexpr |
Stefan-Boltzmann constant [W/(m^2 K^4)] used by the two-stream LW model.
Referenced by vertical_two_stream_sweep().