Wrf_arw

  • WRFColumnGeometry model atmospheric_dynamics wrf_arw

    Diagnostic thermodynamic and geometric state of a single WRF-ARW column with a fixed dry column mass, on the EarthSciDiscretizations column_nonuniform_1d grid: everything the physics schemes are handed about the column, computed from the dynamical state (geopotential, moist potential temperature, moisture) and the hydrostatic base state. Two WRF routines are transcribed. (1) calc_p_rho_phi (dyn_em/module_big_step_utilities_em.F, non-hydrostatic, hypsometric_opt = 1, use_theta_m = 1): the inverse dry density from the geopotential, alpha_d = -(1/mu_d) dphi/deta, in its base-state split alpha' = -(alpha_b mu' + dphi'/deta)/mu_d, and the pressure from the equation of state p = p0 (R_d theta_m / (p0 alpha_d))^gamma with the moist potential temperature theta_m (no separate vapour factor, because theta_m already carries 1 + (R_v/R_d) q_v). (2) phy_prep (module_big_step_utilities_em.F:4730-4973): dry theta = theta_m/(1 + (R_v/R_d) q_v), the Exner function, temperature, moist density (1 + q_v)/alpha_d, interface and layer heights from the geopotential, layer thicknesses (WRF dz8w), pressure and temperature on the interfaces (eta-linear interpolation inside the column; linear-in-height extrapolation at the surface, and at the top linear-in-height for temperature but in log pressure for pressure, WRF's positive-definite fix exp(w ln p_N + (1-w) ln p_{N-1}), written here in the identical dimensionally clean form p_{N-1} (p_N/p_{N-1})^w), and the hydrostatic pressure (WRF p_hyd_w, p_hyd) integrated downward from the lid p_top over the full (dry plus all water species) column mass, p_hyd(s) = p_top + integral_s^top (1 + q_t) mu_d ds', the pressure the radiation schemes use. The column coordinate is s = 1 - eta (0 at the surface, 1 at the top, increasing with the lev index as the grid requires), so dphi/deta = -dphi/ds and the grid's layer thickness dz is -dnw; the layer-wise geopotential difference is the grid rule face_flux_D_lev_supplied_faces and the downward integral the rule integral_lev_nodes_cumulative_to_top, both over that dz. Heights are named z_w, z_c and dz8w to keep them apart from the coordinate. Real32 note: WRF evaluates p' = p0 temp^gamma - p_b in single precision, a difference of two ~1e5 Pa numbers, so the dumped p' carries O(1e-2) Pa rounding while this float64 evaluation does not; the tests assert p' with an absolute tolerance for that reason. Consumer-supplied column fields are rewrite-target ops input_<name>.

  • WRFCurvature model atmospheric_dynamics wrf_arw

    WRF-ARW's Earth-curvature (metric) momentum terms, SUBROUTINE curvature of dyn_em/module_big_step_utilities_em.F:4175-4469 on its 'normal code' path (map_proj /= 6, not polar), written as instantaneous decoupled tendencies of a single column on the EarthSciDiscretizations column_nonuniform_1d grid. rk_tendency applies them unconditionally, so even the idealized Cartesian em_scm_xy column carries them: du/dt = -u w / a, dv/dt = -v w / a on the layers, and dw/dt = (u^2 + v^2)/a on the interior interfaces (Skamarock et al. 2021, section 2.3; a = the Earth radius, WRF reradius = 1/a). In the reference column the w term is (3^2 + 9^2)/a = 1.4e-5 m/s^2, a few percent of the pressure-gradient-plus-buoyancy tendency, so it is not negligible; PLAN.md 3.1 did not list it. Discretization as in WRF for a horizontally uniform column: w enters the u and v terms as the mean of the two bounding interfaces, and u, v enter the w term linearly interpolated onto the interior interfaces 2..NLEV with the weights w_above/w_below (WRF fzm/fzp); the surface and top interfaces get no term. WRF multiplies the interpolated MASS-COUPLED wind by the interpolated wind; with a constant dry column mass the coupling mass cancels and the product is the square of the interpolated wind. Not transcribed: the vxgm terms (the zonal gradient of the map factor times the wind, plus the tan(latitude) terms of the polar and global-projection branch), identically zero for the uniform map factors of the idealized column, and the general map-factor ratios (all 1 there). Consumer-supplied column fields are rewrite-target ops input_<name>.

  • WRFMoistThetaTendency model atmospheric_dynamics wrf_arw

    WRF-ARW's conversion of the physics temperature tendency into a tendency of the moist potential temperature when the dynamics carries theta_m (use_theta_m = 1, the WRF 4 default): SUBROUTINE conv_t_tendf_to_moist of dyn_em/module_big_step_utilities_em.F:6674-6707, called once per step from dyn_em/module_first_rk_step_part2.F after update_phy_ten has summed the physics tendencies. The physics schemes compute tendencies of the DRY potential temperature theta and of q_v; the dynamics prognoses theta_m = theta (1 + (R_v/R_d) q_v), so the tendency it needs is the product-rule derivative (1 + (R_v/R_d) q_v) dtheta/dt + (R_v/R_d) theta dq_v/dt, with theta recovered from the step's theta_m and q_v as theta_m / (1 + (R_v/R_d) q_v) (the Fortran's (t_1 + T0)/(1 + R_v/R_d moist_old)). Written as instantaneous decoupled rates of a single column on the EarthSciDiscretizations column_nonuniform_1d layer index `lev`: WRF applies the conversion to the mass-coupled t_tendf and moist_tend, but the conversion is linear and both carry the same column mass, so it holds unchanged for the decoupled rates. Consumer-supplied column fields are rewrite-target ops input_<name>.

  • WRFPerturbationCoriolis model atmospheric_dynamics wrf_arw

    WRF-ARW's perturbation Coriolis force (pert_coriolis = .true.), SUBROUTINE perturbation_coriolis of dyn_em/module_big_step_utilities_em.F:3854-4171, written as instantaneous decoupled tendencies of a single column on the EarthSciDiscretizations column_nonuniform_1d grid. The horizontal Coriolis terms act on the wind MINUS the base-state (initial-sounding) wind interpolated to the current layer height, so a base wind (u_b, v_b) is in geostrophic balance with an implied large-scale pressure gradient that the column never computes: du/dt = f (v - v_b) - e cos(alpha) w, dv/dt = -f (u - u_b) + e sin(alpha) w, and at the interior interfaces dw/dt = e (cos(alpha) u' - sin(alpha) v') with u' = u - u_b, v' = v - v_b carried onto the interface. In the em_scm_xy reference column (u_b, v_b) = (3, -9) m/s at every level, the geostrophic wind of the case; plain Coriolis on the total wind (pert_coriolis = .false.) gives a different trajectory. f = 2 Omega sin(lat) and e = 2 Omega cos(lat) are consumer-supplied, as are sin/cos of the grid rotation alpha. Discretization as in WRF for a horizontally uniform column: w enters the u and v equations as the arithmetic mean of the two bounding interfaces (0.25 times the four neighbouring rw), u' and v' enter the w equation through the linear-interpolation weights w_above/w_below (WRF fnm/fnp, eta-based; consumer-supplied geometry) and only on the interior interfaces 2..NLEV (kts+1..ktf) -- the surface and top interfaces get no Coriolis term. At each layer k, WRF interpolates the base wind between z_base[k] and the immediate base level in the direction of the displacement. With increasing base heights, at most one of WRF's two adjacent-level weights is nonzero. A displacement past the selected neighbor saturates at that neighbor's wind. At either boundary layer, an outward displacement leaves its base wind unchanged. Decoupling: in the idealized Cartesian column every map factor is 1 and the hybrid coefficients are c1 = 1, c2 = 0 (hybrid_opt = 0), so the coupling masses of the u, v and w points are all the column dry mass and cancel; the general map-projection / hybrid form is NOT transcribed. Consumer-supplied column fields are rewrite-target ops input_<name>.

  • 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>.

  • WRFVerticalMomentum model atmospheric_dynamics wrf_arw

    Vertical momentum and geopotential equations of a single WRF-ARW column with a fixed dry column mass (no horizontal divergence, so mu_t = 0 and the coordinate vertical velocity ww = 0), on the EarthSciDiscretizations column_nonuniform_1d grid. In the terrain-following dry-hydrostatic-pressure coordinate eta the vertical momentum equation in its perturbation (base-state split) form is mu_d dw/dt = g [ (1/(1+q_m)) dp'/deta - mu' - (q_m/(1+q_m)) mu_b ] (Skamarock et al. 2021, eqs. 2.18 and 2.33, the right-hand side of pg_buoy_w), and the geopotential equation reduces to dphi/dt = g w because every advective term carries u, v (horizontally uniform) or ww (zero). The base state mu_b, p_b is in exact hydrostatic balance, so only the perturbation pressure p' and the perturbation dry column mass mu' appear -- the split removes the O(g) cancellation of the full form. q_m is the total water mixing ratio on the interface (WRF cqw = 0.5 (q_t[k] + q_t[k-1]), the sum of every moist species). The column coordinate is s = 1 - eta (0 at the surface, 1 at the top, increasing with the lev index as the grid requires), so dp'/deta = -dp'/ds; the layer-to-interface difference on the interior interfaces 2..NLEV is the centred difference over the layer-centre spacing dzc (WRF rdn), and at the top interface the pressure lid p = p_top gives p' = 0 half a layer above the top layer centre (WRF's 2 rdnw(kde-1) (0 - p')). At the top interface WRF uses the moisture coefficient of the interface BELOW it (cqw(kde-1)); transcribed as is. The surface interface has no tendency (w is fixed by the flat lower boundary). NOT a D(p', lev) rule: EarthSciDiscretizations has no layer-to-interface gradient rule on column_nonuniform_1d yet, so the difference is written with the column_staggering neighbour templates, as the YSU component does for its interface density; a follow-up rule would let this read as D(p', wrt: lev). This is the continuous right-hand side the acoustic small step integrates (dyn_em/module_small_step_em.F advance_w); its instantaneous value is the large-step tendency rw_tend that pg_buoy_w computes at the time-level-n state, which is what the tests assert. Consumer-supplied column fields are rewrite-target ops input_<name>.