ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
RadChoice Struct Reference

Container holding radiation-related choices and parameters. More...

#include <ERF_RadStruct.H>

Collaboration diagram for RadChoice:

Public Member Functions

void init_params (bool two_stream_selected, int max_level, std::string pp_prefix)
 
bool uses_two_stream_radiation () const noexcept
 Check if two-stream radiation is active. More...
 

Static Public Member Functions

static void clamp_low (const char *key, amrex::Real &value, amrex::Real lo)
 Read radiation options from the input parameter database. More...
 
static void clamp_high (const char *key, amrex::Real &value, amrex::Real hi)
 
static void reset_nonpositive (const char *key, amrex::Real &value, amrex::Real fallback)
 

Public Attributes

bool enabled = false
 True when erf.radiation_model = TwoStream. Set by init_params from the model SolverChoice read; the erf.radiation.* sub-options are read only then. More...
 
bool sw_enabled = true
 Enable shortwave (solar) radiation computation. Only used by the two-stream model. More...
 
bool lw_enabled = true
 Enable longwave (thermal) radiation computation. Only used by the two-stream model. More...
 
amrex::Real tau_per_layer = 0.05
 Shortwave optical depth per layer (constant for all layers). Used in Beer-Lambert direct-beam formula. Only used by the two-stream model. More...
 
amrex::Real tau_lw_per_layer = 1.0
 Longwave optical depth per layer (constant for all layers). Used in gray-gas LW two-stream solver. Only used by the two-stream model. More...
 
TauModel tau_model = TauModel::PerLayer
 Optical depth model: "per_layer" (default, fixed tau per layer) or "mass" (from the layer mass path in both bands; see TauModel). More...
 
amrex::Real sw_kabs_dry = 4.0e-6
 Mass model, SW: dry-air gray absorption coefficient [m^2/kg]. More...
 
amrex::Real sw_kscat_dry = 3.0e-6
 Mass model, SW: dry-air (Rayleigh) scattering coefficient [m^2/kg], omega = 1, g = 0. More...
 
amrex::Real sw_kabs_vapor = 4.0e-3
 Mass model, SW: water-vapor gray absorption coefficient [m^2/kg]. More...
 
amrex::Real sw_kext_cloud = 150.0
 Mass model, SW: cloud-water extinction coefficient m^2/kg. More...
 
amrex::Real sw_cloud_omega = 0.9999
 Mass model, SW: cloud-water single-scattering albedo. More...
 
amrex::Real sw_cloud_g = 0.85
 Mass model, SW: cloud-water asymmetry factor. More...
 
bool lw_mass_absorption_enable = false
 Gray longwave optical depth from the layer mass path instead of the fixed tau_lw_per_layer (also selected by tau_model = mass): tau_lw(k) = rho dz (lw_kabs_dry + lw_kabs_vapor qv + lw_kabs_cloud qc) The cloud term is the Stephens (1978) emissivity, eps = 1 - exp(-a LWP) with a = 0.158 m^2/g, written as an optical depth. The column optical depth is then independent of the vertical resolution. The cloud-band, moisture-coefficient and aerosol additions still apply on top. Default false keeps tau_lw_per_layer. More...
 
amrex::Real lw_kabs_dry = 1.0e-4
 Dry-air gray LW mass absorption coefficient [m^2/kg]. More...
 
amrex::Real lw_kabs_vapor = 0.1
 Water-vapor gray LW mass absorption coefficient [m^2/kg]. More...
 
amrex::Real lw_kabs_cloud = 158.0
 Cloud-water LW mass absorption coefficient m^2/kg. More...
 
int verbosity = 0
 Debug verbosity level (0=off, 1+=debug output). Gated debug prints only emit when this is >= 1. More...
 
std::string diag_file = "radiation_diag.dat"
 Output file path for radiation diagnostics CSV. Paths are relative to the simulation working directory. More...
 
bool diag_enable = false
 Master switch for radiation diagnostics emission. When false, no diagnostics output (stdout/tagged/regtest/csv). Default false: a run that did not ask for the diagnostics should not write a CSV row and a stdout block on every step. The per-stream switches below stay on by default, so setting this one input to true turns the whole set on. More...
 
bool diag_stdout_enable = true
 Enable human-readable stdout diagnostics block. Controls tagged [RAD][...] debug line emission (when verbosity >= 1). Default true. More...
 
bool diag_tagged_enable = true
 Enable tagged [RAD][...] debug lines. Controls emission of bracketed-tag debug output. Default true. More...
 
bool diag_regtest_line_enable = true
 Enable RADIATION_DIAG: line emission. Controls regtest-parsing diagnostics line. Default true. More...
 
bool diag_csv_enable = true
 Enable CSV file append behavior. When false, no file writes; other enabled streams may still print. Default true. More...
 
std::string diag_callsite_mode = "both"
 Call-site filtering mode: "both" (pre+post rows), "pre_only", or "post_only". More...
 
amrex::Real diag_dedup_tol = 1.0e-12
 Tolerance for time equality in duplicate guard [s]. Times within this tolerance are considered equal. Default 1e-12. More...
 
TauProfileType tau_profile_type = TauProfileType::Constant
 Optical depth profile type: "constant" (default, the thickness-independent tau) or "cloud_layer" (adds height-varying cloud optical depth between cloud_base_height_m and cloud_top_height_m). More...
 
amrex::Real cloud_base_height_m = 500.0
 Cloud layer base height [m]. Only used when tau_profile_type == CloudLayer. More...
 
amrex::Real cloud_top_height_m = 1000.0
 Cloud layer top height [m]. Only used when tau_profile_type == CloudLayer. Must be >= cloud_base_height_m. More...
 
amrex::Real cloud_tau_per_layer = 0.5
 Additional optical depth per layer contributed by the cloud, added on top of the clear-sky tau_per_layer/tau_lw_per_layer background within [cloud_base_height_m, cloud_top_height_m]. Only used when tau_profile_type == CloudLayer. More...
 
amrex::Real cloud_fraction = 0.0
 Cloud fraction in [0, 1] used to blend clear-sky and cloudy-column fluxes: F = (1 - cloud_fraction) * F_clear + cloud_fraction * F_cloudy. Default 0.0 (fully clear sky), which reduces exactly to the clear-sky column regardless of tau_profile_type. More...
 
amrex::Real single_scattering_albedo = 0.0
 Clear-sky (background gas) single-scattering albedo in [0, 1] for the SW diffuse (scattering) two-stream calculation. Default 0.0 means the clear-sky column is purely absorbing, and the diffuse SW contribution from the clear-sky column is exactly zero — reducing exactly to the direct-beam-only result. Only used by the two-stream model and sw_enabled == true. More...
 
amrex::Real asymmetry_factor = 0.0
 Clear-sky (background gas) scattering asymmetry factor in [-1, 1] (0 = isotropic scattering, close to 1 = strongly forward-scattering). Only meaningful when single_scattering_albedo

0. Default 0.0.

More...
 
amrex::Real cloud_single_scattering_albedo = 0.0
 Cloud single-scattering albedo in [0, 1], used instead of single_scattering_albedo for levels where the cloud-layer optical depth enhancement applies (i.e., within [cloud_base_height_m, cloud_top_height_m] on the "cloudy" column evaluation). Default 0.0 leaves the cloud band non-scattering for SW_Cloud_Layer unless explicitly configured otherwise. Typical liquid water cloud values are close to 1 (e.g., 0.9999). Only used when tau_profile_type == CloudLayer. More...
 
amrex::Real cloud_asymmetry_factor = 0.0
 Cloud scattering asymmetry factor in [-1, 1], used instead of asymmetry_factor for levels where the cloud-layer optical depth enhancement applies. Default 0.0. Typical liquid water cloud droplet values are around 0.85 (strongly forward-scattering). Only meaningful when cloud_single_scattering_albedo > 0. More...
 
amrex::Real surface_albedo_sw = 0.3
 Shortwave surface albedo fallback [0, 1] for per-column heterogeneous-surface-property resolution. Used when per-column LSM/radiation interface albedo field is unavailable or invalid. Default 0.3 represents typical land/water reflectivity. Only used when hetero surface fields not present or disabled. More...
 
amrex::Real surface_albedo_sw_diffuse = -1.0
 Shortwave surface albedo for diffuse light [0,1]. A negative value (default) uses surface_albedo_sw for both direct and diffuse light. More...
 
amrex::Real surface_emissivity_lw = 0.99
 Longwave surface emissivity fallback [0, 1] for per-column heterogeneous-surface-property resolution. Used when per-column LSM/radiation interface emissivity field is unavailable or invalid. Default 0.99 represents typical land/water/ice emissivity (nearly blackbody). Only used when hetero surface fields not present or disabled. More...
 
bool seb_enable = false
 Master switch for simplified SEB infrastructure. When false (default), no SEB MultiFabs are allocated and behavior is unchanged. More...
 
bool seb_use_radiation_fluxes = false
 Take the SEB's net surface shortwave and longwave fluxes from the two-stream sweep itself (per column, absorbed fluxes positive) wherever the LSM does not expose them. When false (default) those fluxes are the LSM fields or, without an LSM, the seb_sw_flux_default and seb_lw_flux_default constants. Sensible, latent and ground heat fluxes are unaffected. More...
 
amrex::Real seb_sw_flux_default = 0.0
 Fallback SEB surface net shortwave flux [W/m^2]. More...
 
amrex::Real seb_lw_flux_default = 0.0
 Fallback SEB surface net longwave flux [W/m^2]. More...
 
amrex::Real seb_hfx_default = 0.0
 Fallback SEB sensible heat flux [W/m^2]. More...
 
amrex::Real seb_lh_default = 0.0
 Fallback SEB latent heat flux [W/m^2]. More...
 
amrex::Real seb_grdflx_default = 0.0
 Fallback SEB ground heat flux [W/m^2]. More...
 
amrex::Real seb_q_sfc_default = 0.0
 Fallback SEB surface moisture [kg/kg]. More...
 
amrex::Real seb_t_deep_default = 300.0
 Fallback SEB deep soil temperature [K]. More...
 
amrex::Real seb_q_deep_default = 0.0
 Fallback SEB deep soil moisture [kg/kg]. More...
 
bool seb_diagnostic_enable = false
 Enable diagnostic SEB residual computation and reporting. When true, computes and reports SEB residual = (SW_net + LW_net) - H - LE - G. When false (default), no residual computation or new diagnostic output. Requires seb_enable=true to be meaningful; if false but seb_enable=true, auto-enables internally. Note: this is diagnostic-only; it makes no prognostic T_s or flux update. Set seb_prognostic_enable for that. More...
 
bool seb_prognostic_enable = false
 Enable prognostic SEB surface temperature and moisture evolution. When true, integrates SEB residual forward in time to evolve T_s and q_s using force-restore formulation. When false (default), no prognostic update occurs. Requires seb_enable=true and seb_diagnostic_enable=true; auto-enables internally if needed. Only active when Noah-MP is NOT driving LSM fields at that level. More...
 
amrex::Real seb_surface_heat_capacity = 2.0e4
 Effective surface heat capacity [J/(m^2*K)]. Used in force-restore prognostic T_s equation: dT_s/dt = SEB_residual / C_s - (2*pi/tau)*(T_s - T_deep). Default 2.0e4 J/(m^2*K) represents a thin surface-active layer. Only used when seb_prognostic_enable=true. Validated > 0 in init_params(). More...
 
amrex::Real seb_restore_timescale_s = 86400.0
 Force-restore timescale for surface temperature [s]. Relaxation time constant toward T_deep in prognostic T_s equation. Default 86400.0 s (1 day) provides weak damping on diurnal timescales. Only used when seb_prognostic_enable=true. Validated > 0 in init_params(). More...
 
amrex::Real seb_moisture_layer_depth_m = 0.1
 Effective surface moisture layer depth [m]. Used in force-restore prognostic q_s equation: dq_s/dt = -(LE/(L_v*rho_w*d_s)) - (1/tau_q)*(q_s - q_deep). Default 0.1 m represents a thin surface-active moisture layer. Only used when seb_prognostic_enable=true. Validated > 0 in init_params(). More...
 
amrex::Real seb_moisture_restore_timescale_s = 86400.0
 Force-restore timescale for surface moisture [s]. Relaxation time constant toward q_deep in prognostic q_s equation. Default 86400.0 s (1 day) provides weak damping on diurnal timescales. Only used when seb_prognostic_enable=true. Validated > 0 in init_params(). More...
 
amrex::Real seb_prognostic_t_min_k = 200.0
 Minimum clamping bound for prognostic surface temperature [K]. After each Euler update, T_s is clamped to [seb_prognostic_t_min_k, seb_prognostic_t_max_k] to prevent instability if dt is large relative to C_s/tau. Default 200.0 K (far below realistic surface temperatures). Only used when seb_prognostic_enable=true. More...
 
amrex::Real seb_prognostic_t_max_k = 340.0
 Maximum clamping bound for prognostic surface temperature [K]. After each Euler update, T_s is clamped to [seb_prognostic_t_min_k, seb_prognostic_t_max_k]. Default 340.0 K (above typical surface temperatures, but prevents unrealistic excursions). Only used when seb_prognostic_enable=true. More...
 
amrex::Real seb_prognostic_q_min = 0.0
 Minimum clamping bound for prognostic surface moisture [kg/kg]. After each Euler update, q_s is clamped to [seb_prognostic_q_min, seb_prognostic_q_max]. Default 0.0 kg/kg prevents negative moisture. Only used when seb_prognostic_enable=true. More...
 
amrex::Real seb_prognostic_q_max = 1.0
 Maximum clamping bound for prognostic surface moisture [kg/kg]. After each Euler update, q_s is clamped to [seb_prognostic_q_min, seb_prognostic_q_max]. Default 1.0 kg/kg ensures physically meaningful moisture. Only used when seb_prognostic_enable=true. More...
 
bool tau_lw_dynamic_enable = false
 Enable dynamic longwave optical depth diagnosis from moisture/clouds. When true, LW optical depth is computed per-level from qv and qc. When false (default), uses the static tau_lw_per_layer. Only used by the two-stream model and lw_enabled == true. More...
 
bool tau_sw_dynamic_enable = false
 
amrex::Real tau_sw_coeff_qv = 0.0
 Shortwave optical depth coefficient for water vapor [dimensionless]. Dynamic SW tau = tau_sw_coeff_qv * qv + tau_sw_coeff_qc * qc + tau_per_layer. Default 0.0 means tau is purely from static tau_per_layer (no dynamic component). Only used when tau_sw_dynamic_enable == true. More...
 
amrex::Real tau_sw_coeff_qc = 0.0
 Shortwave optical depth coefficient for cloud liquid water [dimensionless]. Default 0.0. When both coefficients are 0, dynamic path still invoked but yields tau_per_layer unchanged. Only used when tau_sw_dynamic_enable == true. More...
 
amrex::Real tau_lw_coeff_qv = 0.0
 Longwave optical depth coefficient for water vapor [dimensionless]. Dynamic LW tau = tau_lw_coeff_qv * qv + tau_lw_coeff_qc * qc + tau_lw_per_layer. Default 0.0 means tau is purely from static tau_lw_per_layer (no dynamic component). Only used when tau_lw_dynamic_enable == true. More...
 
amrex::Real tau_lw_coeff_qc = 0.0
 Longwave optical depth coefficient for cloud liquid water [dimensionless]. Default 0.0. When both coefficients are 0, dynamic path still invoked but yields tau_lw_per_layer unchanged. Only used when tau_lw_dynamic_enable == true. More...
 
bool cloud_fraction_prog_enable = false
 Enable prognostic cloud fraction diagnosis from RH/qc. When true, cloud fraction is computed per-level from relative humidity and cloud water. When false (default), uses the static cloud_fraction. Only used by the two-stream model. More...
 
amrex::Real cloud_fraction_rh_min = 0.0
 Minimum relative humidity threshold for cloud fraction diagnosis [0, 1]. Cloud fraction ramps from 0 at rh < cloud_fraction_rh_min to 1 at rh >= cloud_fraction_rh_max. Default 0.0 means cloud fraction depends primarily on qc content. Only used when cloud_fraction_prog_enable == true. More...
 
amrex::Real cloud_fraction_rh_max = 1.0
 Maximum relative humidity threshold for cloud fraction diagnosis [0, 1]. Must be >= cloud_fraction_rh_min. Cloud fraction saturates to 1 at this RH. Default 1.0 means cloud fraction increases linearly from rh_min to 1.0 RH. Only used when cloud_fraction_prog_enable == true. More...
 
amrex::Real cloud_fraction_qc_scale = 1.0e-3
 Cloud water [kg/kg] at which the liquid-water term alone gives a cloud fraction of 1: cf += min(1, qc / cloud_fraction_qc_scale). Default 1.0e-3 kg/kg, so a typical stratus cloud water saturates the term. Only used when cloud_fraction_prog_enable == true. More...
 
bool aerosol_enable = false
 Enable prescribed bulk aerosol/turbidity optical depth. When true, aerosol optical depth is added on top of existing tau_base + cloud + dynamic-moisture contributions. When false (default), there is no aerosol contribution. Only used by the two-stream model and sw_enabled == true. More...
 
AerosolProfileType aerosol_profile_type = AerosolProfileType::Constant
 Aerosol optical depth profile type: Constant, Exponential, or Table. More...
 
amrex::Real aerosol_tau_per_layer = 0.0
 Constant aerosol optical depth per layer [dimensionless]. Used for AerosolProfileType::Constant profile. Default 0.0 (no aerosol contribution). Only used when aerosol_enable == true and aerosol_profile_type == Constant. More...
 
amrex::Real aerosol_scale_height_m = 2000.0
 Scale height for exponential aerosol profile [m]. Controls decay rate: tau_aerosol(k) = aerosol_tau_surface * exp(-z(k) / scale_height). Default 2000.0 m (typical scale height for tropospheric aerosols). Only used when aerosol_enable == true and aerosol_profile_type == Exponential. More...
 
amrex::Real aerosol_tau_surface = 0.0
 Total-column aerosol optical depth at surface [dimensionless]. Used for AerosolProfileType::Exponential profile as the surface boundary condition. Default 0.0 (no aerosol contribution). Only used when aerosol_enable == true and aerosol_profile_type == Exponential. More...
 
Inputs shared with the RRTMGP interface

The two-stream model reads the sun, site and surface-temperature inputs under the same keys, with the same meaning, as the RRTMGP interface (Source/Radiation/RRTMGP/ERF_Radiation.H), so a deck switches between the two models by changing erf.radiation_model alone.

amrex::Real fixed_solar_zenith_angle = -9999.0
 erf.fixed_solar_zenith_angle: the COSINE of the solar zenith angle (mu0), as RRTMGP takes it, applied to every column when > 0. Otherwise (default) the sun follows the calendar: start_datetime sets the date and time, the position is evaluated at rad_cons_lat/lon or at the per-column latitude and longitude when the grid carries them. More...
 
amrex::Real fixed_total_solar_irradiance = -9999.0
 erf.fixed_total_solar_irradiance: top-of-atmosphere irradiance [W/m^2] when >= 0. Otherwise (default) 1360.9 W/m^2 scaled by the Earth-Sun distance factor of the date, as RRTMGP does. More...
 
amrex::Real rad_t_sfc = -1.0
 erf.rad_t_sfc: surface temperature [K] used as the longwave boundary condition wherever no land-surface model, surface layer or prognostic surface energy balance supplies one; also the initial value of the prognostic surface temperature. Required, as for RRTMGP. More...
 
amrex::Real rad_cons_lat = 39.809860
 erf.rad_cons_lat / erf.rad_cons_lon: site latitude and longitude [degrees] when the grid has no lat/lon fields (RRTMGP defaults). More...
 
amrex::Real rad_cons_lon = -98.555183
 
int rad_orbital_year = -9999
 erf.rad_orbital_year and the orbital overrides: negative means the year of the timestamp and the Berger (1978) values for that year. More...
 
amrex::Real rad_orbital_eccentricity = -9999.0
 
amrex::Real rad_orbital_obliquity = -9999.0
 
amrex::Real rad_orbital_mvelp = -9999.0
 

Detailed Description

Container holding radiation-related choices and parameters.

Manages the runtime selection and configuration of radiation solvers.

The two-stream solver builds up from a clear-sky, no-scattering column of uniform optical depth. On top of that it offers height-varying optical depth (a cloud layer) with cloud-fraction masking, which blends clear-sky and cloudy-column fluxes, and a diffuse shortwave component from a two-stream scattering approximation parameterized by single-scattering albedo and asymmetry factor, with independent clear-sky and cloud values. Every addition is off by default, so the defaults reproduce the plain clear-sky column.

Member Function Documentation

◆ clamp_high()

static void RadChoice::clamp_high ( const char *  key,
amrex::Real value,
amrex::Real  hi 
)
inlinestatic
707  {
708  if (value > hi) {
709  if (amrex::ParallelDescriptor::IOProcessor()) {
710  amrex::Print() << "WARNING: erf.radiation." << key << " = " << value
711  << " is above its maximum " << hi << "; using " << hi << "\n";
712  }
713  value = hi;
714  }
715  }

Referenced by init_params().

Here is the caller graph for this function:

◆ clamp_low()

static void RadChoice::clamp_low ( const char *  key,
amrex::Real value,
amrex::Real  lo 
)
inlinestatic

Read radiation options from the input parameter database.

Parameters
[in]levAMR level index.
[in]max_levelMaximum AMR level configured for the run.
[in]pp_prefixParmParse prefix for the ERF input namespace (e.g., "erf").

Queries:

  • erf.radiation_model = TwoStream (read by SolverChoice) selects the model
  • erf.radiation.sw_enabled (bool, optional, default true)
  • erf.radiation.lw_enabled (bool, optional, default true)
  • erf.radiation.tau_per_layer (real, optional)
  • erf.radiation.tau_lw_per_layer (real, optional)
  • erf.fixed_solar_zenith_angle, erf.fixed_total_solar_irradiance, erf.rad_t_sfc (required), erf.rad_cons_lat, erf.rad_cons_lon, erf.rad_orbital_year, erf.rad_orbital_eccentricity, erf.rad_orbital_obliquity, erf.rad_orbital_mvelp: the RRTMGP interface's keys, with its meanings (see the members above)
  • erf.radiation.tau_model (string "per_layer"|"mass", optional, default "per_layer")
  • erf.radiation.sw_kabs_dry, sw_kscat_dry, sw_kabs_vapor, sw_kext_cloud (real, optional, mass model)
  • erf.radiation.sw_cloud_omega, sw_cloud_g (real, optional, mass model)
  • erf.radiation.lw_mass_absorption_enable (bool, optional, default false)
  • erf.radiation.lw_kabs_dry (real, optional, default 1.0e-4 m^2/kg)
  • erf.radiation.lw_kabs_vapor (real, optional, default 0.1 m^2/kg)
  • erf.radiation.lw_kabs_cloud (real, optional, default 158.0 m^2/kg)
  • erf.radiation.surface_albedo_sw_diffuse (real, optional, default -1 = same as direct)
  • erf.radiation.v (int, optional, debug verbosity)
  • erf.radiation.diag_file (string, optional)
  • erf.radiation.tau_profile_type (string "constant"|"cloud_layer", optional)
  • erf.radiation.cloud_base_height_m (real, optional)
  • erf.radiation.cloud_top_height_m (real, optional)
  • erf.radiation.cloud_tau_per_layer (real, optional)
  • erf.radiation.cloud_fraction (real, optional)
  • erf.radiation.single_scattering_albedo (real, optional)
  • erf.radiation.asymmetry_factor (real, optional)
  • erf.radiation.cloud_single_scattering_albedo (real, optional)
  • erf.radiation.cloud_asymmetry_factor (real, optional)
  • erf.radiation.diag_enable (bool, optional, default false)
  • erf.radiation.diag_stdout_enable (bool, optional, default true)
  • erf.radiation.diag_tagged_enable (bool, optional, default true)
  • erf.radiation.diag_regtest_line_enable (bool, optional, default true)
  • erf.radiation.diag_csv_enable (bool, optional, default true)
  • erf.radiation.diag_callsite_mode (string, optional, default "both")
  • erf.radiation.diag_dedup_tol (real, optional, default 1e-12)
  • erf.radiation.tau_sw_dynamic_enable (bool, optional, default false)
  • erf.radiation.tau_lw_dynamic_enable (bool, optional, default false)
  • erf.radiation.tau_sw_coeff_qv (real, optional, default 0.0)
  • erf.radiation.tau_sw_coeff_qc (real, optional, default 0.0)
  • erf.radiation.tau_lw_coeff_qv (real, optional, default 0.0)
  • erf.radiation.tau_lw_coeff_qc (real, optional, default 0.0)
  • erf.radiation.cloud_fraction_prog_enable (bool, optional, default false)
  • erf.radiation.cloud_fraction_rh_min (real, optional, default 0.0)
  • erf.radiation.cloud_fraction_rh_max (real, optional, default 1.0)
  • erf.radiation.cloud_fraction_qc_scale (real, optional, default 1.0e-3)
  • erf.radiation.aerosol_enable (bool, optional, default false)
  • erf.radiation.aerosol_profile_type (string "constant"|"exponential"|"table", optional, default "constant")
  • erf.radiation.aerosol_tau_per_layer (real, optional, default 0.0)
  • erf.radiation.aerosol_scale_height_m (real, optional, default 2000.0)
  • erf.radiation.aerosol_tau_surface (real, optional, default 0.0)
  • erf.radiation.seb_enable (bool, optional, default false)
  • erf.radiation.seb_sw_flux_default (real, optional, default 0.0)
  • erf.radiation.seb_lw_flux_default (real, optional, default 0.0)
  • erf.radiation.seb_hfx_default (real, optional, default 0.0)
  • erf.radiation.seb_lh_default (real, optional, default 0.0)
  • erf.radiation.seb_grdflx_default (real, optional, default 0.0)
  • erf.radiation.seb_q_sfc_default (real, optional, default 0.0)
  • erf.radiation.seb_t_deep_default (real, optional, default 300.0)
  • erf.radiation.seb_q_deep_default (real, optional, default 0.0)
  • erf.radiation.seb_diagnostic_enable (bool, optional, default false)
  • erf.radiation.seb_prognostic_enable (bool, optional, default false)
  • erf.radiation.seb_surface_heat_capacity (real, optional, default 2.0e4, validated > 0)
  • erf.radiation.seb_restore_timescale_s (real, optional, default 86400.0, validated > 0)
  • erf.radiation.seb_moisture_layer_depth_m (real, optional, default 0.1, validated > 0)
  • erf.radiation.seb_moisture_restore_timescale_s (real, optional, default 86400.0, validated > 0)
  • erf.radiation.seb_prognostic_t_min_k (real, optional, default 200.0)
  • erf.radiation.seb_prognostic_t_max_k (real, optional, default 340.0)
  • erf.radiation.seb_prognostic_q_min (real, optional, default 0.0, clamped to [0, 1])
  • erf.radiation.seb_prognostic_q_max (real, optional, default 1.0, clamped to [0, 1])

Sub-option queries are only performed when the two-stream model is selected.

Bring an out-of-range input back into its valid range and say so. Every erf.radiation.* value with a physical range passes through one of these, so a typo in a deck is reported instead of silently corrected.

697  {
698  if (value < lo) {
699  if (amrex::ParallelDescriptor::IOProcessor()) {
700  amrex::Print() << "WARNING: erf.radiation." << key << " = " << value
701  << " is below its minimum " << lo << "; using " << lo << "\n";
702  }
703  value = lo;
704  }
705  }

Referenced by init_params().

Here is the caller graph for this function:

◆ init_params()

void RadChoice::init_params ( bool  two_stream_selected,
int  max_level,
std::string  pp_prefix 
)
inline
728  {
729  amrex::ParmParse pp(pp_prefix);
730  enabled = two_stream_selected;
731 
732  // The column sweep needs every box to hold the whole atmospheric column
733  // of its level, which fine-level boxes never do; there is no coarse-fine
734  // treatment of the fluxes yet either. Stop here with the reason rather
735  // than at the first fine-level radiation call.
736  if (enabled && max_level > 0) {
737  amrex::Abort("erf.radiation_model = TwoStream runs on a single level; "
738  "set amr.max_level = 0 or select another radiation model.");
739  }
740 
741  // Only query sub-options if the two-stream model is selected
742  if (enabled) {
743  pp.query("radiation.sw_enabled", sw_enabled);
744  pp.query("radiation.lw_enabled", lw_enabled);
745  pp.query("radiation.tau_per_layer", tau_per_layer);
746  pp.query("radiation.tau_lw_per_layer", tau_lw_per_layer);
747 
748  // The sun, the site and the surface temperature come from the keys the
749  // RRTMGP interface reads, so the two models share one set of inputs.
750  // ParmParse ignores a key nobody reads, so a deck still carrying one of
751  // the earlier two-stream-only keys would run with silently different
752  // settings: stop and name the replacement instead.
753  static const char* retired_keys[][2] = {
754  {"radiation.solar_zenith",
755  "erf.fixed_solar_zenith_angle, which is the cosine of the angle (60 degrees is 0.5)"},
756  {"radiation.solar_zenith_deg",
757  "erf.fixed_solar_zenith_angle, which is the cosine of the angle (60 degrees is 0.5)"},
758  {"radiation.S0", "erf.fixed_total_solar_irradiance"},
759  {"radiation.earth_sun_distance_enable",
760  "nothing: leave erf.fixed_total_solar_irradiance unset and the irradiance follows the date"},
761  {"radiation.surface_temp_k", "erf.rad_t_sfc"},
762  {"radiation.solar_geometry_dynamic_enable",
763  "nothing: leave erf.fixed_solar_zenith_angle unset and the sun follows start_datetime"},
764  {"radiation.latitude_deg", "erf.rad_cons_lat"},
765  {"radiation.longitude_deg", "erf.rad_cons_lon"},
766  {"radiation.day_of_year", "start_datetime"},
767  {"radiation.time_zone_offset_hours",
768  "nothing: start_datetime is UTC and the longitude sets the local solar time"},
769  };
770  for (const auto& entry : retired_keys) {
771  if (pp.contains(entry[0])) {
772  amrex::Abort(std::string("erf.") + entry[0] + " is no longer read by the "
773  "two-stream model; use " + entry[1] + ".");
774  }
775  }
776  pp.query("fixed_solar_zenith_angle", fixed_solar_zenith_angle);
777  if (fixed_solar_zenith_angle > 1.0) {
778  amrex::Abort("erf.fixed_solar_zenith_angle = " + std::to_string(fixed_solar_zenith_angle) +
779  " is the cosine of the solar zenith angle (as for RRTMGP) and cannot "
780  "exceed 1; 60 degrees is 0.5.");
781  }
782  pp.query("fixed_total_solar_irradiance", fixed_total_solar_irradiance);
783  if (!pp.query("rad_t_sfc", rad_t_sfc)) {
784  amrex::Abort("erf.radiation_model = TwoStream needs erf.rad_t_sfc, the surface "
785  "temperature [K] used where no land-surface model or surface layer "
786  "supplies one (the same input RRTMGP requires).");
787  }
788  if (!std::isfinite(rad_t_sfc) || rad_t_sfc <= 0.0) {
789  amrex::Abort("erf.rad_t_sfc = " + std::to_string(rad_t_sfc) + " must be a positive temperature [K].");
790  }
791  pp.query("rad_cons_lat", rad_cons_lat);
792  pp.query("rad_cons_lon", rad_cons_lon);
793  if (!std::isfinite(rad_cons_lat) || rad_cons_lat < -90.0 || rad_cons_lat > 90.0) {
794  amrex::Abort("erf.rad_cons_lat = " + std::to_string(rad_cons_lat) + " must lie in [-90, 90] degrees.");
795  }
796  if (!std::isfinite(rad_cons_lon) || rad_cons_lon < -180.0 || rad_cons_lon > 180.0) {
797  amrex::Abort("erf.rad_cons_lon = " + std::to_string(rad_cons_lon) + " must lie in [-180, 180] degrees.");
798  }
799  pp.query("rad_orbital_year", rad_orbital_year);
800  pp.query("rad_orbital_eccentricity", rad_orbital_eccentricity);
801  pp.query("rad_orbital_obliquity", rad_orbital_obliquity);
802  pp.query("rad_orbital_mvelp", rad_orbital_mvelp);
803  if (pp.contains("rad_freq_in_steps") && amrex::ParallelDescriptor::IOProcessor()) {
804  amrex::Print() << "WARNING: erf.rad_freq_in_steps is not read by the two-stream model, "
805  "which runs every step.\n";
806  }
807  std::string tau_model_str = "per_layer";
808  pp.query("radiation.tau_model", tau_model_str);
809  if (tau_model_str == "per_layer") {
810  tau_model = TauModel::PerLayer;
811  } else if (tau_model_str == "mass") {
812  tau_model = TauModel::Mass;
813  } else {
814  // The two models give very different column optical depths, so say so
815  // rather than let a misspelling quietly pick the default.
816  tau_model = TauModel::PerLayer;
817  if (amrex::ParallelDescriptor::IOProcessor()) {
818  amrex::Print() << "WARNING: unknown erf.radiation.tau_model '"
819  << tau_model_str << "'; valid values are per_layer "
820  "and mass. Using per_layer.\n";
821  }
822  }
823  pp.query("radiation.sw_kabs_dry", sw_kabs_dry);
824  pp.query("radiation.sw_kscat_dry", sw_kscat_dry);
825  pp.query("radiation.sw_kabs_vapor", sw_kabs_vapor);
826  pp.query("radiation.sw_kext_cloud", sw_kext_cloud);
827  pp.query("radiation.sw_cloud_omega", sw_cloud_omega);
828  pp.query("radiation.sw_cloud_g", sw_cloud_g);
829  clamp_low("sw_kabs_dry", sw_kabs_dry, 0.0);
830  clamp_low("sw_kscat_dry", sw_kscat_dry, 0.0);
831  clamp_low("sw_kabs_vapor", sw_kabs_vapor, 0.0);
832  clamp_low("sw_kext_cloud", sw_kext_cloud, 0.0);
833  clamp_low("sw_cloud_omega", sw_cloud_omega, 0.0);
834  clamp_high("sw_cloud_omega", sw_cloud_omega, 1.0);
835  clamp_low("sw_cloud_g", sw_cloud_g, -1.0);
836  clamp_high("sw_cloud_g", sw_cloud_g, 1.0);
837  pp.query("radiation.lw_mass_absorption_enable", lw_mass_absorption_enable);
838  pp.query("radiation.lw_kabs_dry", lw_kabs_dry);
839  pp.query("radiation.lw_kabs_vapor", lw_kabs_vapor);
840  pp.query("radiation.lw_kabs_cloud", lw_kabs_cloud);
841  clamp_low("lw_kabs_dry", lw_kabs_dry, 0.0);
842  clamp_low("lw_kabs_vapor", lw_kabs_vapor, 0.0);
843  clamp_low("lw_kabs_cloud", lw_kabs_cloud, 0.0);
844  pp.query("radiation.v", verbosity);
845  pp.query("radiation.diag_file", diag_file);
846 
847  // Cloud optical properties (all optional; the defaults leave the
848  // column clear-sky)
849  std::string tau_profile_type_str = "constant";
850  pp.query("radiation.tau_profile_type", tau_profile_type_str);
851  if (tau_profile_type_str == "constant") {
852  tau_profile_type = TauProfileType::Constant;
853  } else if (tau_profile_type_str == "cloud_layer") {
854  tau_profile_type = TauProfileType::CloudLayer;
855  } else {
856  // Falling back to constant drops a requested cloud layer, so say so.
857  tau_profile_type = TauProfileType::Constant;
858  if (amrex::ParallelDescriptor::IOProcessor()) {
859  amrex::Print() << "WARNING: unknown erf.radiation.tau_profile_type '"
860  << tau_profile_type_str << "'; valid values are "
861  "constant and cloud_layer. Using constant, so no "
862  "cloud layer is applied.\n";
863  }
864  }
865  pp.query("radiation.cloud_base_height_m", cloud_base_height_m);
866  pp.query("radiation.cloud_top_height_m", cloud_top_height_m);
867  pp.query("radiation.cloud_tau_per_layer", cloud_tau_per_layer);
868  pp.query("radiation.cloud_fraction", cloud_fraction);
869 
870  // Parameter validation (R5/R5'): clip cloud_fraction to [0, 1]
871  clamp_low("cloud_fraction", cloud_fraction, 0.0);
872  clamp_high("cloud_fraction", cloud_fraction, 1.0);
873  clamp_low("cloud_tau_per_layer", cloud_tau_per_layer, 0.0);
876  }
877 
878  // Scattering parameters (all optional; the defaults leave the
879  // shortwave direct-beam only)
880  pp.query("radiation.single_scattering_albedo", single_scattering_albedo);
881  pp.query("radiation.asymmetry_factor", asymmetry_factor);
882  pp.query("radiation.cloud_single_scattering_albedo", cloud_single_scattering_albedo);
883  pp.query("radiation.cloud_asymmetry_factor", cloud_asymmetry_factor);
884 
885  // Parameter validation (R5/R5'): clip albedos to [0, 1] and
886  // asymmetry factors to [-1, 1]
887  clamp_low("single_scattering_albedo", single_scattering_albedo, 0.0);
888  clamp_high("single_scattering_albedo", single_scattering_albedo, 1.0);
889  clamp_low("asymmetry_factor", asymmetry_factor, -1.0);
890  clamp_high("asymmetry_factor", asymmetry_factor, 1.0);
891  clamp_low("cloud_single_scattering_albedo", cloud_single_scattering_albedo, 0.0);
892  clamp_high("cloud_single_scattering_albedo", cloud_single_scattering_albedo, 1.0);
893  clamp_low("cloud_asymmetry_factor", cloud_asymmetry_factor, -1.0);
894  clamp_high("cloud_asymmetry_factor", cloud_asymmetry_factor, 1.0);
895 
896  // Runtime diagnostics controls (all optional; every channel is on
897  // by default)
898  pp.query("radiation.diag_enable", diag_enable);
899  pp.query("radiation.diag_stdout_enable", diag_stdout_enable);
900  pp.query("radiation.diag_tagged_enable", diag_tagged_enable);
901  pp.query("radiation.diag_regtest_line_enable", diag_regtest_line_enable);
902  pp.query("radiation.diag_csv_enable", diag_csv_enable);
903  pp.query("radiation.diag_callsite_mode", diag_callsite_mode);
904  pp.query("radiation.diag_dedup_tol", diag_dedup_tol);
905 
906  // Validate the call-site mode
907  if (diag_callsite_mode != "both" &&
908  diag_callsite_mode != "pre_only" &&
909  diag_callsite_mode != "post_only") {
910  if (amrex::ParallelDescriptor::IOProcessor()) {
911  amrex::Print() << "WARNING: unknown erf.radiation.diag_callsite_mode '"
912  << diag_callsite_mode << "'; valid values are both, "
913  "pre_only and post_only. Using both.\n";
914  }
915  diag_callsite_mode = "both";
916  }
917  // Ensure dedup tolerance is non-negative
918  clamp_low("diag_dedup_tol", diag_dedup_tol, 0.0);
919 
920  // Surface heterogeneity fallback parameters (all optional; only used
921  // when hetero
922  // LSM/radiation interface fields are absent or invalid)
923  pp.query("radiation.surface_albedo_sw", surface_albedo_sw);
924  pp.query("radiation.surface_emissivity_lw", surface_emissivity_lw);
925  pp.query("radiation.surface_albedo_sw_diffuse", surface_albedo_sw_diffuse);
926  clamp_high("surface_albedo_sw_diffuse", surface_albedo_sw_diffuse, 1.0);
927 
928  // Clamp albedo/emissivity to [0, 1]
929  clamp_low("surface_albedo_sw", surface_albedo_sw, 0.0);
930  clamp_high("surface_albedo_sw", surface_albedo_sw, 1.0);
931  clamp_low("surface_emissivity_lw", surface_emissivity_lw, 0.0);
932  clamp_high("surface_emissivity_lw", surface_emissivity_lw, 1.0);
933 
934  // Dynamic optical depth diagnosis from moisture/clouds
935  // (all optional; disabled by default)
936  pp.query("radiation.tau_sw_dynamic_enable", tau_sw_dynamic_enable);
937  pp.query("radiation.tau_lw_dynamic_enable", tau_lw_dynamic_enable);
938  pp.query("radiation.tau_sw_coeff_qv", tau_sw_coeff_qv);
939  pp.query("radiation.tau_sw_coeff_qc", tau_sw_coeff_qc);
940  pp.query("radiation.tau_lw_coeff_qv", tau_lw_coeff_qv);
941  pp.query("radiation.tau_lw_coeff_qc", tau_lw_coeff_qc);
942 
943  // Clamp the dynamic tau coefficients
944  // to nonnegative (negative would give unphysical behavior)
945  clamp_low("tau_sw_coeff_qv", tau_sw_coeff_qv, 0.0);
946  clamp_low("tau_sw_coeff_qc", tau_sw_coeff_qc, 0.0);
947  clamp_low("tau_lw_coeff_qv", tau_lw_coeff_qv, 0.0);
948  clamp_low("tau_lw_coeff_qc", tau_lw_coeff_qc, 0.0);
949 
950  // Prognostic cloud fraction diagnosis from RH/qc
951  // (all optional; disabled by default)
952  pp.query("radiation.cloud_fraction_prog_enable", cloud_fraction_prog_enable);
953  pp.query("radiation.cloud_fraction_rh_min", cloud_fraction_rh_min);
954  pp.query("radiation.cloud_fraction_rh_max", cloud_fraction_rh_max);
955  pp.query("radiation.cloud_fraction_qc_scale", cloud_fraction_qc_scale);
956 
957  // Clamp the cloud fraction parameters
958  // to physically reasonable ranges
959  clamp_low("cloud_fraction_rh_min", cloud_fraction_rh_min, 0.0);
960  clamp_high("cloud_fraction_rh_min", cloud_fraction_rh_min, 1.0);
961  clamp_low("cloud_fraction_rh_max", cloud_fraction_rh_max, 0.0);
962  clamp_high("cloud_fraction_rh_max", cloud_fraction_rh_max, 1.0);
965  }
966  clamp_low("cloud_fraction_qc_scale", cloud_fraction_qc_scale, 0.0);
967 
968  // Prescribed bulk aerosol/turbidity optical depth
969  // (all optional; disabled by default)
970  pp.query("radiation.aerosol_enable", aerosol_enable);
971 
972  // Parse aerosol profile type as string
973  std::string aerosol_profile_type_str = "constant";
974  pp.query("radiation.aerosol_profile_type", aerosol_profile_type_str);
975  if (aerosol_profile_type_str == "constant") {
976  aerosol_profile_type = AerosolProfileType::Constant;
977  } else if (aerosol_profile_type_str == "exponential") {
978  aerosol_profile_type = AerosolProfileType::Exponential;
979  } else if (aerosol_profile_type_str == "table") {
980  // The table lookup is not implemented and contributes no optical
981  // depth. Keep the selection so the run is not silently given a
982  // different profile, and say what it means.
983  aerosol_profile_type = AerosolProfileType::Table;
984  if (amrex::ParallelDescriptor::IOProcessor()) {
985  amrex::Print() << "WARNING: erf.radiation.aerosol_profile_type = table is "
986  "not implemented and contributes no aerosol optical "
987  "depth. Use constant or exponential.\n";
988  }
989  } else {
990  // Falling through to constant would hide a misspelling.
991  aerosol_profile_type = AerosolProfileType::Constant;
992  if (amrex::ParallelDescriptor::IOProcessor()) {
993  amrex::Print() << "WARNING: unknown erf.radiation.aerosol_profile_type '"
994  << aerosol_profile_type_str << "'; valid values are "
995  "constant and exponential. Using constant.\n";
996  }
997  }
998 
999  pp.query("radiation.aerosol_tau_per_layer", aerosol_tau_per_layer);
1000  pp.query("radiation.aerosol_scale_height_m", aerosol_scale_height_m);
1001  pp.query("radiation.aerosol_tau_surface", aerosol_tau_surface);
1002 
1003  // Clamp the aerosol parameters
1004  // to physically reasonable ranges
1005  clamp_low("aerosol_tau_per_layer", aerosol_tau_per_layer, 0.0);
1006  clamp_low("aerosol_tau_surface", aerosol_tau_surface, 0.0);
1007  reset_nonpositive("aerosol_scale_height_m", aerosol_scale_height_m, 2000.0);
1008 
1009  // Simplified SEB infrastructure fallback parameters
1010  pp.query("radiation.seb_enable", seb_enable);
1011  pp.query("radiation.seb_use_radiation_fluxes", seb_use_radiation_fluxes);
1012  pp.query("radiation.seb_sw_flux_default", seb_sw_flux_default);
1013  pp.query("radiation.seb_lw_flux_default", seb_lw_flux_default);
1014  pp.query("radiation.seb_hfx_default", seb_hfx_default);
1015  pp.query("radiation.seb_lh_default", seb_lh_default);
1016  pp.query("radiation.seb_grdflx_default", seb_grdflx_default);
1017  pp.query("radiation.seb_q_sfc_default", seb_q_sfc_default);
1018  pp.query("radiation.seb_t_deep_default", seb_t_deep_default);
1019  pp.query("radiation.seb_q_deep_default", seb_q_deep_default);
1020 
1021  // SEB diagnostic mode
1022  pp.query("radiation.seb_diagnostic_enable", seb_diagnostic_enable);
1023 
1024  // Auto-enable seb_enable if seb_diagnostic_enable is requested but seb_enable is false
1026  seb_enable = true; // Internal auto-enable for safety/simplicity
1027  }
1028 
1029  // SEB prognostic mode parameters
1030  pp.query("radiation.seb_prognostic_enable", seb_prognostic_enable);
1031  pp.query("radiation.seb_surface_heat_capacity", seb_surface_heat_capacity);
1032  pp.query("radiation.seb_restore_timescale_s", seb_restore_timescale_s);
1033  pp.query("radiation.seb_moisture_layer_depth_m", seb_moisture_layer_depth_m);
1034  pp.query("radiation.seb_moisture_restore_timescale_s", seb_moisture_restore_timescale_s);
1035  pp.query("radiation.seb_prognostic_t_min_k", seb_prognostic_t_min_k);
1036  pp.query("radiation.seb_prognostic_t_max_k", seb_prognostic_t_max_k);
1037  pp.query("radiation.seb_prognostic_q_min", seb_prognostic_q_min);
1038  pp.query("radiation.seb_prognostic_q_max", seb_prognostic_q_max);
1039 
1040  // The prognostic update needs the SEB fields and the residual, so
1041  // requesting it turns on the infrastructure it depends on. Report that,
1042  // since it changes settings the user did not set.
1044  if (amrex::ParallelDescriptor::IOProcessor()) {
1045  amrex::Print() << "NOTE: erf.radiation.seb_prognostic_enable = true "
1046  "also enables seb_enable and "
1047  "seb_diagnostic_enable, which it depends on.\n";
1048  }
1049  seb_enable = true;
1050  seb_diagnostic_enable = true;
1051  }
1052 
1053  if (!std::isfinite(seb_sw_flux_default)) seb_sw_flux_default = 0.0;
1054  if (!std::isfinite(seb_lw_flux_default)) seb_lw_flux_default = 0.0;
1055  if (!std::isfinite(seb_hfx_default)) seb_hfx_default = 0.0;
1056  if (!std::isfinite(seb_lh_default)) seb_lh_default = 0.0;
1057  if (!std::isfinite(seb_grdflx_default)) seb_grdflx_default = 0.0;
1058  if (!std::isfinite(seb_q_sfc_default)) seb_q_sfc_default = 0.0;
1059  reset_nonpositive("seb_t_deep_default", seb_t_deep_default, 300.0);
1060  if (!std::isfinite(seb_q_deep_default)) seb_q_deep_default = 0.0;
1061 
1062  seb_sw_flux_default = amrex::max(amrex::Real(-2000.0), amrex::min(amrex::Real(2000.0), seb_sw_flux_default));
1063  seb_lw_flux_default = amrex::max(amrex::Real(-2000.0), amrex::min(amrex::Real(2000.0), seb_lw_flux_default));
1064  seb_hfx_default = amrex::max(amrex::Real(-2000.0), amrex::min(amrex::Real(2000.0), seb_hfx_default));
1065  seb_lh_default = amrex::max(amrex::Real(-2000.0), amrex::min(amrex::Real(2000.0), seb_lh_default));
1066  seb_grdflx_default = amrex::max(amrex::Real(-2000.0), amrex::min(amrex::Real(2000.0), seb_grdflx_default));
1067  seb_q_sfc_default = amrex::max(amrex::Real(0.0), amrex::min(amrex::Real(1.0), seb_q_sfc_default));
1068  seb_q_deep_default = amrex::max(amrex::Real(0.0), amrex::min(amrex::Real(1.0), seb_q_deep_default));
1069 
1070 
1071  // Validate the prognostic parameters
1072  if (!std::isfinite(seb_surface_heat_capacity) || seb_surface_heat_capacity <= 0.0) {
1073  seb_surface_heat_capacity = 2.0e4; // Reset to default
1074  }
1075  if (!std::isfinite(seb_restore_timescale_s) || seb_restore_timescale_s <= 0.0) {
1076  seb_restore_timescale_s = 86400.0; // Reset to default
1077  }
1078  if (!std::isfinite(seb_moisture_layer_depth_m) || seb_moisture_layer_depth_m <= 0.0) {
1079  seb_moisture_layer_depth_m = 0.1; // Reset to default
1080  }
1082  seb_moisture_restore_timescale_s = 86400.0; // Reset to default
1083  }
1084 
1085  // Clamp temperature bounds
1086  if (!std::isfinite(seb_prognostic_t_min_k)) seb_prognostic_t_min_k = 200.0;
1087  if (!std::isfinite(seb_prognostic_t_max_k)) seb_prognostic_t_max_k = 340.0;
1092  }
1093 
1094  // Clamp moisture bounds
1095  if (!std::isfinite(seb_prognostic_q_min)) seb_prognostic_q_min = 0.0;
1096  if (!std::isfinite(seb_prognostic_q_max)) seb_prognostic_q_max = 1.0;
1097  seb_prognostic_q_min = amrex::max(amrex::Real(0.0), amrex::min(amrex::Real(1.0), seb_prognostic_q_min));
1098  seb_prognostic_q_max = amrex::max(amrex::Real(0.0), amrex::min(amrex::Real(1.0), seb_prognostic_q_max));
1103  }
1104  }
1105 
1106 }
ParmParse pp("prob")
amrex::Real Real
Definition: ERF_ShocInterface.H:19
@ tmp
Definition: ERF_AdvanceWSM6.cpp:116
amrex::Real lw_kabs_dry
Dry-air gray LW mass absorption coefficient [m^2/kg].
Definition: ERF_RadStruct.H:188
bool aerosol_enable
Enable prescribed bulk aerosol/turbidity optical depth. When true, aerosol optical depth is added on ...
Definition: ERF_RadStruct.H:577
TauModel tau_model
Optical depth model: "per_layer" (default, fixed tau per layer) or "mass" (from the layer mass path i...
Definition: ERF_RadStruct.H:155
amrex::Real sw_kabs_vapor
Mass model, SW: water-vapor gray absorption coefficient [m^2/kg].
Definition: ERF_RadStruct.H:164
amrex::Real cloud_top_height_m
Cloud layer top height [m]. Only used when tau_profile_type == CloudLayer. Must be >= cloud_base_heig...
Definition: ERF_RadStruct.H:276
static void reset_nonpositive(const char *key, amrex::Real &value, amrex::Real fallback)
Definition: ERF_RadStruct.H:716
amrex::Real aerosol_tau_surface
Total-column aerosol optical depth at surface [dimensionless]. Used for AerosolProfileType::Exponenti...
Definition: ERF_RadStruct.H:609
int rad_orbital_year
erf.rad_orbital_year and the orbital overrides: negative means the year of the timestamp and the Berg...
Definition: ERF_RadStruct.H:145
amrex::Real fixed_solar_zenith_angle
erf.fixed_solar_zenith_angle: the COSINE of the solar zenith angle (mu0), as RRTMGP takes it,...
Definition: ERF_RadStruct.H:120
bool sw_enabled
Enable shortwave (solar) radiation computation. Only used by the two-stream model.
Definition: ERF_RadStruct.H:82
amrex::Real cloud_asymmetry_factor
Cloud scattering asymmetry factor in [-1, 1], used instead of asymmetry_factor for levels where the c...
Definition: ERF_RadStruct.H:331
std::string diag_file
Output file path for radiation diagnostics CSV. Paths are relative to the simulation working director...
Definition: ERF_RadStruct.H:206
static void clamp_high(const char *key, amrex::Real &value, amrex::Real hi)
Definition: ERF_RadStruct.H:706
amrex::Real tau_lw_per_layer
Longwave optical depth per layer (constant for all layers). Used in gray-gas LW two-stream solver....
Definition: ERF_RadStruct.H:102
amrex::Real surface_albedo_sw
Shortwave surface albedo fallback [0, 1] for per-column heterogeneous-surface-property resolution....
Definition: ERF_RadStruct.H:340
amrex::Real surface_emissivity_lw
Longwave surface emissivity fallback [0, 1] for per-column heterogeneous-surface-property resolution....
Definition: ERF_RadStruct.H:355
amrex::Real rad_orbital_mvelp
Definition: ERF_RadStruct.H:148
amrex::Real seb_grdflx_default
Fallback SEB ground heat flux [W/m^2].
Definition: ERF_RadStruct.H:396
amrex::Real diag_dedup_tol
Tolerance for time equality in duplicate guard [s]. Times within this tolerance are considered equal....
Definition: ERF_RadStruct.H:257
amrex::Real seb_restore_timescale_s
Force-restore timescale for surface temperature [s]. Relaxation time constant toward T_deep in progno...
Definition: ERF_RadStruct.H:446
std::string diag_callsite_mode
Call-site filtering mode: "both" (pre+post rows), "pre_only", or "post_only".
Definition: ERF_RadStruct.H:250
bool diag_regtest_line_enable
Enable RADIATION_DIAG: line emission. Controls regtest-parsing diagnostics line. Default true.
Definition: ERF_RadStruct.H:237
amrex::Real sw_kext_cloud
Mass model, SW: cloud-water extinction coefficient m^2/kg.
Definition: ERF_RadStruct.H:167
amrex::Real tau_sw_coeff_qv
Shortwave optical depth coefficient for water vapor [dimensionless]. Dynamic SW tau = tau_sw_coeff_qv...
Definition: ERF_RadStruct.H:513
amrex::Real fixed_total_solar_irradiance
erf.fixed_total_solar_irradiance: top-of-atmosphere irradiance [W/m^2] when >= 0. Otherwise (default)...
Definition: ERF_RadStruct.H:127
bool tau_lw_dynamic_enable
Enable dynamic longwave optical depth diagnosis from moisture/clouds. When true, LW optical depth is ...
Definition: ERF_RadStruct.H:504
amrex::Real seb_lh_default
Fallback SEB latent heat flux [W/m^2].
Definition: ERF_RadStruct.H:391
amrex::Real seb_moisture_restore_timescale_s
Force-restore timescale for surface moisture [s]. Relaxation time constant toward q_deep in prognosti...
Definition: ERF_RadStruct.H:462
amrex::Real seb_lw_flux_default
Fallback SEB surface net longwave flux [W/m^2].
Definition: ERF_RadStruct.H:381
amrex::Real tau_sw_coeff_qc
Shortwave optical depth coefficient for cloud liquid water [dimensionless]. Default 0....
Definition: ERF_RadStruct.H:521
amrex::Real aerosol_tau_per_layer
Constant aerosol optical depth per layer [dimensionless]. Used for AerosolProfileType::Constant profi...
Definition: ERF_RadStruct.H:593
amrex::Real seb_q_sfc_default
Fallback SEB surface moisture [kg/kg].
Definition: ERF_RadStruct.H:401
amrex::Real rad_orbital_eccentricity
Definition: ERF_RadStruct.H:146
amrex::Real single_scattering_albedo
Clear-sky (background gas) single-scattering albedo in [0, 1] for the SW diffuse (scattering) two-str...
Definition: ERF_RadStruct.H:302
bool diag_csv_enable
Enable CSV file append behavior. When false, no file writes; other enabled streams may still print....
Definition: ERF_RadStruct.H:244
bool tau_sw_dynamic_enable
Definition: ERF_RadStruct.H:505
amrex::Real seb_t_deep_default
Fallback SEB deep soil temperature [K].
Definition: ERF_RadStruct.H:406
AerosolProfileType aerosol_profile_type
Aerosol optical depth profile type: Constant, Exponential, or Table.
Definition: ERF_RadStruct.H:586
amrex::Real seb_prognostic_t_max_k
Maximum clamping bound for prognostic surface temperature [K]. After each Euler update,...
Definition: ERF_RadStruct.H:479
amrex::Real rad_t_sfc
erf.rad_t_sfc: surface temperature [K] used as the longwave boundary condition wherever no land-surfa...
Definition: ERF_RadStruct.H:135
bool seb_prognostic_enable
Enable prognostic SEB surface temperature and moisture evolution. When true, integrates SEB residual ...
Definition: ERF_RadStruct.H:430
bool seb_use_radiation_fluxes
Take the SEB's net surface shortwave and longwave fluxes from the two-stream sweep itself (per column...
Definition: ERF_RadStruct.H:371
amrex::Real seb_prognostic_t_min_k
Minimum clamping bound for prognostic surface temperature [K]. After each Euler update,...
Definition: ERF_RadStruct.H:471
amrex::Real tau_lw_coeff_qc
Longwave optical depth coefficient for cloud liquid water [dimensionless]. Default 0....
Definition: ERF_RadStruct.H:537
amrex::Real rad_orbital_obliquity
Definition: ERF_RadStruct.H:147
amrex::Real cloud_fraction
Cloud fraction in [0, 1] used to blend clear-sky and cloudy-column fluxes: F = (1 - cloud_fraction) *...
Definition: ERF_RadStruct.H:292
amrex::Real cloud_single_scattering_albedo
Cloud single-scattering albedo in [0, 1], used instead of single_scattering_albedo for levels where t...
Definition: ERF_RadStruct.H:322
amrex::Real lw_kabs_cloud
Cloud-water LW mass absorption coefficient m^2/kg.
Definition: ERF_RadStruct.H:194
amrex::Real sw_cloud_omega
Mass model, SW: cloud-water single-scattering albedo.
Definition: ERF_RadStruct.H:170
amrex::Real sw_kscat_dry
Mass model, SW: dry-air (Rayleigh) scattering coefficient [m^2/kg], omega = 1, g = 0.
Definition: ERF_RadStruct.H:161
amrex::Real sw_kabs_dry
Mass model, SW: dry-air gray absorption coefficient [m^2/kg].
Definition: ERF_RadStruct.H:158
amrex::Real asymmetry_factor
Clear-sky (background gas) scattering asymmetry factor in [-1, 1] (0 = isotropic scattering,...
Definition: ERF_RadStruct.H:310
static void clamp_low(const char *key, amrex::Real &value, amrex::Real lo)
Read radiation options from the input parameter database.
Definition: ERF_RadStruct.H:696
amrex::Real cloud_fraction_qc_scale
Cloud water [kg/kg] at which the liquid-water term alone gives a cloud fraction of 1: cf += min(1,...
Definition: ERF_RadStruct.H:569
bool cloud_fraction_prog_enable
Enable prognostic cloud fraction diagnosis from RH/qc. When true, cloud fraction is computed per-leve...
Definition: ERF_RadStruct.H:545
amrex::Real seb_prognostic_q_max
Maximum clamping bound for prognostic surface moisture [kg/kg]. After each Euler update,...
Definition: ERF_RadStruct.H:495
bool lw_enabled
Enable longwave (thermal) radiation computation. Only used by the two-stream model.
Definition: ERF_RadStruct.H:88
amrex::Real surface_albedo_sw_diffuse
Shortwave surface albedo for diffuse light [0,1]. A negative value (default) uses surface_albedo_sw f...
Definition: ERF_RadStruct.H:346
amrex::Real cloud_base_height_m
Cloud layer base height [m]. Only used when tau_profile_type == CloudLayer.
Definition: ERF_RadStruct.H:270
amrex::Real lw_kabs_vapor
Water-vapor gray LW mass absorption coefficient [m^2/kg].
Definition: ERF_RadStruct.H:191
amrex::Real tau_per_layer
Shortwave optical depth per layer (constant for all layers). Used in Beer-Lambert direct-beam formula...
Definition: ERF_RadStruct.H:95
amrex::Real seb_moisture_layer_depth_m
Effective surface moisture layer depth [m]. Used in force-restore prognostic q_s equation: dq_s/dt = ...
Definition: ERF_RadStruct.H:454
amrex::Real tau_lw_coeff_qv
Longwave optical depth coefficient for water vapor [dimensionless]. Dynamic LW tau = tau_lw_coeff_qv ...
Definition: ERF_RadStruct.H:529
amrex::Real seb_hfx_default
Fallback SEB sensible heat flux [W/m^2].
Definition: ERF_RadStruct.H:386
amrex::Real cloud_fraction_rh_max
Maximum relative humidity threshold for cloud fraction diagnosis [0, 1]. Must be >= cloud_fraction_rh...
Definition: ERF_RadStruct.H:561
amrex::Real sw_cloud_g
Mass model, SW: cloud-water asymmetry factor.
Definition: ERF_RadStruct.H:173
amrex::Real rad_cons_lon
Definition: ERF_RadStruct.H:139
bool lw_mass_absorption_enable
Gray longwave optical depth from the layer mass path instead of the fixed tau_lw_per_layer (also sele...
Definition: ERF_RadStruct.H:185
amrex::Real cloud_tau_per_layer
Additional optical depth per layer contributed by the cloud, added on top of the clear-sky tau_per_la...
Definition: ERF_RadStruct.H:284
amrex::Real aerosol_scale_height_m
Scale height for exponential aerosol profile [m]. Controls decay rate: tau_aerosol(k) = aerosol_tau_s...
Definition: ERF_RadStruct.H:601
bool diag_tagged_enable
Enable tagged [RAD][...] debug lines. Controls emission of bracketed-tag debug output....
Definition: ERF_RadStruct.H:230
amrex::Real seb_q_deep_default
Fallback SEB deep soil moisture [kg/kg].
Definition: ERF_RadStruct.H:411
amrex::Real rad_cons_lat
erf.rad_cons_lat / erf.rad_cons_lon: site latitude and longitude [degrees] when the grid has no lat/l...
Definition: ERF_RadStruct.H:138
amrex::Real seb_sw_flux_default
Fallback SEB surface net shortwave flux [W/m^2].
Definition: ERF_RadStruct.H:376
bool diag_enable
Master switch for radiation diagnostics emission. When false, no diagnostics output (stdout/tagged/re...
Definition: ERF_RadStruct.H:216
amrex::Real seb_prognostic_q_min
Minimum clamping bound for prognostic surface moisture [kg/kg]. After each Euler update,...
Definition: ERF_RadStruct.H:487
amrex::Real cloud_fraction_rh_min
Minimum relative humidity threshold for cloud fraction diagnosis [0, 1]. Cloud fraction ramps from 0 ...
Definition: ERF_RadStruct.H:553
bool seb_enable
Master switch for simplified SEB infrastructure. When false (default), no SEB MultiFabs are allocated...
Definition: ERF_RadStruct.H:361
bool diag_stdout_enable
Enable human-readable stdout diagnostics block. Controls tagged [RAD][...] debug line emission (when ...
Definition: ERF_RadStruct.H:223
bool enabled
True when erf.radiation_model = TwoStream. Set by init_params from the model SolverChoice read; the e...
Definition: ERF_RadStruct.H:76
int verbosity
Debug verbosity level (0=off, 1+=debug output). Gated debug prints only emit when this is >= 1.
Definition: ERF_RadStruct.H:200
amrex::Real seb_surface_heat_capacity
Effective surface heat capacity [J/(m^2*K)]. Used in force-restore prognostic T_s equation: dT_s/dt =...
Definition: ERF_RadStruct.H:438
TauProfileType tau_profile_type
Optical depth profile type: "constant" (default, the thickness-independent tau) or "cloud_layer" (add...
Definition: ERF_RadStruct.H:264
bool seb_diagnostic_enable
Enable diagnostic SEB residual computation and reporting. When true, computes and reports SEB residua...
Definition: ERF_RadStruct.H:421

Referenced by SolverChoice::init_params().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset_nonpositive()

static void RadChoice::reset_nonpositive ( const char *  key,
amrex::Real value,
amrex::Real  fallback 
)
inlinestatic
717  {
718  if (!std::isfinite(value) || value <= 0.0) {
719  if (amrex::ParallelDescriptor::IOProcessor()) {
720  amrex::Print() << "WARNING: erf.radiation." << key << " = " << value
721  << " must be positive; using " << fallback << "\n";
722  }
723  value = fallback;
724  }
725  }

Referenced by init_params().

Here is the caller graph for this function:

◆ uses_two_stream_radiation()

bool RadChoice::uses_two_stream_radiation ( ) const
inlinenoexcept

Check if two-stream radiation is active.

Returns
true when erf.radiation_model = TwoStream.
1114  {
1115  return enabled;
1116  }

Member Data Documentation

◆ aerosol_enable

bool RadChoice::aerosol_enable = false

Enable prescribed bulk aerosol/turbidity optical depth. When true, aerosol optical depth is added on top of existing tau_base + cloud + dynamic-moisture contributions. When false (default), there is no aerosol contribution. Only used by the two-stream model and sw_enabled == true.

Referenced by init_params(), and make_two_stream_params().

◆ aerosol_profile_type

AerosolProfileType RadChoice::aerosol_profile_type = AerosolProfileType::Constant

Aerosol optical depth profile type: Constant, Exponential, or Table.

  • Constant: uniform aerosol tau per layer (aerosol_tau_per_layer).
  • Exponential: tau decays with height via tau_aerosol(k) = aerosol_tau_surface * exp(-z(k) / aerosol_scale_height_m).
  • Table: per-level tau prescribed via lookup (future extension, currently not supported). Default Constant. Only used when aerosol_enable == true.

Referenced by init_params(), and make_two_stream_params().

◆ aerosol_scale_height_m

amrex::Real RadChoice::aerosol_scale_height_m = 2000.0

Scale height for exponential aerosol profile [m]. Controls decay rate: tau_aerosol(k) = aerosol_tau_surface * exp(-z(k) / scale_height). Default 2000.0 m (typical scale height for tropospheric aerosols). Only used when aerosol_enable == true and aerosol_profile_type == Exponential.

Referenced by init_params(), and make_two_stream_params().

◆ aerosol_tau_per_layer

amrex::Real RadChoice::aerosol_tau_per_layer = 0.0

Constant aerosol optical depth per layer [dimensionless]. Used for AerosolProfileType::Constant profile. Default 0.0 (no aerosol contribution). Only used when aerosol_enable == true and aerosol_profile_type == Constant.

Referenced by init_params(), and make_two_stream_params().

◆ aerosol_tau_surface

amrex::Real RadChoice::aerosol_tau_surface = 0.0

Total-column aerosol optical depth at surface [dimensionless]. Used for AerosolProfileType::Exponential profile as the surface boundary condition. Default 0.0 (no aerosol contribution). Only used when aerosol_enable == true and aerosol_profile_type == Exponential.

Referenced by init_params(), and make_two_stream_params().

◆ asymmetry_factor

amrex::Real RadChoice::asymmetry_factor = 0.0

Clear-sky (background gas) scattering asymmetry factor in [-1, 1] (0 = isotropic scattering, close to 1 = strongly forward-scattering). Only meaningful when single_scattering_albedo

0. Default 0.0.

Referenced by init_params(), and make_two_stream_params().

◆ cloud_asymmetry_factor

amrex::Real RadChoice::cloud_asymmetry_factor = 0.0

Cloud scattering asymmetry factor in [-1, 1], used instead of asymmetry_factor for levels where the cloud-layer optical depth enhancement applies. Default 0.0. Typical liquid water cloud droplet values are around 0.85 (strongly forward-scattering). Only meaningful when cloud_single_scattering_albedo > 0.

Referenced by init_params(), and make_two_stream_params().

◆ cloud_base_height_m

amrex::Real RadChoice::cloud_base_height_m = 500.0

Cloud layer base height [m]. Only used when tau_profile_type == CloudLayer.

Referenced by init_params(), and make_two_stream_params().

◆ cloud_fraction

amrex::Real RadChoice::cloud_fraction = 0.0

Cloud fraction in [0, 1] used to blend clear-sky and cloudy-column fluxes: F = (1 - cloud_fraction) * F_clear + cloud_fraction * F_cloudy. Default 0.0 (fully clear sky), which reduces exactly to the clear-sky column regardless of tau_profile_type.

Referenced by TwoStreamRadiation::advance(), and init_params().

◆ cloud_fraction_prog_enable

bool RadChoice::cloud_fraction_prog_enable = false

Enable prognostic cloud fraction diagnosis from RH/qc. When true, cloud fraction is computed per-level from relative humidity and cloud water. When false (default), uses the static cloud_fraction. Only used by the two-stream model.

Referenced by init_params(), and make_two_stream_params().

◆ cloud_fraction_qc_scale

amrex::Real RadChoice::cloud_fraction_qc_scale = 1.0e-3

Cloud water [kg/kg] at which the liquid-water term alone gives a cloud fraction of 1: cf += min(1, qc / cloud_fraction_qc_scale). Default 1.0e-3 kg/kg, so a typical stratus cloud water saturates the term. Only used when cloud_fraction_prog_enable == true.

Referenced by init_params(), and make_two_stream_params().

◆ cloud_fraction_rh_max

amrex::Real RadChoice::cloud_fraction_rh_max = 1.0

Maximum relative humidity threshold for cloud fraction diagnosis [0, 1]. Must be >= cloud_fraction_rh_min. Cloud fraction saturates to 1 at this RH. Default 1.0 means cloud fraction increases linearly from rh_min to 1.0 RH. Only used when cloud_fraction_prog_enable == true.

Referenced by init_params(), and make_two_stream_params().

◆ cloud_fraction_rh_min

amrex::Real RadChoice::cloud_fraction_rh_min = 0.0

Minimum relative humidity threshold for cloud fraction diagnosis [0, 1]. Cloud fraction ramps from 0 at rh < cloud_fraction_rh_min to 1 at rh >= cloud_fraction_rh_max. Default 0.0 means cloud fraction depends primarily on qc content. Only used when cloud_fraction_prog_enable == true.

Referenced by init_params(), and make_two_stream_params().

◆ cloud_single_scattering_albedo

amrex::Real RadChoice::cloud_single_scattering_albedo = 0.0

Cloud single-scattering albedo in [0, 1], used instead of single_scattering_albedo for levels where the cloud-layer optical depth enhancement applies (i.e., within [cloud_base_height_m, cloud_top_height_m] on the "cloudy" column evaluation). Default 0.0 leaves the cloud band non-scattering for SW_Cloud_Layer unless explicitly configured otherwise. Typical liquid water cloud values are close to 1 (e.g., 0.9999). Only used when tau_profile_type == CloudLayer.

Referenced by init_params(), and make_two_stream_params().

◆ cloud_tau_per_layer

amrex::Real RadChoice::cloud_tau_per_layer = 0.5

Additional optical depth per layer contributed by the cloud, added on top of the clear-sky tau_per_layer/tau_lw_per_layer background within [cloud_base_height_m, cloud_top_height_m]. Only used when tau_profile_type == CloudLayer.

Referenced by init_params(), and make_two_stream_params().

◆ cloud_top_height_m

amrex::Real RadChoice::cloud_top_height_m = 1000.0

Cloud layer top height [m]. Only used when tau_profile_type == CloudLayer. Must be >= cloud_base_height_m.

Referenced by init_params(), and make_two_stream_params().

◆ diag_callsite_mode

std::string RadChoice::diag_callsite_mode = "both"

Call-site filtering mode: "both" (pre+post rows), "pre_only", or "post_only".

Referenced by TwoStreamRadiation::advance(), and init_params().

◆ diag_csv_enable

bool RadChoice::diag_csv_enable = true

Enable CSV file append behavior. When false, no file writes; other enabled streams may still print. Default true.

Referenced by TwoStreamRadiation::advance(), and init_params().

◆ diag_dedup_tol

amrex::Real RadChoice::diag_dedup_tol = 1.0e-12

Tolerance for time equality in duplicate guard [s]. Times within this tolerance are considered equal. Default 1e-12.

Referenced by TwoStreamRadiation::advance(), and init_params().

◆ diag_enable

bool RadChoice::diag_enable = false

Master switch for radiation diagnostics emission. When false, no diagnostics output (stdout/tagged/regtest/csv). Default false: a run that did not ask for the diagnostics should not write a CSV row and a stdout block on every step. The per-stream switches below stay on by default, so setting this one input to true turns the whole set on.

Referenced by TwoStreamRadiation::advance(), and init_params().

◆ diag_file

std::string RadChoice::diag_file = "radiation_diag.dat"

Output file path for radiation diagnostics CSV. Paths are relative to the simulation working directory.

Referenced by TwoStreamRadiation::advance(), and init_params().

◆ diag_regtest_line_enable

bool RadChoice::diag_regtest_line_enable = true

Enable RADIATION_DIAG: line emission. Controls regtest-parsing diagnostics line. Default true.

Referenced by TwoStreamRadiation::advance(), and init_params().

◆ diag_stdout_enable

bool RadChoice::diag_stdout_enable = true

Enable human-readable stdout diagnostics block. Controls tagged [RAD][...] debug line emission (when verbosity >= 1). Default true.

Referenced by TwoStreamRadiation::advance(), and init_params().

◆ diag_tagged_enable

bool RadChoice::diag_tagged_enable = true

Enable tagged [RAD][...] debug lines. Controls emission of bracketed-tag debug output. Default true.

Referenced by TwoStreamRadiation::advance(), and init_params().

◆ enabled

bool RadChoice::enabled = false

True when erf.radiation_model = TwoStream. Set by init_params from the model SolverChoice read; the erf.radiation.* sub-options are read only then.

Referenced by TwoStreamRadiation::active(), TwoStreamRadiation::define_level(), init_params(), and uses_two_stream_radiation().

◆ fixed_solar_zenith_angle

amrex::Real RadChoice::fixed_solar_zenith_angle = -9999.0

erf.fixed_solar_zenith_angle: the COSINE of the solar zenith angle (mu0), as RRTMGP takes it, applied to every column when > 0. Otherwise (default) the sun follows the calendar: start_datetime sets the date and time, the position is evaluated at rad_cons_lat/lon or at the per-column latitude and longitude when the grid carries them.

Referenced by init_params(), and make_two_stream_params().

◆ fixed_total_solar_irradiance

amrex::Real RadChoice::fixed_total_solar_irradiance = -9999.0

erf.fixed_total_solar_irradiance: top-of-atmosphere irradiance [W/m^2] when >= 0. Otherwise (default) 1360.9 W/m^2 scaled by the Earth-Sun distance factor of the date, as RRTMGP does.

Referenced by init_params(), and make_two_stream_params().

◆ lw_enabled

bool RadChoice::lw_enabled = true

Enable longwave (thermal) radiation computation. Only used by the two-stream model.

Referenced by init_params(), and make_two_stream_params().

◆ lw_kabs_cloud

amrex::Real RadChoice::lw_kabs_cloud = 158.0

Cloud-water LW mass absorption coefficient m^2/kg.

Referenced by init_params(), and make_two_stream_params().

◆ lw_kabs_dry

amrex::Real RadChoice::lw_kabs_dry = 1.0e-4

Dry-air gray LW mass absorption coefficient [m^2/kg].

Referenced by init_params(), and make_two_stream_params().

◆ lw_kabs_vapor

amrex::Real RadChoice::lw_kabs_vapor = 0.1

Water-vapor gray LW mass absorption coefficient [m^2/kg].

Referenced by init_params(), and make_two_stream_params().

◆ lw_mass_absorption_enable

bool RadChoice::lw_mass_absorption_enable = false

Gray longwave optical depth from the layer mass path instead of the fixed tau_lw_per_layer (also selected by tau_model = mass): tau_lw(k) = rho dz (lw_kabs_dry + lw_kabs_vapor qv + lw_kabs_cloud qc) The cloud term is the Stephens (1978) emissivity, eps = 1 - exp(-a LWP) with a = 0.158 m^2/g, written as an optical depth. The column optical depth is then independent of the vertical resolution. The cloud-band, moisture-coefficient and aerosol additions still apply on top. Default false keeps tau_lw_per_layer.

Referenced by init_params(), and make_two_stream_params().

◆ rad_cons_lat

amrex::Real RadChoice::rad_cons_lat = 39.809860

erf.rad_cons_lat / erf.rad_cons_lon: site latitude and longitude [degrees] when the grid has no lat/lon fields (RRTMGP defaults).

Referenced by init_params(), and make_two_stream_params().

◆ rad_cons_lon

amrex::Real RadChoice::rad_cons_lon = -98.555183

◆ rad_orbital_eccentricity

amrex::Real RadChoice::rad_orbital_eccentricity = -9999.0

Referenced by init_params().

◆ rad_orbital_mvelp

amrex::Real RadChoice::rad_orbital_mvelp = -9999.0

Referenced by init_params().

◆ rad_orbital_obliquity

amrex::Real RadChoice::rad_orbital_obliquity = -9999.0

Referenced by init_params().

◆ rad_orbital_year

int RadChoice::rad_orbital_year = -9999

erf.rad_orbital_year and the orbital overrides: negative means the year of the timestamp and the Berger (1978) values for that year.

Referenced by init_params().

◆ rad_t_sfc

amrex::Real RadChoice::rad_t_sfc = -1.0

erf.rad_t_sfc: surface temperature [K] used as the longwave boundary condition wherever no land-surface model, surface layer or prognostic surface energy balance supplies one; also the initial value of the prognostic surface temperature. Required, as for RRTMGP.

Referenced by TwoStreamRadiation::advance(), TwoStreamRadiation::define_level(), init_params(), and make_two_stream_params().

◆ seb_diagnostic_enable

bool RadChoice::seb_diagnostic_enable = false

Enable diagnostic SEB residual computation and reporting. When true, computes and reports SEB residual = (SW_net + LW_net) - H - LE - G. When false (default), no residual computation or new diagnostic output. Requires seb_enable=true to be meaningful; if false but seb_enable=true, auto-enables internally. Note: this is diagnostic-only; it makes no prognostic T_s or flux update. Set seb_prognostic_enable for that.

Referenced by TwoStreamRadiation::advance(), and init_params().

◆ seb_enable

bool RadChoice::seb_enable = false

Master switch for simplified SEB infrastructure. When false (default), no SEB MultiFabs are allocated and behavior is unchanged.

Referenced by TwoStreamRadiation::advance(), TwoStreamRadiation::define_level(), and init_params().

◆ seb_grdflx_default

amrex::Real RadChoice::seb_grdflx_default = 0.0

Fallback SEB ground heat flux [W/m^2].

Referenced by TwoStreamRadiation::advance(), TwoStreamRadiation::define_level(), and init_params().

◆ seb_hfx_default

amrex::Real RadChoice::seb_hfx_default = 0.0

Fallback SEB sensible heat flux [W/m^2].

Referenced by TwoStreamRadiation::advance(), TwoStreamRadiation::define_level(), and init_params().

◆ seb_lh_default

amrex::Real RadChoice::seb_lh_default = 0.0

Fallback SEB latent heat flux [W/m^2].

Referenced by TwoStreamRadiation::advance(), TwoStreamRadiation::define_level(), and init_params().

◆ seb_lw_flux_default

amrex::Real RadChoice::seb_lw_flux_default = 0.0

Fallback SEB surface net longwave flux [W/m^2].

Referenced by TwoStreamRadiation::advance(), TwoStreamRadiation::define_level(), and init_params().

◆ seb_moisture_layer_depth_m

amrex::Real RadChoice::seb_moisture_layer_depth_m = 0.1

Effective surface moisture layer depth [m]. Used in force-restore prognostic q_s equation: dq_s/dt = -(LE/(L_v*rho_w*d_s)) - (1/tau_q)*(q_s - q_deep). Default 0.1 m represents a thin surface-active moisture layer. Only used when seb_prognostic_enable=true. Validated > 0 in init_params().

Referenced by TwoStreamRadiation::advance(), and init_params().

◆ seb_moisture_restore_timescale_s

amrex::Real RadChoice::seb_moisture_restore_timescale_s = 86400.0

Force-restore timescale for surface moisture [s]. Relaxation time constant toward q_deep in prognostic q_s equation. Default 86400.0 s (1 day) provides weak damping on diurnal timescales. Only used when seb_prognostic_enable=true. Validated > 0 in init_params().

Referenced by TwoStreamRadiation::advance(), and init_params().

◆ seb_prognostic_enable

bool RadChoice::seb_prognostic_enable = false

Enable prognostic SEB surface temperature and moisture evolution. When true, integrates SEB residual forward in time to evolve T_s and q_s using force-restore formulation. When false (default), no prognostic update occurs. Requires seb_enable=true and seb_diagnostic_enable=true; auto-enables internally if needed. Only active when Noah-MP is NOT driving LSM fields at that level.

Referenced by TwoStreamRadiation::advance(), and init_params().

◆ seb_prognostic_q_max

amrex::Real RadChoice::seb_prognostic_q_max = 1.0

Maximum clamping bound for prognostic surface moisture [kg/kg]. After each Euler update, q_s is clamped to [seb_prognostic_q_min, seb_prognostic_q_max]. Default 1.0 kg/kg ensures physically meaningful moisture. Only used when seb_prognostic_enable=true.

Referenced by TwoStreamRadiation::advance(), and init_params().

◆ seb_prognostic_q_min

amrex::Real RadChoice::seb_prognostic_q_min = 0.0

Minimum clamping bound for prognostic surface moisture [kg/kg]. After each Euler update, q_s is clamped to [seb_prognostic_q_min, seb_prognostic_q_max]. Default 0.0 kg/kg prevents negative moisture. Only used when seb_prognostic_enable=true.

Referenced by TwoStreamRadiation::advance(), and init_params().

◆ seb_prognostic_t_max_k

amrex::Real RadChoice::seb_prognostic_t_max_k = 340.0

Maximum clamping bound for prognostic surface temperature [K]. After each Euler update, T_s is clamped to [seb_prognostic_t_min_k, seb_prognostic_t_max_k]. Default 340.0 K (above typical surface temperatures, but prevents unrealistic excursions). Only used when seb_prognostic_enable=true.

Referenced by TwoStreamRadiation::advance(), and init_params().

◆ seb_prognostic_t_min_k

amrex::Real RadChoice::seb_prognostic_t_min_k = 200.0

Minimum clamping bound for prognostic surface temperature [K]. After each Euler update, T_s is clamped to [seb_prognostic_t_min_k, seb_prognostic_t_max_k] to prevent instability if dt is large relative to C_s/tau. Default 200.0 K (far below realistic surface temperatures). Only used when seb_prognostic_enable=true.

Referenced by TwoStreamRadiation::advance(), and init_params().

◆ seb_q_deep_default

amrex::Real RadChoice::seb_q_deep_default = 0.0

Fallback SEB deep soil moisture [kg/kg].

Referenced by TwoStreamRadiation::advance(), TwoStreamRadiation::define_level(), and init_params().

◆ seb_q_sfc_default

amrex::Real RadChoice::seb_q_sfc_default = 0.0

Fallback SEB surface moisture [kg/kg].

Referenced by TwoStreamRadiation::advance(), TwoStreamRadiation::define_level(), and init_params().

◆ seb_restore_timescale_s

amrex::Real RadChoice::seb_restore_timescale_s = 86400.0

Force-restore timescale for surface temperature [s]. Relaxation time constant toward T_deep in prognostic T_s equation. Default 86400.0 s (1 day) provides weak damping on diurnal timescales. Only used when seb_prognostic_enable=true. Validated > 0 in init_params().

Referenced by TwoStreamRadiation::advance(), and init_params().

◆ seb_surface_heat_capacity

amrex::Real RadChoice::seb_surface_heat_capacity = 2.0e4

Effective surface heat capacity [J/(m^2*K)]. Used in force-restore prognostic T_s equation: dT_s/dt = SEB_residual / C_s - (2*pi/tau)*(T_s - T_deep). Default 2.0e4 J/(m^2*K) represents a thin surface-active layer. Only used when seb_prognostic_enable=true. Validated > 0 in init_params().

Referenced by TwoStreamRadiation::advance(), and init_params().

◆ seb_sw_flux_default

amrex::Real RadChoice::seb_sw_flux_default = 0.0

Fallback SEB surface net shortwave flux [W/m^2].

Referenced by TwoStreamRadiation::advance(), TwoStreamRadiation::define_level(), and init_params().

◆ seb_t_deep_default

amrex::Real RadChoice::seb_t_deep_default = 300.0

Fallback SEB deep soil temperature [K].

Referenced by TwoStreamRadiation::advance(), TwoStreamRadiation::define_level(), and init_params().

◆ seb_use_radiation_fluxes

bool RadChoice::seb_use_radiation_fluxes = false

Take the SEB's net surface shortwave and longwave fluxes from the two-stream sweep itself (per column, absorbed fluxes positive) wherever the LSM does not expose them. When false (default) those fluxes are the LSM fields or, without an LSM, the seb_sw_flux_default and seb_lw_flux_default constants. Sensible, latent and ground heat fluxes are unaffected.

Referenced by TwoStreamRadiation::advance(), and init_params().

◆ single_scattering_albedo

amrex::Real RadChoice::single_scattering_albedo = 0.0

Clear-sky (background gas) single-scattering albedo in [0, 1] for the SW diffuse (scattering) two-stream calculation. Default 0.0 means the clear-sky column is purely absorbing, and the diffuse SW contribution from the clear-sky column is exactly zero — reducing exactly to the direct-beam-only result. Only used by the two-stream model and sw_enabled == true.

Referenced by init_params(), and make_two_stream_params().

◆ surface_albedo_sw

amrex::Real RadChoice::surface_albedo_sw = 0.3

Shortwave surface albedo fallback [0, 1] for per-column heterogeneous-surface-property resolution. Used when per-column LSM/radiation interface albedo field is unavailable or invalid. Default 0.3 represents typical land/water reflectivity. Only used when hetero surface fields not present or disabled.

Referenced by TwoStreamRadiation::advance(), TwoStreamRadiation::define_level(), init_params(), and make_two_stream_params().

◆ surface_albedo_sw_diffuse

amrex::Real RadChoice::surface_albedo_sw_diffuse = -1.0

Shortwave surface albedo for diffuse light [0,1]. A negative value (default) uses surface_albedo_sw for both direct and diffuse light.

Referenced by init_params(), and make_two_stream_params().

◆ surface_emissivity_lw

amrex::Real RadChoice::surface_emissivity_lw = 0.99

Longwave surface emissivity fallback [0, 1] for per-column heterogeneous-surface-property resolution. Used when per-column LSM/radiation interface emissivity field is unavailable or invalid. Default 0.99 represents typical land/water/ice emissivity (nearly blackbody). Only used when hetero surface fields not present or disabled.

Referenced by TwoStreamRadiation::advance(), TwoStreamRadiation::define_level(), init_params(), and make_two_stream_params().

◆ sw_cloud_g

amrex::Real RadChoice::sw_cloud_g = 0.85

Mass model, SW: cloud-water asymmetry factor.

Referenced by init_params(), and make_two_stream_params().

◆ sw_cloud_omega

amrex::Real RadChoice::sw_cloud_omega = 0.9999

Mass model, SW: cloud-water single-scattering albedo.

Referenced by init_params(), and make_two_stream_params().

◆ sw_enabled

bool RadChoice::sw_enabled = true

Enable shortwave (solar) radiation computation. Only used by the two-stream model.

Referenced by init_params(), and make_two_stream_params().

◆ sw_kabs_dry

amrex::Real RadChoice::sw_kabs_dry = 4.0e-6

Mass model, SW: dry-air gray absorption coefficient [m^2/kg].

Referenced by init_params(), and make_two_stream_params().

◆ sw_kabs_vapor

amrex::Real RadChoice::sw_kabs_vapor = 4.0e-3

Mass model, SW: water-vapor gray absorption coefficient [m^2/kg].

Referenced by init_params(), and make_two_stream_params().

◆ sw_kext_cloud

amrex::Real RadChoice::sw_kext_cloud = 150.0

Mass model, SW: cloud-water extinction coefficient m^2/kg.

Referenced by init_params(), and make_two_stream_params().

◆ sw_kscat_dry

amrex::Real RadChoice::sw_kscat_dry = 3.0e-6

Mass model, SW: dry-air (Rayleigh) scattering coefficient [m^2/kg], omega = 1, g = 0.

Referenced by init_params(), and make_two_stream_params().

◆ tau_lw_coeff_qc

amrex::Real RadChoice::tau_lw_coeff_qc = 0.0

Longwave optical depth coefficient for cloud liquid water [dimensionless]. Default 0.0. When both coefficients are 0, dynamic path still invoked but yields tau_lw_per_layer unchanged. Only used when tau_lw_dynamic_enable == true.

Referenced by init_params(), and make_two_stream_params().

◆ tau_lw_coeff_qv

amrex::Real RadChoice::tau_lw_coeff_qv = 0.0

Longwave optical depth coefficient for water vapor [dimensionless]. Dynamic LW tau = tau_lw_coeff_qv * qv + tau_lw_coeff_qc * qc + tau_lw_per_layer. Default 0.0 means tau is purely from static tau_lw_per_layer (no dynamic component). Only used when tau_lw_dynamic_enable == true.

Referenced by init_params(), and make_two_stream_params().

◆ tau_lw_dynamic_enable

bool RadChoice::tau_lw_dynamic_enable = false

Enable dynamic longwave optical depth diagnosis from moisture/clouds. When true, LW optical depth is computed per-level from qv and qc. When false (default), uses the static tau_lw_per_layer. Only used by the two-stream model and lw_enabled == true.

Referenced by init_params(), and make_two_stream_params().

◆ tau_lw_per_layer

amrex::Real RadChoice::tau_lw_per_layer = 1.0

Longwave optical depth per layer (constant for all layers). Used in gray-gas LW two-stream solver. Only used by the two-stream model.

Referenced by init_params(), and make_two_stream_params().

◆ tau_model

TauModel RadChoice::tau_model = TauModel::PerLayer

Optical depth model: "per_layer" (default, fixed tau per layer) or "mass" (from the layer mass path in both bands; see TauModel).

Referenced by init_params(), and make_two_stream_params().

◆ tau_per_layer

amrex::Real RadChoice::tau_per_layer = 0.05

Shortwave optical depth per layer (constant for all layers). Used in Beer-Lambert direct-beam formula. Only used by the two-stream model.

Referenced by init_params(), and make_two_stream_params().

◆ tau_profile_type

TauProfileType RadChoice::tau_profile_type = TauProfileType::Constant

Optical depth profile type: "constant" (default, the thickness-independent tau) or "cloud_layer" (adds height-varying cloud optical depth between cloud_base_height_m and cloud_top_height_m).

Referenced by init_params(), and make_two_stream_params().

◆ tau_sw_coeff_qc

amrex::Real RadChoice::tau_sw_coeff_qc = 0.0

Shortwave optical depth coefficient for cloud liquid water [dimensionless]. Default 0.0. When both coefficients are 0, dynamic path still invoked but yields tau_per_layer unchanged. Only used when tau_sw_dynamic_enable == true.

Referenced by init_params(), and make_two_stream_params().

◆ tau_sw_coeff_qv

amrex::Real RadChoice::tau_sw_coeff_qv = 0.0

Shortwave optical depth coefficient for water vapor [dimensionless]. Dynamic SW tau = tau_sw_coeff_qv * qv + tau_sw_coeff_qc * qc + tau_per_layer. Default 0.0 means tau is purely from static tau_per_layer (no dynamic component). Only used when tau_sw_dynamic_enable == true.

Referenced by init_params(), and make_two_stream_params().

◆ tau_sw_dynamic_enable

bool RadChoice::tau_sw_dynamic_enable = false

◆ verbosity

int RadChoice::verbosity = 0

Debug verbosity level (0=off, 1+=debug output). Gated debug prints only emit when this is >= 1.

Referenced by TwoStreamRadiation::advance(), and init_params().


The documentation for this struct was generated from the following file: