Atmospheric_radiation
- DudhiaSW
model
atmospheric_radiation
dudhia_sw
The Dudhia (1989) shortwave radiation scheme of WRF (ra_sw_physics = 1, SUBROUTINE SWPARA of phys/module_ra_sw.F, WRF 4.8) as a single-column component on the EarthSciDiscretizations grids/column_nonuniform_1d grid (layer index `lev`, layer 1 at the surface; interface index `lev_nodes`, interface 1 the surface, interface NLEV+1 the top of the atmosphere). The scheme is a single downward pass of the direct solar beam S(z) that is depleted by four processes: absorption by water vapour, absorption by cloud, reflection by cloud, and Rayleigh/aerosol scattering. The first three are functions of CUMULATIVE slant paths from the top of the atmosphere, written here as the integrals W(z) = int_z^top rho q_l,eff dz (effective liquid water path, q_l,eff = qc + 0.1 qi + 0.05 qr + 0.02 qs + 0.05 qg) and U(z) = int_z^top rho qv dz (water-vapour path), lowered by the grid's integral_lev_nodes_cumulative_to_top rule: the vapour absorptance A_v(U/mu) is the Lacis-Hansen (1974) fit, the cloud reflectance R_c(mu, alw) and absorptance A_c(mu, alw) are Stephens (1978) tables in alw = log10(W/(mu 1 g/m^2) + 1), and a layer's fractional contribution is the downward increment of each cumulative function across the layer (SWPARA: TOTABS-OLDABS, ALBA-OLDALB, ABSC-OLDABC, clamped at 0). Scattering is a per-layer fraction cssca rho dz / mu. The beam itself is a genuinely sequential sweep, because SWPARA applies each layer's fraction not to S but to partial beams -- vapour absorption to the beam depleted only by cloud and scattering, cloud reflection and absorption to the beam depleted only by scattering and vapour -- which SWPARA bookkeeps with the running sums DABS, DSCLD, DSCA of the raw (unrenormalised) layer fluxes. The beam S and the two partial beams P_vap = SDOWN(1) - DSCLD - DSCA and P_cld = SDOWN(1) - DSCA - DABS are carried as three interleaved cells of ONE causal recurrence V_sweep (esm-spec 4.3.1.1), each step reading the previous triple at a fixed lag; one recurrence because the format forbids an edge between two distinct recurrence variables. The sweep runs top-down, i.e. against the lev index, and a recurrence folds only ascending, so the sweep variables live on the reversed index sets lev_down / lev_down_nodes / sweep (m = 1 the top layer, n = 1 the top of the atmosphere) and are mapped back by the reversal templates; all physics fields stay on lev / lev_nodes (lev_down: m = 1 the top layer, lev = NLEV + 1 - m; lev_down_nodes: n = 1 the top of the atmosphere, lev_nodes = NLEV + 2 - n; layer m lies between nodes m and m + 1). The heating rate is the applied (renormalised) vapour plus cloud absorption of each layer per unit volume, q_abs, divided by rho cp (SWPARA TTEN); the reflected and scattered parts leave the column without heating it, exactly as in SWPARA, and the surface absorbs (1 - albedo) S(surface). The theta tendency is dT/dt divided by the Exner function (SWRAD: RTHRATEN = RTHRATEN + TTEN1D/PI3D). Night: SWPARA returns all-zero when cos(zenith) <= 1e-9 or the top-of-atmosphere irradiance <= 1e-9 W/m^2; here the sweep is evaluated with the formal value mu = 1 at night (a near-zero mu would overflow the 1/mu slant paths) and the outputs gsw, dT/dt, dtheta/dt carry the factor `daylight`, so a night column yields exactly zero heating and surface flux while the internals are formal. Transcribed guards: negative increments clipped to 0, the table argument clamp alw_max, the renormalisation of a layer whose raw depletion exceeds 1 - tau_min (ff, tau; TRANS0 < 1: FF = 99/(...)), and the beam floor S_min (SDOWN = AMAX1(1.E-9, ...)). Not transcribed: the slope-dependent radiation option (slope_rad and its shadow correction of the surface flux) and the WRF-Chem aerosol optical depth terms (aer_dry1, aer_water1, zero without chemistry; the aerosol absorption XABSA is identically 0 in SWPARA). Reference tests: WRF v4.8.0 em_scm_xy single-column dumps from the instrumented fork ctessum-claude/WRF, commit e42a269 (v4.8.0-2-ge42a269e), replayed through that commit's real64 (-fdefault-real-8) standalone kernels/sw_driver; tolerances documented per test.
- DudhiaSWParameters
model
atmospheric_radiation
dudhia_sw
Scheme constants of the Dudhia (1989) shortwave radiation scheme, transcribed from the in-line literals of SUBROUTINE SWPARA in phys/module_ra_sw.F (WRF 4.8). Mounted by the DudhiaSW component as subsystem `par` so that no tuning constant is written inline in the physics. The clear-sky scattering coefficient (namelist swrad_scat, stored by swinit as cssca = swrad_scat * 1e-5 m^2/kg) is a run-time namelist choice and therefore a parameter of the component itself, not of this table. Values are the nominal decimal values of the Fortran source; the real64 kernel build used for the reference tests promotes these default-real literals to binary64 (-fdefault-real-8), so no single-precision rounding note applies here.
- RRTMColumn
model
atmospheric_radiation
rrtm_lw
The RRTM radiation column that WRF builds from a model column (SUBROUTINE MM5ATM and the column-amount part of SETCOEF in phys/module_ra_rrtm.F, WRF 4.8): the NLEV model layers plus NBUF buffer layers above the model top, on the index sets `rlay` (RRTM layers, 1 = lowest, NLEV + NBUF members) and `rlev` (RRTM levels, 1 = surface, NLEV + NBUF + 1 members). MM5ATM: (1) the model part is a plain copy in the bottom-up order shared by this grid (PZ(L) = Pw(kte+1-L) undoes the top-down order of the wrapper's 1-D arrays): pz = p_e/100 hPa, tz = T_e, pavel = p/100, tavel = T for the model layers; (2) the buffer part continues the column to p = 0 in steps of deltap = 4 hPa (pz[j] = p_top - deltap (j - NLEV - 1) for the NBUF - 1 full buffer levels, then pz[NLEV+NBUF+1] = 0, so the top buffer layer is thinner) with layer pressures the level means; (3) buffer temperatures follow the MM5 standard atmosphere T_std(p) (the 60-point PPROF/TPROF table, linear in pressure, clamped to its 0.10 hPa end; template standard_atmosphere_temperature) shifted so that it is continuous at the model top, tz = T_std(pz) + (T_e[top] - T_std(p_top)), and tavel the level means; (4) the dry-air column of every layer coldry = (dp/g)(N_A/amm)/(1 + w) in molecules/cm^2 with w the water-vapour volume mixing ratio (qv amdw, floored at 1e-12 kg/kg, in the model layers; the constant 5e-6 above the model top) and amm = (1 - w) amd + w amw the moist molecular weight; (5) the scaled molecular column amounts of SETCOEF, col_x = 1e-20 coldry vmr_x for H2O, CO2 (co2vmr), N2O (n2ovmr) and CH4 (ch4vmr), all uniform above the model top except H2O (the O2 column COLO2 is identically 0, because MM5ATM never fills WKL(7), and RRTM's longwave bands do not read it); (6) the longwave cloud optical depth of the model layers, taucloud = abcw CLWP + abice CIWP + abrn PLWP + absn PIWP with the paths in g/m^2 (CLWP = rho qc dz, the ice path likewise, and the (rho q)^0.75 rain and snow paths), 0 above the model top, and the layer cloud fraction cldfrac = cldfra forced to 1 where taucloud > 0.01 and 0 above the model top; (7) the surface boundary temperature tbound = tsk capped at 339.99 K (the Planck table limit) and the 16-band surface emissivity semiss = emiss. NOT in this component: the ozone column colo3, which MM5ATM takes from the O3DATA annual-mean climatology (31-bin layer-mean average of the summer/winter tables, INIRAD) evaluated on the EXTENDED column PZR -- a pressure-weighted mean of a piecewise-constant profile that will be written as an `integral` over pressure in the next pass (the dumped o3prof is the same climatology on the model column only and is not what colo3 uses; they differ by 33 %); the 1e-32 floors of SETCOEF on zero CO2/N2O/CH4 columns (never active with the WRF trace-gas inputs); and the cross-section species WX (all zero in WRF). NBUF is a metaparameter because RRTMINIT fixes it once from the model top, NLAYERS = kme + nint(p_top/(100 deltap)) - 1, i.e. NBUF = nint(p_top/(100 deltap)); 44 for the reference column with p_top = 177.6 hPa. Inputs are REWRITE-TARGET ops `input_<name>` that the consumer lowers (in the inline tests through a per-test expression_template_imports library extracted from the WRF dumps). Ozone (added 2026-09-06): the annual-mean O3DATA climatology of MM5ATM/O3PROF2 as the layer integral of a piecewise-constant profile, including WRF's one-layer shift (EqWeFiC FORTRAN_BUGS.md B5), and colo3. EqWeFiC, cited here for FORTRAN_BUGS.md, couplings/ and components/atmospheric_dynamics/wrf_arw/, is https://github.com/EarthSciML/EqWeFiC, where these components were developed and are coupled into a WRF column.
- RRTMGasOptics
model
atmospheric_radiation
rrtm_lw
The gaseous optical depths and Planck fractions of WRF's RRTM longwave scheme (SUBROUTINE GASABS and the sixteen band routines TAUGB1-TAUGB16 of phys/module_ra_rrtm.F, WRF 4.8) for the RRTM column of rrtm_column.esm, from the interpolation coefficients of rrtm_setcoef.esm. Every band interpolates its g-point-reduced k-tables (rrtm_kdist_bandNN.esm, transcribed from RRTM_DATA and the module's DATA statements) bilinearly in ln p and temperature with SETCOEF's weights, adds the water-vapour self continuum (linear in temperature between two SELFREF rows) and, where the band has one, the foreign continuum and minor absorbers (N2O as an excess over a reference atmosphere, CO2 through CO2MULT, the CFC/CCl4 cross sections, zero in WRF). Two-species bands add a third interpolation dimension, the species parameter ca/(ca + STRRAT cb), with band-specific re-binning of its intervals (bands 3, 4, 9). Layers 1..LAYTROP use the lower-atmosphere tables ABSA, the rest ABSB (band 8 switches at LAYSWTCH; bands 6, 12, 13, 15, 16 have no upper-atmosphere absorption). GASABS then quantises the diffusivity-weighted optical depth into the table index ITR = INT(5000 od/(BPADE + od) + 0.5) that rtrn_sweep.esm consumes. The scheme is diagnostic. Fortran INT() is written as floor() (every argument is non-negative). Because esm evaluates both branches of an ifelse, the table rows of the inactive lower/upper branch are clamped into range (jp_lo, jp_up); the clamped values never reach a result. The per-band outputs taug_bNN/pfrac_bNN are the tested quantities (the g-points of one band with the band's own tolerance); taug/pfrac/itr are their assembly over the 140 g-points. Reference: real32 WRF dumps (no standalone driver), tolerance contract rel 1e-5. Reference: Mlawer et al. (1997) JGR 102, 16663; WRF 4.8 phys/module_ra_rrtm.F lines 4483-6275 and 6721-6873. EqWeFiC, cited here for FORTRAN_BUGS.md, couplings/ and components/atmospheric_dynamics/wrf_arw/, is https://github.com/EarthSciML/EqWeFiC, where these components were developed and are coupled into a WRF column.
- RRTMLWHeating
model
atmospheric_radiation
rrtm_lw
Longwave heating of a model column from the RRTM up- and downwelling fluxes (WRF ra_lw_physics = 1, SUBROUTINE RTRN heating-rate loop 7000 and the TTEN/GLW/OLR mapping of SUBROUTINE RRTM in phys/module_ra_rrtm.F, WRF 4.8), written as the pressure-coordinate flux-divergence PDE dT/dt = -(g/cp) dF_net/ds, s = p_sfc - p on the EarthSciDiscretizations grids/column_nonuniform_1d grid. The grid's interface coordinate `ze` is here the PRESSURE DISTANCE ABOVE THE SURFACE s = p_e[1] - p_e (Pa, monotone increasing with lev), so the grid's layer measure dz is the layer pressure thickness p_e[k] - p_e[k+1] and the imported face_flux_D_lev_supplied_faces rule lowers D(F_net, lev) to (F_net[k+1] - F_net[k]) / (p_e[k] - p_e[k+1]); with the RRTM value of g/cp (HEATFAC) this is exactly RTRN's HTR(L-1) = HEATFAC (FNET(L-1) - FNET(L)) / (PZ(L-1) - PZ(L)), L = 1..NLAYERS, PZ in hPa, HTR in K/day, verified against the instrumented WRF dumps to real32 roundoff (this is the convention the instrumentation pass could not reproduce: HTR(L-1), not HTR(L), is the heating of layer L, and HTR(NLAYERS) is simply set to 0). Column mapping: RRTM indexes its column BOTTOM-UP like this grid -- RRTM layer L is model layer L for L <= NLEV (MM5ATM: PAVEL(L) = p(kte+1-L) undoes the top-down ordering of the RRTMLWRAD 1-D arrays), RRTM level L is the model interface L+1 (PZ(0) the surface p8w(1), PZ(NLEV) the model top p_top) -- and MM5ATM extends the column above p_top with NLAYERS - NLEV buffer layers of thickness deltap = 4 hPa down to PZ(NLAYERS) = 0 (temperatures from a standard profile offset to match the model top, constant water vapour 5e-6, model-top CH4/N2O, climatological ozone) so that the fluxes at the model interfaces include the emission of the atmosphere above the model top. Only the fluxes at the NLEV+1 MODEL interfaces enter this component (inputs F_up, F_dn of shape [lev_nodes], the first NLEV+1 entries of TOTUFLUX/TOTDFLUX); the buffer layers are heated by RTRN but their heating is discarded (RRTM: TTEN(K) = HTR(kte-K)/86400 for K = 1..kte, in the wrapper's top-down order). Outputs: dTdt (K/s, WRF TTEN reversed to bottom-up), dthdt = dTdt/exner (the increment RRTMLWRAD adds to RTHRATEN), glw = F_dn at the surface (GLW = TOTDFLUX(0)) and olr = F_up at the MODEL TOP (WRF sets OLR = TOTUFLUX(kte), the upward flux at p_top, not TOTUFLUX(NLAYERS) at the top of the RRTM column; the two differ by 3-7 W/m^2 in the reference run). The fluxes themselves (the RTRN two-stream sweep over 140 g-points and the gas optics) are the later stages of the RRTM transcription; this component is the flux-to-tendency stage that every longwave scheme shares. Inputs are REWRITE-TARGET ops `input_<name>` that the consumer lowers (in the inline tests through a per-test expression_template_imports library extracted from the WRF dumps, because esm-spec 6.6 parameter_overrides admit scalars only). EqWeFiC, cited here for FORTRAN_BUGS.md, couplings/ and components/atmospheric_dynamics/wrf_arw/, is https://github.com/EarthSciML/EqWeFiC, where these components were developed and are coupled into a WRF column.
- RRTMParameters
model
atmospheric_radiation
rrtm_lw
Scheme constants of WRF's RRTM longwave radiation (ra_lw_physics = 1, phys/module_ra_rrtm.F, WRF 4.8; Mlawer et al. 1997), collected as named parameters so that no literal appears inline in the RRTM components. Physical constants shared with the rest of WRF live in lib/wrf_constants.esm; the values here are the ones RRTM hard-wires for itself, several of which deliberately differ from WRF's (HEATFAC uses g = 9.8066 m/s^2 and cp = 1.004 kJ/(kg K), not WRF's 9.81 and 1004.5). Mounted as subsystem `par` by the RRTM components.
- RRTMSetcoef
model
atmospheric_radiation
rrtm_lw
The pressure/temperature interpolation coefficients of WRF's RRTM longwave scheme (SUBROUTINE SETCOEF of phys/module_ra_rrtm.F, WRF 4.8) for the RRTM column of rrtm_column.esm. For every RRTM layer the reference-pressure bin JP of ln(pavel) on the 0.2-wide grid PREFLOG, the reference-temperature bins JT (at PREF(JP)) and JT1 (at PREF(JP+1)) on the 15 K grid around TREF, the four bilinear weights FAC00, FAC10, FAC01, FAC11 that the band routines TAUGBn apply to the k-tables, the foreign- and self-continuum scalings FORFAC and SELFFAC with the self-continuum temperature row INDSELF and fraction SELFFRAC, the CO2 excess weighting CO2MULT, and the three layer counts LAYTROP (lower-atmosphere k-tables), LAYSWTCH (band 8) and LAYLOW (band 9). Inputs are the column's layer pressures and temperatures and the dry-air, water-vapour and CO2 columns (rrtm_column.esm pavel, tavel, coldry, colh2o, colco2). The scheme is diagnostic. Fortran INT() truncations are written as floor(): every truncated argument is either positive or is followed by a clamp that makes floor and truncation agree (documented per variable). SELFFAC, SELFFRAC and INDSELF are assigned by SETCOEF only below LAYTROP and are left undefined above it; here they are defined on every layer by the same formula, and the tests compare them below LAYTROP only. Reference: real32 WRF dumps (no standalone driver), tolerance contract rel 1e-5; the residual is dominated by the real32 PREFLOG/TREF table values and ln(). Reference: Mlawer, E. J., S. J. Taubman, P. D. Brown, M. J. Iacono and S. A. Clough (1997), RRTM, a validated correlated-k model for the longwave, J. Geophys. Res. 102, 16663-16682; WRF 4.8 phys/module_ra_rrtm.F SUBROUTINE SETCOEF (lines 4267-4450). EqWeFiC, cited here for FORTRAN_BUGS.md, couplings/ and components/atmospheric_dynamics/wrf_arw/, is https://github.com/EarthSciML/EqWeFiC, where these components were developed and are coupled into a WRF column.
- RTRNSweep
model
atmospheric_radiation
rrtm_lw
RRTM longwave radiative transfer (SUBROUTINE RTRN of phys/module_ra_rrtm.F, WRF 4.8; Mlawer et al. 1997, Iacono's CCM revision): from the quantised gas optical depths ITR and Planck fractions PFRAC of GASABS, the cloud optical depths and fractions, and the layer/level temperatures of the extended RRTM column, compute the Planck sources, the one-angle (diffusivity-angle, secant 1.66) downward and upward radiance sweeps for all 140 g-points with the RRTM cloud-fraction overlap, the clear-sky sweeps, the band-summed and total up/down fluxes, and RRTM's heating rates HTR/HTRC. The two sweeps are esm-spec 4.3.1.1 recurrences over the level index (one per g-point): each level's radiance is the previous level's radiance transmitted through the intervening layer plus that layer's emission, a genuinely sequential integration of the Schwarzschild equation that has no closed form once the layer sources vary (EqWeFiC CLAUDE.md: recurrences are reserved for sequential sweeps such as two-stream up/down passes). Layer 1 of rlay is the lowest RRTM layer (surface), level 1 of rlev the surface; the downward sweep is written on a top-counted index and gathered back so that the recurrence reads strictly earlier cells. Gas optics (GASABS/TAUGB1-16) are not part of this component: ITR and PFRAC are inputs, computed by rrtm_gas_optics.esm. EqWeFiC, cited here for CLAUDE.md, FORTRAN_BUGS.md, couplings/ and components/atmospheric_dynamics/wrf_arw/, is https://github.com/EarthSciML/EqWeFiC, where these components were developed and are coupled into a WRF column.