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