Sponge
- WRFRayleighDamping
model
atmospheric_dynamics
wrf_arw
WRF-ARW's upper-level Rayleigh damping layer (damp_opt = 2), SUBROUTINE rk_rayleigh_damp of dyn_em/module_big_step_utilities_em.F:5836-6110, written as instantaneous decoupled tendencies of a single column on the EarthSciDiscretizations column_nonuniform_1d grid. Within the depth zdamp below the model top z_top the horizontal wind and the (moist, use_theta_m = 1) potential temperature relax toward the base-state sounding and w relaxes to zero, with the strength dampcoef sin^2(pi/2 (1 - (z_top - z)/zdamp)) rising from 0 at the bottom of the layer to dampcoef at the top (Klemp and Lilly 1978; Skamarock et al. 2021, section 4.3). Below the layer the strength is exactly 0: WRF applies the damper only to layers with z >= z_top - zdamp, and 1 - min(1, (z_top - z)/zdamp) = max(0, 1 - (z_top - z)/zdamp) vanishes there, so the max form is identical everywhere. The reference state is interpolated to the layer's CURRENT height (WRF recomputes z from the geopotential each step, so the model levels move against the fixed base profile): linearly in height between the base levels z_base, and linearly EXTRAPOLATED above the top base level (WRF's `if (k2+1 .gt. ktf)` branch), which interp.linear does not do (it clamps), so that branch is written out; below it the interpolation is lib/table_interp.esm's interp.linear for a run-time table -- the bracket zc_bracket once, then interp_linear_bracketed for each profile -- because the base profile is not a literal const (esm-spec section 9.2). Heights: layer centres zc from the interface heights ze (WRF phb + ph over g), z_top = ze[NLEV+1]. Decoupling: WRF adds (c1 mu + c2) dampcoef dcoef (u - u00) to the mass-coupled tendency ru_tendf; dividing by the same coupling mass gives the decoupled rate written here, exactly, for any hybrid coordinate. Note (FORTRAN_BUGS N64): with use_theta_m = 1 the damped field t is the MOIST potential temperature but t_base is the DRY base-state theta (set in module_initialize_scm_xy.F before the dry-to-moist conversion), so the sponge relaxes theta_m toward a dry reference; theta_base here is WRF's t_base + t0 unchanged. Consumer-supplied column fields are rewrite-target ops input_<name>.