Wrf
- 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.
- 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.
- 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.
- SfclayRev
model
atmospheric_dynamics
sfclayrev
WRF's revised MM5 surface-layer scheme (sf_sfclay_physics = 1; Jimenez et al. 2012), transcribed from the CCPP kernel sf_sfclayrev_run of phys/physics_mmm/sf_sfclayrev.F90 (WRF 4.8, NCAR/MMM-physics 550b5b4 with the kind-generic fixes of the ctessum-claude fork 52cfbd7). The scheme is a diagnostic (time-step-free) Monin-Obukhov surface layer for one grid column: from the lowest-model-level state (u, v, T, qv, p, layer thickness), the surface pressure and skin temperature, the surface type and the previous step's roughness, friction velocity, temperature scale and surface humidity it computes (1) the potential, virtual and surface saturation quantities; (2) an effective wind speed that adds the Beljaars (1994) convective velocity over land or the Wyngaard form over water and the Mahrt and Sun (1995) subgrid velocity; (3) the bulk Richardson number Ri_b = g za (theta_v1 - theta_vs)/(theta_1 |U|^2), which fixes the stability regime (1 stable, 3 neutral, 4 unstable); (4) the stability parameter zol = za/L by inverting Ri_b = zol psi_h(zol)/psi_m(zol)^2 with the Jimenez et al. (2012) integrated similarity functions (Cheng-Brutsaert stable, Kansas/free-convection unstable), which the kernel does with a secant iteration stopped at 0.01 (bulk_richardson_zol.esm: transcribed step by step as one recurrence over the 33-cell index set secant_steps because the stopping rule leaves zol up to 8e-5 relative from the exact root), or from the first guess zol = Ri_b ln((za+z0)/z0) when the previous friction velocity is below 1 mm/s; (5) the integrated stability corrections psi_m, psi_h between z0 (or the thermal/moisture roughness z0t, z0q over water and for iz0tlnd > 0 over land) and the first level, 2 m and 10 m; (6) the friction velocity u* = k |U|/psi_m relaxed 50/50 against the previous value, the temperature scale mol = k (theta_1 - theta_s)/psi_h, the 2 m and 10 m diagnostics and the drag/exchange coefficients ck, cka, cd, cda; and (7), when surface fluxes are enabled (isfflx), the updated sea-surface roughness (Charnock + smooth flow, AHW, or Jimenez-Dudhia shallow water), the exchange coefficients flhc, flqc, chs, chs2, cqs2 and the sensible, latent and moisture fluxes. Every quantity is a scalar observed; the only array is the secant recurrence. Constants: lib/wrf_constants.esm as subsystem wrf; scheme constants sfclayrev_parameters.esm as subsystem par (note the kernel receives real32 copies of the WRF constants, g = 9.8100004, karman = 0.40000001, ep1 = 0.60836244, svp1 = 0.61119998, and its literals are default-real, which bounds the agreement of a real64 build with this component at about 1e-7 relative -- FORTRAN_BUGS.md N2, N10). Previous-step inputs are named *_in (WRF intent(inout) arguments read before being overwritten: znt, ust, mol, qsfc, hfx, qfx, ustm, chs, chs2, cqs2). Option flags are numeric parameters (isfflx, shalwater_z0, scm_force_flux as 0/1; isftcflx, iz0tlnd as 0/1/2). NOT transcribed: the KIM turbulent orographic form drag (if_kim_tofd), whose Fortran uses the uninitialised variable dx_factor on its own right-hand side (FORTRAN_BUGS.md B3), so cf = 0; the optional TKE-coupling ustm is included. lh is xlv qfx always, whereas the kernel leaves lh unassigned when isfflx is false or scm_force_flux is true (FORTRAN_BUGS.md N11). The 0.9 ln((z+z0)/z0) caps that the kernel applies to psi_m, psi_h, psi_h2, psi_m10, psi_h10 in the unstable regime only are applied unconditionally here, which is equivalent because the stable and neutral corrections are non-positive. Regime selection by the sign of zol inside the profile templates is equivalent to the kernel's selection by the sign of Ri_b because zol has the sign of Ri_b or is zero.
- SfclayRevParameters
model
atmospheric_dynamics
sfclayrev
Scheme constants of WRF's revised MM5 surface-layer scheme (sf_sfclay_physics = 1, `sf_sfclayrev_run` in phys/physics_mmm/sf_sfclayrev.F90, WRF 4.8 / NCAR MMM-physics; Jimenez et al. 2012), transcribed from the module `parameter` declarations and the in-line literals of the kernel so that no tuning constant is written inline in the physics. Mounted by the SfclayRev component as subsystem `par`. Values are the nominal (decimal) values written in the Fortran source. The coefficients of the similarity functions themselves (Cheng-Brutsaert 6.1/2.5 and 5.3/1.1, Kansas 16, free-convection 10/34 and the 0.33 exponent) and the psi lookup-table discretisation (step 0.01, 1000 nodes) are properties of the published functions, not tuning constants, and live with the functions in similarity_functions.esm. NOTE (FORTRAN_BUGS.md N2/N10): the kernel's literals are default-real, so a real64 build runs with their single-precision roundings (e.g. 1/2.5 = 0.4000000059604645, sqrt(3.) and atan(1.) evaluated in real32, the lookup-table nodes float(n)*0.01 rounded to real32); the SfclayRev tests document the resulting O(1e-7) relative mismatch in their tolerances rather than reproducing the rounding here.
- SlabLandSurface
model
land_surface
slab
WRF's 5-layer slab (thermal diffusion) land-surface scheme, SUBROUTINE SLAB1D of phys/module_sf_slab.F (sf_surface_physics = 1), written as instantaneous tendencies. Surface energy balance: net radiation gsw + emiss (glw - sigma tsk^4), sensible and latent heat fluxes from consumer-supplied bulk exchange coefficients (the surface-layer scheme's FLHC, FLQC), the latent flux driven by the saturation deficit at the skin temperature, and the residual G = rnet - (hfx + lh) conducted into the soil. Soil: the heat equation capg dT/dt = d/dz( capg difsl dT/dz ) on a column of NLEV prognostic layers, written as the flux-form operator D(K_soil D(T_s) - F_soil) and lowered by the EarthSciDiscretizations column_nonuniform_1d rule varcoeff_face_flux_laplacian_lev, with the surface heat flux G entering through the prescribed interface flux F_soil[1] and the deepest WRF soil layer -- which SLAB1D never updates -- acting as a fixed reservoir at temperature T_deep and depth z_deep that closes the bottom boundary through F_soil[NLEV+1]. Orientation: `lev` is the soil layer index with layer 1 at the surface and `ze` the interface DEPTH below ground (positive downward, ze[1] = 0, increasing with the index, the grid's required orientation); the grid-derived zc reproduce WRF's ZS and dz its DZS, and the lowered stencil is exactly SLAB1D's FLUX(L+1) = -DIFSL CAPG (T(L+1)-T(L))/(ZS(L+1)-ZS(L)), DTSDT = -(FLUX(L+1)-FLUX(L))/(DZS(L) CAPG). NLEV = num_soil_layers - 1 (4 for WRF's default 5 layers). The skin temperature follows layer 1: SLAB1D advances TSK by the layer-1 tendency (DTHGDT), so dTsk_dt = dTs_dt[1]; the surface fluxes themselves are evaluated at the consumer-supplied tsk. Water points (xland >= 1.5) are frozen (tendencies multiplied by the land indicator). Not expressible as a rate and therefore reported as the indicator snow_cap_active only: with IFSNOW = 1 SLAB1D caps the layer-1 and skin temperatures at 273.16 K wherever snow covers a land point, a projection of the state applied after each step. The one-layer force-restore form (num_soil_layers = 1: dTg/dt = (rnet - qs)/capg - hm) is not transcribed; hm is computed as WRF does but does not enter the multi-layer tendency. Consumer-supplied column fields (ze, T_s) are rewrite-target ops `input_<name>` lowered by the consumer, in the inline tests through per-test expression_template_imports libraries under tests/ (esm-spec 6.6 parameter_overrides admit scalars only). Test provenance: every inline-test input and expected value comes from a WRF v4.8.0 em_scm_xy single-column run of the instrumented fork ctessum-claude/WRF, commit e42a269 (v4.8.0-2-ge42a269e, branch earthsciml-instrumented), whose module_esm_dump hooks in phys/module_sf_slab.F dump SLAB1D's arguments; the dumps and the standalone replay driver are not part of this repository, so the values are recorded data rather than regenerable output.
- SlabParameters
model
land_surface
slab
Scheme constants of the WRF 5-layer slab (thermal diffusion) land-surface scheme, transcribed from the module parameters and in-line literals of phys/module_sf_slab.F (WRF 4.8, SUBROUTINE SLAB1D). Mounted by the slab component as subsystem `par` so that no tuning constant is written inline in the physics. Values are the nominal (decimal) values of the Fortran source; the WRF build evaluates them in single precision.
- WRF
model
earthsci_data
WRF regridding model — the coupler half of the wrf loader+regridding-model split (RFC pure-io-data-loaders §6/§7; bead esm-3nc.1). Exposes WRF regional weather fields (UCAR RDA d340000, WRF-Chem v3.9.1 CONUS 12 km) on the simulation's target grid for advection and chemistry coupling in EarthSciML systems.
- WRF_hourly_d01
data_source
earthsci_data
WRF regridding model — the coupler half of the wrf loader+regridding-model split (RFC pure-io-data-loaders §6/§7; bead esm-3nc.1). Exposes WRF regional weather fields (UCAR RDA d340000, WRF-Chem v3.9.1 CONUS 12 km) on the simulation's target grid for advection and chemistry coupling in EarthSciML systems.
- WSM6ColdAccretion
model
atmospheric_dynamics
wsm6
Collection (accretion) process rates between the six water species of the WRF single-moment 6-class microphysics scheme below and above freezing (WSM6; Hong and Lim 2006 appendix A; Lin et al. 1983; Rutledge and Hobbs 1983, 1984), transcribed from the cold-rain block of mp_wsm6_run in phys/physics_mmm/mp_wsm6.F90 (WRF 4.8, NCAR/MMM-physics): accretion of cloud ice by rain (praci), of rain by cloud ice (piacr), of cloud ice by snow (psaci) and by graupel (pgaci) -- all only below 0 C --, of cloud water by snow (psacw) and by graupel (pgacw) and their snow/graupel-weighted combination (paacw), of snow by rain (pracs, below 0 C), of rain by snow (psacr) and by graupel (pgacr), the eliminated snow-by-graupel term (pgacs = 0 since WRF V3.0, when snow and graupel received a common fall speed), and the enhanced melting of snow and graupel above 0 C by the sensible heat of the liquid water they collect (pseml, pgeml). Each collection rate is the geometric sweep-out of one species by another: pi/4 n0 |V_a - V_b| times a size-distribution kernel (collection_kernel_* templates) times the collected mixing ratio, with the collection efficiencies (eacrs = exp(-0.07 (T0 - T)) for ice, 1 for water) and WSM6's empirical reduction min(max(0, q_collector/q_collected), 1)^2 folded into the UNLIMITED rate because they are functions of the state alone. The kernel additionally applies per-process time-step limiters (a sink may not remove more than q/dtcld per sub-step; pseml/pgeml are also floored at zero), exposed separately as <rate>_lim with the sub-step length dtcld as a parameter -- time-step artefacts, not physics (EqWeFiC FORTRAN_BUGS.md note N3); the mass-conservation rescaling applied afterwards is not part of this component. The size distributions, number concentrations and fall speeds are supplied by hydrometeor_slopes.esm mounted as subsystem `sd` (referenced as sd.<name>), exactly as the kernel evaluates them once per sub-step and reuses them here; cloud water qc and the sub-step dtcld are this component's own inputs. Scheme constants come from wsm6_parameters.esm (subsystem `par`), physical constants from lib/wrf_constants.esm (`wrf`). Consumer-supplied inputs are the rewrite-target ops `input_<name>` lowered in the inline tests through a per-test template library extracted from kernel dumps of the instrumented WRF fork ctessum-claude/WRF, commit e42a269 (v4.8.0-2-ge42a269e) (esm-spec 6.6 parameter_overrides admit scalars only). EqWeFiC, cited here for FORTRAN_BUGS.md and couplings/, is https://github.com/EarthSciML/EqWeFiC, where these components were developed and are coupled into a WRF column.
- WSM6HydrometeorSlopes
model
atmospheric_dynamics
wsm6
Size-distribution and fall-speed diagnostics of the WRF single-moment 6-class microphysics scheme (WSM6; Hong and Lim 2006), transcribed from slope_wsm6 and the cold-rain preamble of mp_wsm6_run in phys/physics_mmm/mp_wsm6.F90 (WRF 4.8, NCAR/MMM-physics): the temperature-dependent snow intercept factor n0s(T)/n0s (HDC 2004 eq. 6), the inverse slopes lambda^-1 of the exponential rain, snow and graupel distributions and their powers lambda^-b, lambda^-2, lambda^-3 (held at 1/lambda_max below the threshold qcrmin), the diagnosed ice crystal number concentration N_i (HDC eq. 5c), mean ice crystal diameter D_i (HDC eq. 5b) and fall speed V_i (HDC eq. 5a), the mass-weighted fall speeds of rain, snow and graupel V = a Gamma(4+b)/6 lambda^-b (rho0/rho)^(1/2), the ventilation coefficients precs1/2 and precg1/2 of the snow and graupel distributions (mp_wsm6_init products shared by deposition, evaporation and melting), and the combined snow/graupel fall speed WSM6 uses since V3.0. Everything is a pointwise function of the layer state on the layer index `lev` (WRF k, layer 1 at the surface). It also holds the transport properties of air at T and p (kinematic viscosity, vapor diffusivity, thermal conductivity; lib/wrf_air_properties.esm), the ventilation factor (WSM6 work2) and the ventilation moments coeres of rain, snow and graupel. The process-rate components (warm_rain.esm, cold_accretion.esm, ice_deposition.esm) mount this component as subsystem `sd` and take all of these from it, mirroring how the kernel computes them once per sub-step (slope_wsm6) and reuses them in every process; melting_freezing.esm evaluates the same templates at its own, earlier state. Scheme constants come from wsm6_parameters.esm (subsystem `par`) and physical constants from lib/wrf_constants.esm (subsystem `wrf`). Consumer-supplied inputs are the rewrite-target ops `input_<name>` lowered in the inline tests through a per-test template library extracted from kernel dumps of the instrumented WRF fork ctessum-claude/WRF, commit e42a269 (v4.8.0-2-ge42a269e). EqWeFiC, cited here for FORTRAN_BUGS.md and couplings/, is https://github.com/EarthSciML/EqWeFiC, where these components were developed and are coupled into a WRF column.
- WSM6IceDeposition
model
atmospheric_dynamics
wsm6
Vapor-exchange and conversion process rates of the ice phase of the WRF single-moment 6-class microphysics scheme (WSM6; Hong and Lim 2006; Hong, Dudhia and Chen 2004), transcribed from the cold-rain block of mp_wsm6_run in phys/physics_mmm/mp_wsm6.F90 (WRF 4.8, NCAR/MMM-physics): deposition/sublimation of vapor on cloud ice (pidep, HDC eq. 9), snow (psdep, HDC eq. 14) and graupel (pgdep, HL A21) below 0 C; ice nucleation from vapor (pigen, HDC eqs. 7-8); aggregation of ice to snow (psaut, HDC eq. 12) and of snow to graupel (pgaut, LFO eq. 37); and evaporation of melting snow (psevp, HL A35) and graupel (pgevp, HL A25) above 0 C. The UNLIMITED rates are the physics: pidep = 4 D_i N_i (rh_i - 1)/F_i, psdep/pgdep/psevp/pgevp the ventilated diffusional growth (rh - 1)(c1 lambda^-2 + c2 f_v coeres)/F, pgaut = alpha2(T) max(0, qs - qs0). Two processes are instantaneous adjustments that the kernel writes as rates: nucleation relaxes the ice content to the target q_i0(T) = 4.92e-11 N_i0(T)^1.33/rho and ice-to-snow aggregation removes the excess of q_i over q_imax = 2.08e22 D_max^8/rho; here the physical quantities are the targets q_i0 and q_imax (observeds qi_nucleation_target, qi_max) and the rates pigen, psaut carry the sub-step dtcld as a parameter (EqWeFiC FORTRAN_BUGS.md N3). WSM6 limits the deposition processes SEQUENTIALLY against the vapor budget: after the rain evaporation prevp of the warm-rain block (an INPUT here, from warm_rain.esm), each of pidep, psdep, pgdep may take at most half the supersaturation over ice per sub-step (satdt/2) and at most what the earlier processes left (supice), a sublimating species may not lose more than it holds, and once the running sum of the limited rates reaches satdt the flag ifsat closes the remaining processes and the nucleation; that chain is transcribed pointwise as the <rate>_lim observeds and the ifsat_* indicators, all time-step artefacts kept apart from the physics. The saturation state over water and ice (qsat_w, rh_w, qsat_i, rh_i, xl) is an INPUT from saturation.esm evaluated at the start of the sub-step (EqWeFiC FORTRAN_BUGS.md N4); the size distributions, N_i, D_i come from hydrometeor_slopes.esm mounted as subsystem `sd`; the deposition coefficients precs1/2, precg1/2, the transport properties of air, the ventilation factor and the ventilation moments live there too; the diffusional-growth denominators over water and ice are computed here with the same template as warm_rain.esm. Constants: wsm6_parameters.esm (`par`), lib/wrf_constants.esm (`wrf`). Consumer-supplied inputs are the rewrite-target ops `input_<name>` lowered in the inline tests through a per-test template library extracted from kernel dumps of the instrumented WRF fork ctessum-claude/WRF, commit e42a269 (v4.8.0-2-ge42a269e). EqWeFiC, cited here for FORTRAN_BUGS.md and couplings/, is https://github.com/EarthSciML/EqWeFiC, where these components were developed and are coupled into a WRF column.
- WSM6MassConservation
model
atmospheric_dynamics
wsm6
Mass-conservation rescaling of the WSM6 process rates and the state update it feeds, transcribed from the block 'check mass conservation of generation terms and feedback to the large scale' of mp_wsm6_run (phys/physics_mmm/mp_wsm6.F90, WRF 4.8 NCAR/MMM-physics). The process rates of warm_rain.esm, cold_accretion.esm and ice_deposition.esm each carry their OWN limiter (a single process may not drain more than q/dtcld), but nothing stops the SUM of the processes draining one species from overdrawing it within a sub-step; WSM6 therefore walks the five species budgets in the fixed order cloud water, cloud ice, rain, snow, graupel (four in the warm branch: cloud water, rain, snow, graupel) and, whenever the total sink S of a species over one sub-step exceeds the mass v = max(q_floor, q) available, multiplies EVERY rate entering that budget by v/S. The factors are written branch-free as v/max(S, v) (microphysics_templates.esm mass_conservation_factor), which is 1 for a budget that is not overdrawn and for a net source. Because the blocks run in sequence, a rate that appears in several budgets is scaled once per budget, so its final value is the raw rate times the PRODUCT of the factors of the species whose budgets it drains -- praut = praut_raw f_qc f_qr, paacw = paacw_raw f_qc f_qs f_qg, piacr = piacr_raw f_qr f_qs f_qg, and so on -- which is how the cascade is written here, one factor per species instead of one rescaled copy per block. This is a TIME-STEP ARTEFACT of the explicit operator splitting, not physics: every factor depends on dtcld and all of them are 1 in the dtcld -> 0 limit (EqWeFiC FORTRAN_BUGS.md note N3). The same block then applies the rescaled rates to the state ('feedback to the large scale'): the vapor tendency dqv_dt (WSM6 work2), the latent-heating tendency dT_dt (WSM6 -xlwork2/cpm, with the latent heats xl of vaporization, xls of sublimation and xls - xl of fusion), and the updated mixing ratios, each floored at zero. Below 0 C (`cold`) the deposition/ice branch runs and the ice-rain collection products are partitioned between snow and graupel by the switches delta2, delta3 (rain and snow below the threshold par.q_delta = 1e-4 kg/kg send the products to snow); above 0 C only evaporation of melting precipitation, enhanced melting and pgacs act, cloud ice is untouched, and the accreted cloud water goes to rain rather than to the collector. The two branches are blended with the indicator `cold` rather than an ifelse per quantity, so that each updated field is one expression. The latent heats xl and cpm are INPUTS from saturation.esm at the START-of-sub-step state, as WSM6 uses them (EqWeFiC FORTRAN_BUGS.md note N4), while the mixing ratios and temperature are the state at which the rates were evaluated (after the sub-step's sedimentation, melting and freezing). Consumer-supplied inputs: the column fields T, qv, qc, qi, qr, qs, qg, xl, cpm and the 22 raw process rates are REWRITE-TARGET ops `input_<name>` (esm-spec 4.2 open tier) that the consumer lowers -- in the inline tests through a per-test `expression_template_imports` library (tests/<id>_inputs.esm, extracted from kernel dumps of the instrumented WRF fork ctessum-claude/WRF, commit e42a269 (v4.8.0-2-ge42a269e)) because esm-spec 6.6 `parameter_overrides` admit scalars only, and in EqWeFiC couplings/microphysics_column*.esm through the additive `<name>_in` coupling-target parameters. psacw and pgacw are not inputs: only their mixing-ratio-weighted mean paacw enters the budgets and the update. EqWeFiC, cited here for FORTRAN_BUGS.md and couplings/, is https://github.com/EarthSciML/EqWeFiC, where these components were developed and are coupled into a WRF column.
- WSM6MeltingFreezing
model
atmospheric_dynamics
wsm6
Melting and freezing block of the WRF single-moment 6-class microphysics scheme (WSM6; Hong and Lim 2006), transcribed from the first part of the minor loop of mp_wsm6_run in phys/physics_mmm/mp_wsm6.F90 (WRF 4.8, NCAR/MMM-physics), which the kernel applies IN PLACE, layer by layer and in a fixed order, between the sedimentation of the precipitation and the evaluation of the process rates: (1) melting of snow above 0 C by heat conduction and ventilation (psmlt, HL A33, RH83 A25), (2) melting of graupel (pgmlt, HL A23, LFO 47) evaluated at the temperature already lowered by the snow melting, (3) instantaneous melting of all cloud ice above 0 C (pimlt, HL A47), (4) homogeneous freezing of all cloud water colder than -40 C (pihmf, HL A45), (5) heterogeneous Bigg freezing of cloud water (pihtf, HL A44) and (6) probabilistic Bigg freezing of rain to graupel (pgfrz, HL A20, LFO 45), the last four sharing one supercooling and one latent heat of fusion evaluated after the melting. The physics are the melting RATES psmlt_rate, pgmlt_rate (kg/kg/s) and the freezing RATES pihtf_rate, pgfrz_rate; pimlt and pihmf are total conversions with no rate. Because the block is an in-place step, the quantities the kernel actually applies are INCREMENTS (kg/kg) over the sub-step dtcld with per-process limiters (a melting increment may not exceed the frozen mass, a freezing increment the liquid mass) -- exposed as <process>_inc with dtcld as a parameter, time-step artefacts kept apart from the rates (EqWeFiC FORTRAN_BUGS.md N3) -- and the component also returns the state after the block (T_out, qc_out, qi_out, qr_out, qs_out, qg_out) so that a consumer can chain it into the rate components and the tests can close the water and energy budgets against the kernel. Inputs are the state at the START of the block: the sub-step's initial temperature T (the kernel's t is untouched before this block), cloud water qc (unchanged by sedimentation), the post-sedimentation rain, snow, graupel and cloud-ice mixing ratios, density rho, pressure p (both read by `sd`), and the start-of-step cpm and xl (saturation.esm); the size distributions of the post-sedimentation state come from hydrometeor_slopes.esm mounted as subsystem `sd` (the kernel calls slope_wsm6 right after the sedimentation and reuses those slopes here; mstep, the sedimentation sub-step count of older WSM6 versions, is identically 1 in this version). The transport properties and the ventilation factor come from `sd`, evaluated once at the initial temperature, exactly as the kernel does (work2), while the conductivity entering the graupel melting is re-evaluated at the temperature after the snow melting. Constants: wsm6_parameters.esm (`par`), lib/wrf_constants.esm (`wrf`); templates from microphysics_templates.esm and lib/wrf_air_properties.esm. Consumer-supplied inputs are the rewrite-target ops `input_<name>` lowered in the inline tests through a per-test template library extracted from kernel dumps of the instrumented WRF fork ctessum-claude/WRF, commit e42a269 (v4.8.0-2-ge42a269e). EqWeFiC, cited here for FORTRAN_BUGS.md and couplings/, is https://github.com/EarthSciML/EqWeFiC, where these components were developed and are coupled into a WRF column.
- WSM6Parameters
model
atmospheric_dynamics
wsm6
Scheme constants of the WRF single-moment 6-class microphysics scheme (WSM6), transcribed from the `parameter` declarations, the mp_wsm6_init products and the in-line literals of phys/physics_mmm/mp_wsm6.F90 (WRF 4.8, NCAR/MMM-physics CCPP kernel mp_wsm6_run). Mounted by the WSM6 components as subsystem `par` so that no tuning constant is written inline in the physics. Values are the nominal (decimal) values of the Fortran source; the two Gamma-function constants are the values WSM6 itself computes with its `rgmma` routine (a Weierstrass product truncated after 10000 factors), which differ from the exact Gamma function by about 7e-4 (recorded in EqWeFiC FORTRAN_BUGS.md) -- the scheme's effective constants are the rgmma values, so those are what the tests reproduce. NOTE (also in EqWeFiC FORTRAN_BUGS.md): the kernel declares its constants real(kind_phys) but initialises them from default-real literals, so a real64 build runs with single-precision roundings (bvtr = 0.800000011920929, avtr = 841.9000244); the WSM6 tests document the resulting O(1e-7) relative mismatch in their tolerances rather than reproducing the rounding here. EqWeFiC, cited here for FORTRAN_BUGS.md and couplings/, is https://github.com/EarthSciML/EqWeFiC, where these components were developed and are coupled into a WRF column.
- WSM6Saturation
model
atmospheric_dynamics
wsm6
Thermodynamic state of a column as the WSM6 microphysics scheme evaluates it once per sub-time step (phys/physics_mmm/mp_wsm6.F90, the inlined fpvs block and the cpmcal/xlcal statement functions of mp_wsm6_run): saturation vapor pressure and mixing ratio over water and over ice from the integrated Clausius-Clapeyron relation with temperature-linear latent heats (lib/wrf_thermo.esm saturation_vapor_pressure_fpvs), the relative humidities, the latent heat of vaporization and the moist heat capacity. Layer index `lev` (WRF k, layer 1 at the surface); all fields are pointwise functions of the layer state, so no grid geometry is needed. The ice formula is used only below the triple point, above it the ice saturation equals the water saturation (the Fortran branch). The vapor pressure is capped at es_cap p and the saturation mixing ratio and relative humidity are floored at qmin, exactly as the kernel does. This model is a separate component from the process rates (warm_rain.esm) because WSM6 computes it from the temperature and vapor at the START of the sub-step and does not update it after sedimentation, melting and freezing have changed the temperature (EqWeFiC FORTRAN_BUGS.md note N4); the process-rate components therefore take qsat, rh and xl as inputs so that a consumer can bind either this model's outputs or, to reproduce the kernel, its start-of-step values. Consumer-supplied inputs: the column fields T (temperature), qv (vapor mixing ratio) and p (pressure) are REWRITE-TARGET ops `input_<name>` (esm-spec 4.2 open tier) that the consumer lowers -- in the inline tests through a per-test `expression_template_imports` library (tests/<id>_inputs.esm, extracted from kernel dumps of the instrumented WRF fork ctessum-claude/WRF, commit e42a269 (v4.8.0-2-ge42a269e)) because esm-spec 6.6 `parameter_overrides` admit scalars only. EqWeFiC, cited here for FORTRAN_BUGS.md and couplings/, is https://github.com/EarthSciML/EqWeFiC, where these components were developed and are coupled into a WRF column.
- WSM6SaturationAdjustment
model
atmospheric_dynamics
wsm6
Saturation adjustment of cloud water in the WRF single-moment 6-class microphysics scheme (WSM6; Hong and Lim 2006), transcribed from the pcond block at the end of each sub-time step of mp_wsm6_run (phys/physics_mmm/mp_wsm6.F90, WRF 4.8, NCAR/MMM-physics; the statement function conden and the loop labelled 'pcond: condensational/evaporational rate of cloud water [HL A46] [RH83 A6]'). After every process rate has been applied and the hydrometeors have fallen, the kernel recomputes the saturation mixing ratio OVER WATER from the updated temperature and vapor (the inlined fpvs block, water branch only -- ice saturation plays no part here, whatever the temperature) and removes the remaining super- or sub-saturation with the one-step Newton (Asai 1965; Rutledge and Hobbs 1983 eq. A6) increment dq = (qv - qsat) / (1 + L^2 qsat / (r_v cpm T^2)), the linearisation of the Clausius-Clapeyron feedback of the latent heating on qsat. Condensation (dq > 0) is capped by the available vapor, evaporation (dq < 0) happens only where cloud water exists and is capped by the cloud water present, so that a layer that dries out loses all its cloud (the kernel then pads qc <= qmin to 0). The latent heat L and the moist heat capacity cpm are the START-OF-CALL values (EqWeFiC FORTRAN_BUGS.md note N4), so they are inputs here (saturation.esm xl, cpm); the saturation state at the adjusted temperature comes from saturation.esm mounted as subsystem `sat` on the same inputs. This is an INSTANTANEOUS ADJUSTMENT, not a rate: WSM6 applies the whole increment dq once per sub-step and stores pcond = dq/dtcld only for bookkeeping, so the stored 'rate' scales with 1/dtcld (EqWeFiC FORTRAN_BUGS.md note N3) and a small-dt replay of the kernel is meaningless for it. The model therefore exposes (i) the adjusted target state T*, qv*, qc* and the applied increment dq_applied, which are step-free and are what the tests check against the kernel, (ii) pcond = dq_applied/dtcld as the kernel reports it, and (iii) the relaxation-rate form pcond_relax = dq_adj/tau with an adjustment time tau as a parameter: for tau = dtcld it reproduces the kernel's unlimited rate, and a continuous model that cannot take an instantaneous step would use this form with a physical tau (a few seconds to tens of seconds) as the condensation tendency. Layer index `lev` (WRF k, layer 1 at the surface), pointwise, no grid geometry. Consumer-supplied inputs are the REWRITE-TARGET ops input_T, input_qv, input_p (read by the `sat` subsystem and re-exported), input_qc, input_xl and input_cpm, lowered in the inline tests through a per-test expression_template_imports library extracted from kernel dumps of the instrumented WRF fork ctessum-claude/WRF, commit e42a269 (v4.8.0-2-ge42a269e) (esm-spec 6.6 admits scalar overrides only). EqWeFiC, cited here for FORTRAN_BUGS.md and couplings/, is https://github.com/EarthSciML/EqWeFiC, where these components were developed and are coupled into a WRF column.
- WSM6Sedimentation
model
atmospheric_dynamics
wsm6
Sedimentation (fallout) of the precipitating hydrometeors of the WRF single-moment 6-class microphysics scheme (WSM6; Hong and Lim 2006), written as the flux-form continuity law of each falling category, dq/dt = -(1/rho) d/dz(rho v_t q), with the mass-weighted terminal fall speeds v_t of hydrometeor_slopes.esm (mounted as subsystem sd) and lowered on the column_nonuniform_1d grid by EarthSciDiscretizations sedimentation_jh2010_flux_D_lev (PR #42), the dt -> 0 limit of WSM6's own forward semi-Lagrangian fallout (nislfv_rain_plm, Juang and Hong 2010): the flux through a layer's lower face is a third-order interpolated interface fall speed times the monotone average-slope face value of the layer above (FORTRAN_BUGS N77), nothing enters through the model top, and the outflow through the lowest face is the surface precipitation rate. Rain falls at its own speed v_r; snow and graupel fall TOGETHER at the mixing-ratio-weighted speed v_sg (WSM6 sediments the two categories jointly since V3.0, nislfv_rain_plm6 with the combined worka), so the snow and graupel fluxes both use W_sg; cloud ice falls at v_i (Heymsfield-Donner power law of the mean crystal diameter); cloud water does not fall. Negative input mixing ratios (round-off in the kernel inputs) are advected as zero mass; WSM6 advects den*q with the negatives in it, which in these tests changes the tendencies by <= 1.1e-9 of the column maximum. THIS IS THE METHOD-OF-LINES (INSTANTANEOUS DERIVATIVE) FORM: WSM6 integrates fallout with that semi-Lagrangian scheme, whose increment over one WRF step is not dt times this derivative, but as dt -> 0 its tendency converges to exactly the operator written here (measured against the verbatim Fortran routine in every test, to <= 1.14e-7 of the column maximum for rain, snow and graupel and 6.4e-6 for ice; the ice gap is the one branch the rule omits, the upwind side of a face whose interpolated speed overshoots below zero). The fall speeds are set to zero where WSM6 zeroes them (rain where q_r <= 0, ice where q_i <= 0, the joint snow/graupel speed where q_s + q_g <= 1e-15): with donor-cell that was immaterial, because the flux of an empty layer is zero either way, but the jh2010 interface speed reads the NEIGHBOURS' speeds and switches to the layer above wherever a speed is exactly zero, and without the zero the early-storm rain tendency was 16 % off. The kernel's `fall` flux DIAGNOSTIC converges (linearly in dt) to the layer-centred fluxes rho v_t q, which is what the FLUX assertions pin; they do not depend on the rule. Until 2026-09-22 this component imported the first-order donor-cell rule sedimentation_upwind1_flux_D_lev, which differs from WRF's converged fallout by 16-112 % of the column maximum in these tests. Transcribed from the fallout block of mp_wsm6_run in phys/physics_mmm/mp_wsm6.F90 (WRF 4.8, NCAR/MMM-physics fork ctessum-claude/MMM-physics@52cfbd7): slope_wsm6 -> workr/worka -> nislfv_rain_plm/plm6 -> fall, and the ice fallout work1c -> nislfv_rain_plm -> fallc. EqWeFiC, cited here for FORTRAN_BUGS.md and couplings/, is https://github.com/EarthSciML/EqWeFiC, where these components were developed and are coupled into a WRF column.
- WSM6WarmRain
model
atmospheric_dynamics
wsm6
Warm-rain process rates of the WRF single-moment 6-class microphysics scheme (WSM6; Hong and Lim 2006, Hong, Dudhia and Chen 2004), transcribed from the warm-rain block of mp_wsm6_run in phys/physics_mmm/mp_wsm6.F90 (WRF 4.8, NCAR/MMM-physics): autoconversion of cloud water to rain praut = qck1 qc^(7/3) above the threshold qc0 (HDC eq. 16), accretion of cloud water by rain pracw = pacrr lambda^-(3+b) qc (rho0/rho)^(1/2) (HL eq. A40), and evaporation/condensation of rain prevp = (rh - 1)(precr1 lambda^-2 + precr2 f_v coeres)/F (HDC eq. 14), all in kg/kg/s as pointwise functions of the layer state on the layer index `lev` (WRF k, layer 1 at the surface; no grid geometry is needed). The raindrop size distribution (the inverse slope lambda^-1 and its powers, the density factor), the transport properties of air (kinematic viscosity, vapor diffusivity, thermal conductivity), the ventilation factor and the rain ventilation moment come from hydrometeor_slopes.esm mounted as subsystem `sd`, which the cold-rain, deposition, melting and sedimentation components mount too, so every process sees one size distribution and one work2 for a given state, as in the kernel; the diffusional-growth denominator F, which needs the saturation state, is computed here (microphysics_templates.esm); the scheme constants (n0r, a, b, r0, N_c, ...) come from wsm6_parameters.esm as subsystem `par` and the physical constants from lib/wrf_constants.esm as subsystem `wrf`. The derived rate coefficients qc0 = (4/3) pi rho_w r0^3 N_c / rho0, qck1 = 0.104 g E / (N_c rho_w)^(1/3) / mu rho0^(4/3), pacrr = pi n0r a Gamma(3+b) E_rc/4, precr1 = 2 pi n0r a_v and precr2 = 2 pi n0r b_v a^(1/2) Gamma(2.5+b/2) are observeds so that they can be checked against the values mp_wsm6_init computes. The saturation state (qsat, rh, xl) is an INPUT rather than computed here: WSM6 evaluates it once at the start of each sub-time step (saturation.esm) and does not refresh it after sedimentation, melting and freezing have changed the temperature, so the rates are evaluated at a temperature that differs from the one behind qsat/rh/xl (EqWeFiC FORTRAN_BUGS.md note N4); a consumer binds saturation.esm's outputs at the state of its choice. The UNLIMITED rates praut, pracw, prevp are the physics; the kernel additionally applies per-process time-step limiters (a sink may not remove more than q/dtcld per sub-step, rain evaporation/condensation may not exceed half the vapor deficit/excess per sub-step), which are exposed separately as praut_lim, pracw_lim, prevp_lim with the sub-step length dtcld as a parameter -- they are time-step artefacts, not physics (EqWeFiC FORTRAN_BUGS.md note N3), and the mass-conservation rescaling the kernel applies afterwards is not part of this component. Consumer-supplied inputs: the column fields qv, qc, qsat, rh, xl here and T, qr, qi, qs, qg, rho, p in `sd` (ice, snow and graupel enter only sd's diagnostics, not the warm-rain rates) are REWRITE-TARGET ops `input_<name>` (esm-spec 4.2 open tier) that the consumer lowers -- in the inline tests through a per-test `expression_template_imports` library (tests/<id>_inputs.esm, extracted from kernel dumps of the instrumented WRF fork ctessum-claude/WRF, commit e42a269 (v4.8.0-2-ge42a269e)) because esm-spec 6.6 `parameter_overrides` admit scalars only. EqWeFiC, cited here for FORTRAN_BUGS.md and couplings/, is https://github.com/EarthSciML/EqWeFiC, where these components were developed and are coupled into a WRF column.
- YSU
model
atmospheric_dynamics
ysu
The YSU (Yonsei University) nonlocal boundary-layer scheme of Hong, Noh and Dudhia (2006), with the stable-regime (Hong 2010) and top-down (theta_li) boundary-layer-top diagnostics of WRF 4.8, written as a single-column PDE 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). The physics is transcribed from the CCPP kernel bl_ysu_run in phys/physics_mmm/bl_ysu.F90 (NCAR/MMM-physics, the WRF 4.8 submodule). Prognostic column fields theta (potential temperature), u, v, qv, qc and qi obey the density-weighted flux-form vertical diffusion d(c)/dt = (1/rho) d/dz[ rho K_c dc/dz - Phi_c ], where K_c is the interface eddy diffusivity of the field (K_h for theta, K_m for u and v, K_q for water) and Phi_c is the prescribed (non-gradient) part of the turbulent flux: the surface flux on interface 1 (-hfx/cp for theta, -qfx for qv, rho_s u_*^2 u_1/|U| for momentum -- the sign convention of the ESD flux rule, Phi = rho K dc/dz on the face) and, inside the boundary layer, the YSU nonlocal (counter-gradient) flux rho K_c gamma_c plus the entrainment flux (w'c')_h ((z - z_1)/(h - z_1))^3, zero on the top interface. The gradient term is lowered by the ESD rule varcoeff_face_laplacian_lev_flux_bc applied to (rho K) on the interfaces (its own prescribed face fluxes kdudz_bot/kdudz_top are zero here because every prescribed flux is carried by Phi so that the six prognostic fields can share one rule instance), the prescribed-flux term by face_flux_D_lev_supplied_faces. The density weighting is exactly the hydrostatic sigma-coordinate form of the Fortran: rho on an interface is (p[k] - p[k+1])/(g (zc[k+1] - zc[k])) and in a layer (p_int[k] - p_int[k+1])/(g dz[k]), so with WRF's pressures and heights the lowered operator reproduces bl_ysu_run's tridiagonal coefficients term by term (dsig xkzh rdz / del). Boundary-layer height: the bulk-Richardson search of components/atmospheric_dynamics/ysu/bulk_richardson.esm is applied (1) with the lowest-level theta_v, (2) with the thermal excess of the surface heat and moisture fluxes when the surface layer is unstable and the buoyancy flux positive, (3) the top-down theta_li scan that raises the top to just above the highest theta_li-unstable level (ysu_topdown_pblmix; it starts at the previous kpbl and evaluates the bulk Richardson number from theta_li at every level it visits, level 1 included -- brli1 -- rather than seeding level 1 with the surface-layer br), and (4) the stable-regime search with the Hong (2010) critical value (0.25 over land, Rossby-number dependent over water) when the surface layer is stable and no boundary layer was found; each search is an aggregate over the level index and never a recurrence (see bulk_richardson.esm). Diffusivities: inside the boundary layer the K-profile K_m = k w_s z (1 - z/h)^p with the surface-layer velocity scale w_s = (u_*^3 + phifac k w_*^3 (1 - z/h))^(1/3) (or u_*/phi_m(z) when stable), K_h = K_m / Pr with the height-tapered Prandtl number of Hong et al. (2006, their eq. A10), K_q likewise; above the boundary layer the local Ri-dependent mixing-length diffusivity of Louis type with the in-cloud moist Richardson number; in the entrainment zone ((z - h)/delta)^2 < 4.6 the geometric mean of the local value and the entrainment-flux value -w_e dz_h exp(-((z - h)/delta)^2). Every diffusivity is floored by the background values and capped by xkzmax. Consumer-supplied inputs: the column fields (p, p_int, exner, ze and the initial theta, u, v, qv, qc, qi) are REWRITE-TARGET ops `input_<name>` (esm-spec 4.2 open tier) that the consumer lowers -- in the inline tests through a per-test `expression_template_imports` library (tests/<test id>_inputs.esm) because esm-spec 6.6 `parameter_overrides` admit scalars only; surface-layer scalars (hfx, qfx, u_*, psi_m, psi_h, br, |U|, U10, land mask, z0, psfc) are ordinary parameters. NOT transcribed (inactive in every test regime): the BEP/BEP+BEM urban forcing terms, the optional ocean-current (uox/vox) surface drag, the topo_wind corrections (ctopo = ctopo2 = 1), the extra passive-tracer mixing (nmix = 0), and the WRF diagnostic outputs u10/v10 (pass-through), dusfc/dvsfc/dtsfc/dqsfc (column sums) and the TKE/hybrid-PBLH diagnostics. The cloud-top radiative-entrainment branch (ysu_topdown_pblmix, WRF cloudflg: a cloud layer at kpbl-1 whose integrated radiative cooling radsum drives top-down thermals wstar3_2, extra entrainment we_rad, a counter-gradient term hgamt2 and a second K-profile term wscalek2) is transcribed (exercised by synthetic_cloudtop_call120, and switched off by topdown = 0 in synthetic_notopdown_cloudtop_call120); radsum is the cumulative column integral of the radiative cooling. Fractional powers of quantities that vanish identically outside their regime (w_*^3 in a stable column, wstar3_2 below a cloud-free top) are gated with ifelse, so that a Jacobian of the right-hand side never evaluates the derivative of a root at zero. Tendencies are observed variables (`dthdt`, `dudt`, `dvdt`, `dqvdt`, `dqcdt`, `dqidt`) so that the inline tests assert the instantaneous right-hand side at time 0 against the real64 kernel's tendency extrapolated to dt -> 0 (Richardson extrapolation of the implicit step over dt = 0.04, 0.02, 0.01 s; the Fortran solves the diffusion implicitly, so its finite-step tendency differs from the derivative by O(dt K / dz^2)). Test provenance: the inputs and expected values come from a WRF v4.8.0 em_scm_xy single-column run of the instrumented fork ctessum-claude/WRF (branch earthsciml-instrumented, module_esm_dump; physics_mmm at ctessum-claude/MMM-physics 52cfbd7) and from replays of the dumped kernel calls through that fork's real64 kernels/ysu_driver; the synthetic_* tests replay a dumped column after the modification their description states. The numbers were transcribed by tools/fill_tests.py of EarthSciML/EqWeFiC. The dumps, the driver and the generator are not part of this repository, so the values are recorded data rather than regenerable output.
- YSUParameters
model
atmospheric_dynamics
ysu
Scheme constants of the YSU (Yonsei University) nonlocal boundary-layer scheme, transcribed from the `parameter` declarations and in-line literals of phys/physics_mmm/bl_ysu.F90 (WRF 4.8, NCAR/MMM-physics CCPP kernel `bl_ysu_run`). Mounted by the YSU component as subsystem `par` so that no tuning constant is written inline in the physics. Values are the nominal (decimal) values written in the Fortran source. NOTE (recorded in FORTRAN_BUGS.md of EarthSciML/EqWeFiC): the kernel declares these as real(kind_phys) but initialises them from default-real literals, so a real64 build actually runs with the single-precision roundings (e.g. h1 = 0.33333335 -> 0.3333333432674408, not 1/3; afac = 6.800000190734863); the YSU tests document the resulting O(1e-7) relative mismatch in their tolerances rather than reproducing the rounding here.