ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_AerosolOpticalDepth.H File Reference

Prescribed bulk aerosol/turbidity optical depth diagnosis. More...

#include <AMReX_GpuControl.H>
#include <AMReX_Math.H>
#include <AMReX_FArrayBox.H>
#include <cmath>
Include dependency graph for ERF_AerosolOpticalDepth.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real diagnose_tau_aerosol_constant (amrex::Real tau_aerosol_const)
 Diagnose aerosol optical depth for Constant profile. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real diagnose_tau_aerosol_exponential (amrex::Real z_level, amrex::Real dz, amrex::Real tau_surface, amrex::Real scale_height_m)
 Diagnose aerosol optical depth for Exponential profile. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real diagnose_tau_aerosol_table (int k)
 Diagnose aerosol optical depth for the Table profile. More...
 

Detailed Description

Prescribed bulk aerosol/turbidity optical depth diagnosis.

Implements profile-based aerosol optical depth diagnosis for use in TwoStream radiation. Supports Constant, Exponential, and Table (future) profile types.

Aerosol optical depth is added on top of existing tau contributions (tau_base + tau_cloud + tau_dynamic).

Constant profile: tau_aerosol(k) = aerosol_tau_per_layer [uniform at all levels]

Exponential profile: tau_aerosol(k) = aerosol_tau_surface * exp(-z(k) / aerosol_scale_height_m) [decay with height]

Table profile (future): tau_aerosol(k) = lookup_table[k] [per-level prescribed values]

References:

Function Documentation

◆ diagnose_tau_aerosol_constant()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real diagnose_tau_aerosol_constant ( amrex::Real  tau_aerosol_const)

Diagnose aerosol optical depth for Constant profile.

Returns uniform aerosol tau_per_layer (independent of height/level). Clamped to [0, 100] for physical reasonableness.

Parameters
[in]tau_aerosol_constConstant aerosol optical depth per layer [dimensionless]
Returns
Clamped aerosol optical depth [0, 100]
43 {
44  // Guard against invalid input
45  if (!amrex::Math::isfinite(tau_aerosol_const)) {
46  return 0.0;
47  }
48 
49  // Clamp to physically reasonable range [0, 100]
50  amrex::Real tau_clipped = tau_aerosol_const;
51  if (tau_clipped < 0.0) tau_clipped = 0.0;
52  if (tau_clipped > 100.0) tau_clipped = 100.0;
53 
54  return tau_clipped;
55 }
amrex::Real Real
Definition: ERF_ShocInterface.H:19

Referenced by diagnose_layer_tau().

Here is the caller graph for this function:

◆ diagnose_tau_aerosol_exponential()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real diagnose_tau_aerosol_exponential ( amrex::Real  z_level,
amrex::Real  dz,
amrex::Real  tau_surface,
amrex::Real  scale_height_m 
)

Diagnose aerosol optical depth for Exponential profile.

Returns the optical depth of one layer of an exponentially decaying aerosol profile, i.e. the profile integrated across that layer, tau_aerosol(k) = (tau_surface / scale_height) * dz * exp(-z(k) / scale_height) so the column sum approaches tau_surface once the domain is much deeper than the scale height. This is a per-layer contribution, not the column value above z(k).

Clamped to [0, 100] for physical reasonableness. Handles invalid parameters safely with fallback to 0.

Parameters
[in]z_levelHeight at level k [m]
[in]dzThickness of layer k [m]
[in]tau_surfaceTotal-column aerosol optical depth at surface [dimensionless]
[in]scale_height_mDecay scale height [m]
Returns
Clamped aerosol optical depth [0, 100]
81 {
82  if (!amrex::Math::isfinite(z_level) || !amrex::Math::isfinite(dz) ||
83  !amrex::Math::isfinite(tau_surface) || !amrex::Math::isfinite(scale_height_m)) {
84  return 0.0;
85  }
86  if (scale_height_m <= 0.0 || dz <= 0.0) {
87  return 0.0;
88  }
89  if (tau_surface < 0.0) {
90  return 0.0;
91  }
92  if (z_level < 0.0) {
93  z_level = 0.0;
94  }
95 
96  amrex::Real arg = -z_level / scale_height_m;
97  if (arg < -100.0) {
98  return 0.0;
99  }
100 
101  // Per-layer contribution = (tau_surface / scale_height) * dz * exp(-z/H)
102  // so the vertical integral over all layers approaches tau_surface as domain height >> H
103  amrex::Real tau_aerosol = (tau_surface / scale_height_m) * dz * std::exp(arg);
104 
105  if (tau_aerosol < 0.0) tau_aerosol = 0.0;
106  if (tau_aerosol > 100.0) tau_aerosol = 100.0;
107 
108  return tau_aerosol;
109 }
@ dz
Definition: ERF_AdvanceWDM6.cpp:272

Referenced by diagnose_layer_tau().

Here is the caller graph for this function:

◆ diagnose_tau_aerosol_table()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real diagnose_tau_aerosol_table ( int  k)

Diagnose aerosol optical depth for the Table profile.

Not implemented: a per-level table lookup would be supplied through a fixed-size array or a MultiFab. RadChoice::init_params() rejects this profile type, so this function is unreachable from a configured run.

Parameters
[in]kLevel index
Returns
Zero
124 {
125  // Future extension: implement per-level table lookup
126  // For now, return 0 (no contribution)
127  (void)k; // Suppress unused parameter warning
128  return 0.0;
129 }

Referenced by diagnose_layer_tau().

Here is the caller graph for this function: