GWDOParameters
Scheme constants of WRF's orographic gravity-wave drag and low-level flow-blocking scheme (GWDO, `gwd_opt = 1`), transcribed one-for-one from the `real(kind=kind_phys), parameter` and `integer, parameter` declarations of `phys/physics_mmm/bl_gwdo.F90` (WRF 4.8, NCAR/MMM-physics CCPP kernel `bl_gwdo_run`; the Hong et al. 2025 revision of Choi and Hong 2015). Mounted by every GWDO component as subsystem `par` so that no tuning constant is written inline in the physics. Every constant is declared `real(kind=kind_phys), parameter` but INITIALISED FROM A DEFAULT-REAL LITERAL. The tests reference the real64 standalone kernel driver (`kernels/gwdo_driver` / `gwdo_diag_driver` of WRF fork branch earthsciml-instrumented-gwdo: `kind_phys = real64` via -DDOUBLE_PRECISION, bl_gwdo.F90 compiled WITHOUT -fdefault-real-8), in which a default-real literal is rounded to binary32 and then widened, so the scheme runs the binary64 widening of the literal's binary32 value -- the same defect N2 records for YSU and WSM6 and N45/N101 for the KPP mechanisms. A real WRF `configure -r8` build is NOT this: it promotes default-real literals, so there every constant below is its exact decimal (ce = 0.8). The two builds differ by about 1e-9 relative in efac and the launch stress. YSU and WSM6 reference the same kind of real64 kernel driver, but carry the decimals and absorb the resulting O(1e-7) mismatch in their tolerances; GWDO carries the roundings because its contract is rel 1e-9, which that mismatch would exceed. Fifteen of the twenty-one literals are exactly representable in binary32 and are unaffected (0.25, 1., -100., 0., 10., 1., 10., 1., 10., 50., 1., 10., 10., 0., 750.). SIX ARE NOT, and the values below are their widened binary32 roundings, not their decimals: `ce` = 0.800000011920929, `bnv2min` and `olmin` = 9.999999747378752e-06, `odmin` = 0.10000000149011612, `pcutoff_den` = 0.009999999776482582, `qmin` = 1.0000000031710769e-30 (FORTRAN_BUGS N103). Only `ce` reaches an answer on the reference set -- it is the exponent of the asymmetry enhancement (oa + 2)^(ce Fr), where its 1.5e-8 relative offset becomes 1.5e-9 to 4.6e-9 in efac and in the launch stress. Carrying the roundings makes the agreement EXACT; carrying the decimals misses the real64 kernel by that amount, which is above the rel 1e-9 contract. The SIX constants GWDO does NOT declare -- g, cp, R_d, R_v, eps_1 and pi -- arrive as subroutine arguments. The first five come from WRF's `module_model_constants` and are read here from `lib/wrf_constants.esm`. pi does NOT: the driver passes the truncated inline literal `PI=3.141592653` (`module_pbl_driver.F:2192`) rather than `piconst` (FORTRAN_BUGS N102), and `lib/wrf_constants.esm` carries only the full `piconst`, so the value WRF actually passes is declared below as `pi`. It reaches only the wind-rose sector of the low-level wind (`fdir = mdir/(2 pi)` and `wdir = atan2(ubar, vbar) + pi`, bl_gwdo.F90:212 and :352). Replaying all 140 dumped rows through the real64 driver with pi = 3.141592653 instead of math.pi (gwdo_real/run_diag64p.py) reproduces every output and diagnostic field bit for bit.
Description
Scheme constants of WRF’s orographic gravity-wave drag and low-level flow-blocking scheme (GWDO, gwd_opt = 1), transcribed one-for-one from the real(kind=kind_phys), parameter and integer, parameter declarations of phys/physics_mmm/bl_gwdo.F90 (WRF 4.8, NCAR/MMM-physics CCPP kernel bl_gwdo_run; the Hong et al. 2025 revision of Choi and Hong 2015). Mounted by every GWDO component as subsystem par so that no tuning constant is written inline in the physics. Every constant is declared real(kind=kind_phys), parameter but INITIALISED FROM A DEFAULT-REAL LITERAL. The tests reference the real64 standalone kernel driver (kernels/gwdo_driver / gwdo_diag_driver of WRF fork branch earthsciml-instrumented-gwdo: kind_phys = real64 via -DDOUBLE_PRECISION, bl_gwdo.F90 compiled WITHOUT -fdefault-real-8), in which a default-real literal is rounded to binary32 and then widened, so the scheme runs the binary64 widening of the literal’s binary32 value – the same defect N2 records for YSU and WSM6 and N45/N101 for the KPP mechanisms. A real WRF configure -r8 build is NOT this: it promotes default-real literals, so there every constant below is its exact decimal (ce = 0.8). The two builds differ by about 1e-9 relative in efac and the launch stress. YSU and WSM6 reference the same kind of real64 kernel driver, but carry the decimals and absorb the resulting O(1e-7) mismatch in their tolerances; GWDO carries the roundings because its contract is rel 1e-9, which that mismatch would exceed. Fifteen of the twenty-one literals are exactly representable in binary32 and are unaffected (0.25, 1., -100., 0., 10., 1., 10., 1., 10., 50., 1., 10., 10., 0., 750.). SIX ARE NOT, and the values below are their widened binary32 roundings, not their decimals: ce = 0.800000011920929, bnv2min and olmin = 9.999999747378752e-06, odmin = 0.10000000149011612, pcutoff_den = 0.009999999776482582, qmin = 1.0000000031710769e-30 (FORTRAN_BUGS N103). Only ce reaches an answer on the reference set – it is the exponent of the asymmetry enhancement (oa + 2)^(ce Fr), where its 1.5e-8 relative offset becomes 1.5e-9 to 4.6e-9 in efac and in the launch stress. Carrying the roundings makes the agreement EXACT; carrying the decimals misses the real64 kernel by that amount, which is above the rel 1e-9 contract. The SIX constants GWDO does NOT declare – g, cp, R_d, R_v, eps_1 and pi – arrive as subroutine arguments. The first five come from WRF’s module_model_constants and are read here from lib/wrf_constants.esm. pi does NOT: the driver passes the truncated inline literal PI=3.141592653 (module_pbl_driver.F:2192) rather than piconst (FORTRAN_BUGS N102), and lib/wrf_constants.esm carries only the full piconst, so the value WRF actually passes is declared below as pi. It reaches only the wind-rose sector of the low-level wind (fdir = mdir/(2 pi) and wdir = atan2(ubar, vbar) + pi, bl_gwdo.F90:212 and :352). Replaying all 140 dumped rows through the real64 driver with pi = 3.141592653 instead of math.pi (gwdo_real/run_diag64p.py) reproduces every output and diagnostic field bit for bit.
Reference
- Hong, S.-Y., and co-authors (2025). Revision of the orographic gravity wave drag parameterization in the KIAPS Integrated Model. Wea. Forecasting.
- Choi, H.-J., and S.-Y. Hong (2015). An updated subgrid orographic parameterization for global atmospheric forecast models. J. Geophys. Res. Atmos. 120, 12445-12457.
- Kim, Y.-J., and A. Arakawa (1995). Improvement of orographic gravity wave parameterization using a mesoscale gravity wave model. J. Atmos. Sci. 52, 1875-1902.
- Shutts, G. (1985). Gravity-wave drag parametrization over complex terrain: the effect of critical-level absorption in directional wind-shear. Quart. J. Roy. Meteor. Soc. 121, 1005-1021.
- NCAR/MMM-physics bl_gwdo.F90 at commit 52cfbd7 (WRF 4.8 phys/physics_mmm submodule).
Parameters
| Name | Units | Default | Description |
|---|---|---|---|
ric | 1 | 0.25 | Critical Richardson number. It is BOTH the branch test rim <= ric that selects the wave-saturation hypothesis AND the zero of the saturation factor 2 sqrt(temc) - temc that the branch then evaluates (temc = 2 + 1/sqrt(Ri) is 4 exactly at Ri = 0.25), which is the cancellation recorded as FORTRAN_BUGS N85. |
velmin | m/s | 1.0 | Minimum wind speed. Used three ways: as the floor on the squared shear max(dw2, velmin) in the Richardson number (where it is dimensionally a squared speed, not a speed – see the note in column_state.esm), as the floor on the low-level speed ulow, and as the floor on a small POSITIVE projected speed velco. |
dw2min | m^2/s^2 | 1.0 | Floor on the SQUARED vertical wind difference in the layer Richardson number, shr2 = max(dw2, dw2min) rdz^2. The Fortran spells this floor velmin – the same symbol it uses for a wind SPEED – so the comparison is between a squared speed and a speed. The numeric value is 1 either way, so nothing changes; this entry exists so that the .esm carries the floor with the units of the quantity it floors, per the repository rule that a constant never borrows another quantity’s dimension. |
rimin | 1 | -100.0 | Floor on the layer Richardson number usqj. |
bnv2min | 1/s^2 | 9.999999747378752e-06 | Floor on the squared Brunt-Vaisala frequency before its square root is taken in the wave-saturation profile. The Fortran literal 1.e-5 is default-real; the value is its binary32 rounding widened to binary64, which is what the real64 kernel driver the tests reference runs (bl_gwdo.F90 compiled without literal promotion). Under a promoted WRF configure -r8 build it would be the exact decimal 1.e-5; the difference is 2.5e-8 relative; it never binds on the reference set (FORTRAN_BUGS N103). |
efacmin | 1 | 0.0 | Lower clamp on the asymmetry enhancement factor efac. |
efacmax | 1 | 10.0 | Upper clamp on the asymmetry enhancement factor efac. |
frc | 1 | 1.0 | Critical Froude number, the scale in the enhancement-factor exponent ce*Fr/frc. |
frmax | 1 | 10.0 | Upper clamp on the Froude number Fr = N |var| od / ulow. |
ce | 1 | 0.800000011920929 | Mesoscale-model tuning coefficient in the enhancement factor efac = (oa + 2)^(ce Fr / frc). The Fortran literal 0.8 is default-real; the value is its binary32 rounding widened to binary64, which is what the real64 kernel driver the tests reference runs (bl_gwdo.F90 compiled without literal promotion). Under a promoted WRF configure -r8 build it would be the exact decimal 0.8; the difference is 1.5e-8 relative, which becomes 1.5e-9 to 4.6e-9 relative in efac and the launch stress – the only one of the six that reaches an answer on the reference set (FORTRAN_BUGS N103). |
cg | 1 | 1.0 | Mesoscale-model tuning coefficient in the convexity factor gfac = Fr^2 oc / (Fr^2 oc + cg). |
var_min | m | 10.0 | Minimum sub-grid orographic standard deviation. DECLARED BUT NEVER READ in bl_gwdo.F90 (WRF 4.8): the standard-deviation gate is var <= 0, not var < var_min. Kept here so the transcription of the parameter block is complete and the dead constant is visible. |
hmt_min | m | 50.0 | Minimum sub-grid orographic maximum height. omax <= hmt_min switches the whole scheme off in a column. Because WPS 4.3 writes no ELVMAX, omax is identically 0 there and this gate silently disables GWDO everywhere (FORTRAN_BUGS B17). |
oc_min | 1 | 1.0 | Lower clamp on the orographic convexity oc1. |
oc_max | 1 | 10.0 | Upper clamp on the orographic convexity oc1. |
olmin | 1 | 9.999999747378752e-06 | Floor on the orographic length fractions ol and olp (which are fractional widths, hence dimensionless). The Fortran literal 1.e-5 is default-real; the value is its binary32 rounding widened to binary64, which is what the real64 kernel driver the tests reference runs (bl_gwdo.F90 compiled without literal promotion). Under a promoted WRF configure -r8 build it would be the exact decimal 1.e-5; the difference is 2.5e-8 relative; it never binds on the reference set (FORTRAN_BUGS N103). |
odmin | 1 | 0.10000000149011612 | Lower clamp on the horizontal orographic aspect ratio od = olp/ol. The Fortran literal 0.1 is default-real; the value is its binary32 rounding widened to binary64, which is what the real64 kernel driver the tests reference runs (bl_gwdo.F90 compiled without literal promotion). Under a promoted WRF configure -r8 build it would be the exact decimal 0.1; the difference is 1.5e-8 relative; it never binds on the reference set (FORTRAN_BUGS N103). |
odmax | 1 | 10.0 | Upper clamp on the horizontal orographic aspect ratio od = olp/ol. |
cdmin | 1 | 0.0 | Minimum bulk drag coefficient. DECLARED BUT NEVER READ in bl_gwdo.F90 (WRF 4.8): the flow-blocking drag coefficient is clamped with the inline literal max(2 - 1/od, 0.) instead. Kept for completeness of the transcription. |
pcutoff | Pa | 750.0 | Pressure above which (p <= pcutoff, i.e. 7.5 hPa and higher) the mesosphere density limiter is applied to the drag. |
pcutoff_den | kg/m^3 | 0.009999999776482582 | Reference density of the mesosphere limiter: the drag is reduced by min(rho/pcutoff_den, 1). The Fortran literal 0.01 is default-real; the value is its binary32 rounding widened to binary64, which is what the real64 kernel driver the tests reference runs (bl_gwdo.F90 compiled without literal promotion). Under a promoted WRF configure -r8 build it would be the exact decimal 0.01; the difference is 2.2e-8 relative; it never binds on the reference set (FORTRAN_BUGS N103). |
qmin | m/s^2 | 1.0000000031710769e-30 | Threshold on |taud| below which no limiter is applied at all. It is compared against a stress divergence, so it carries that quantity’s units. The Fortran literal 1.e-30 is default-real; the value is its binary32 rounding widened to binary64, which is what the real64 kernel driver the tests reference runs (bl_gwdo.F90 compiled without literal promotion). Under a promoted WRF configure -r8 build it would be the exact decimal 1.e-30; the difference is 3.2e-9 relative; only a threshold, and no |taud| on the reference set lies between the two values (FORTRAN_BUGS N103). |
kgwdmin | 1 | 2.0 | Lowest admissible wave-launch (reference) level, as a level index. integer, parameter in the Fortran; carried as a real here because esm variables are real-valued and every use is a comparison against a level index. |
pi | 1 | 3.141592653 | The pi GWDO is actually given: WRF’s driver passes the truncated inline literal PI=3.141592653 to bl_gwdo_run (phys/module_pbl_driver.F:2192), not piconst = 3.141592653589793 of lib/wrf_constants.esm (FORTRAN_BUGS N102). bl_gwdo.F90 uses it in exactly two places, both in picking the wind-rose sector: fdir = mdir/(2 pi_) (line 212) and wdir = atan2(ubar, vbar) + pi_ (line 352). The 5.9e-10 truncation moves a sector boundary by at most about 2e-9 rad, so it can change nwd only for a wind that close to a boundary; on the 140 dumped rows it changes nothing (gwdo_real/run_diag64p.py replays them with this value and with math.pi and gets bit-identical outputs). Carried at its decimal value: the reference replay supplies it as a binary64 argument (gwdo_real/mkflat64x.py), as it does g, cp, R_d, R_v and eps_1. In WRF’s own real32 build the literal is rounded to binary32 (3.1415927410125732) on the way in. |
mdir | 1 | 8.0 | Number of sectors of the wind rose used to pick the orographic statistics along the low-level wind. |
Raw .esm
Raw .esm JSON (this component)
{
"variables": {
"ric": {
"type": "parameter",
"units": "1",
"default": 0.25,
"description": "Critical Richardson number. It is BOTH the branch test `rim <= ric` that selects the wave-saturation hypothesis AND the zero of the saturation factor 2 sqrt(temc) - temc that the branch then evaluates (temc = 2 + 1/sqrt(Ri) is 4 exactly at Ri = 0.25), which is the cancellation recorded as FORTRAN_BUGS N85."
},
"velmin": {
"type": "parameter",
"units": "m/s",
"default": 1.0,
"description": "Minimum wind speed. Used three ways: as the floor on the squared shear `max(dw2, velmin)` in the Richardson number (where it is dimensionally a squared speed, not a speed -- see the note in `column_state.esm`), as the floor on the low-level speed `ulow`, and as the floor on a small POSITIVE projected speed `velco`."
},
"dw2min": {
"type": "parameter",
"units": "m^2/s^2",
"default": 1.0,
"description": "Floor on the SQUARED vertical wind difference in the layer Richardson number, `shr2 = max(dw2, dw2min) rdz^2`. The Fortran spells this floor `velmin` -- the same symbol it uses for a wind SPEED -- so the comparison is between a squared speed and a speed. The numeric value is 1 either way, so nothing changes; this entry exists so that the .esm carries the floor with the units of the quantity it floors, per the repository rule that a constant never borrows another quantity's dimension."
},
"rimin": {
"type": "parameter",
"units": "1",
"default": -100.0,
"description": "Floor on the layer Richardson number `usqj`."
},
"bnv2min": {
"type": "parameter",
"units": "1/s^2",
"default": 9.999999747378752e-06,
"description": "Floor on the squared Brunt-Vaisala frequency before its square root is taken in the wave-saturation profile. The Fortran literal `1.e-5` is default-real; the value is its binary32 rounding widened to binary64, which is what the real64 kernel driver the tests reference runs (bl_gwdo.F90 compiled without literal promotion). Under a promoted WRF `configure -r8` build it would be the exact decimal 1.e-5; the difference is 2.5e-8 relative; it never binds on the reference set (FORTRAN_BUGS N103)."
},
"efacmin": {
"type": "parameter",
"units": "1",
"default": 0.0,
"description": "Lower clamp on the asymmetry enhancement factor efac."
},
"efacmax": {
"type": "parameter",
"units": "1",
"default": 10.0,
"description": "Upper clamp on the asymmetry enhancement factor efac."
},
"frc": {
"type": "parameter",
"units": "1",
"default": 1.0,
"description": "Critical Froude number, the scale in the enhancement-factor exponent ce*Fr/frc."
},
"frmax": {
"type": "parameter",
"units": "1",
"default": 10.0,
"description": "Upper clamp on the Froude number Fr = N |var| od / ulow."
},
"ce": {
"type": "parameter",
"units": "1",
"default": 0.800000011920929,
"description": "Mesoscale-model tuning coefficient in the enhancement factor efac = (oa + 2)^(ce Fr / frc). The Fortran literal `0.8` is default-real; the value is its binary32 rounding widened to binary64, which is what the real64 kernel driver the tests reference runs (bl_gwdo.F90 compiled without literal promotion). Under a promoted WRF `configure -r8` build it would be the exact decimal 0.8; the difference is 1.5e-8 relative, which becomes 1.5e-9 to 4.6e-9 relative in efac and the launch stress -- the only one of the six that reaches an answer on the reference set (FORTRAN_BUGS N103)."
},
"cg": {
"type": "parameter",
"units": "1",
"default": 1.0,
"description": "Mesoscale-model tuning coefficient in the convexity factor gfac = Fr^2 oc / (Fr^2 oc + cg)."
},
"var_min": {
"type": "parameter",
"units": "m",
"default": 10.0,
"description": "Minimum sub-grid orographic standard deviation. DECLARED BUT NEVER READ in bl_gwdo.F90 (WRF 4.8): the standard-deviation gate is `var <= 0`, not `var < var_min`. Kept here so the transcription of the parameter block is complete and the dead constant is visible."
},
"hmt_min": {
"type": "parameter",
"units": "m",
"default": 50.0,
"description": "Minimum sub-grid orographic maximum height. `omax <= hmt_min` switches the whole scheme off in a column. Because WPS 4.3 writes no ELVMAX, omax is identically 0 there and this gate silently disables GWDO everywhere (FORTRAN_BUGS B17)."
},
"oc_min": {
"type": "parameter",
"units": "1",
"default": 1.0,
"description": "Lower clamp on the orographic convexity oc1."
},
"oc_max": {
"type": "parameter",
"units": "1",
"default": 10.0,
"description": "Upper clamp on the orographic convexity oc1."
},
"olmin": {
"type": "parameter",
"units": "1",
"default": 9.999999747378752e-06,
"description": "Floor on the orographic length fractions ol and olp (which are fractional widths, hence dimensionless). The Fortran literal `1.e-5` is default-real; the value is its binary32 rounding widened to binary64, which is what the real64 kernel driver the tests reference runs (bl_gwdo.F90 compiled without literal promotion). Under a promoted WRF `configure -r8` build it would be the exact decimal 1.e-5; the difference is 2.5e-8 relative; it never binds on the reference set (FORTRAN_BUGS N103)."
},
"odmin": {
"type": "parameter",
"units": "1",
"default": 0.10000000149011612,
"description": "Lower clamp on the horizontal orographic aspect ratio od = olp/ol. The Fortran literal `0.1` is default-real; the value is its binary32 rounding widened to binary64, which is what the real64 kernel driver the tests reference runs (bl_gwdo.F90 compiled without literal promotion). Under a promoted WRF `configure -r8` build it would be the exact decimal 0.1; the difference is 1.5e-8 relative; it never binds on the reference set (FORTRAN_BUGS N103)."
},
"odmax": {
"type": "parameter",
"units": "1",
"default": 10.0,
"description": "Upper clamp on the horizontal orographic aspect ratio od = olp/ol."
},
"cdmin": {
"type": "parameter",
"units": "1",
"default": 0.0,
"description": "Minimum bulk drag coefficient. DECLARED BUT NEVER READ in bl_gwdo.F90 (WRF 4.8): the flow-blocking drag coefficient is clamped with the inline literal `max(2 - 1/od, 0.)` instead. Kept for completeness of the transcription."
},
"pcutoff": {
"type": "parameter",
"units": "Pa",
"default": 750.0,
"description": "Pressure above which (p <= pcutoff, i.e. 7.5 hPa and higher) the mesosphere density limiter is applied to the drag."
},
"pcutoff_den": {
"type": "parameter",
"units": "kg/m^3",
"default": 0.009999999776482582,
"description": "Reference density of the mesosphere limiter: the drag is reduced by min(rho/pcutoff_den, 1). The Fortran literal `0.01` is default-real; the value is its binary32 rounding widened to binary64, which is what the real64 kernel driver the tests reference runs (bl_gwdo.F90 compiled without literal promotion). Under a promoted WRF `configure -r8` build it would be the exact decimal 0.01; the difference is 2.2e-8 relative; it never binds on the reference set (FORTRAN_BUGS N103)."
},
"qmin": {
"type": "parameter",
"units": "m/s^2",
"default": 1.0000000031710769e-30,
"description": "Threshold on |taud| below which no limiter is applied at all. It is compared against a stress divergence, so it carries that quantity's units. The Fortran literal `1.e-30` is default-real; the value is its binary32 rounding widened to binary64, which is what the real64 kernel driver the tests reference runs (bl_gwdo.F90 compiled without literal promotion). Under a promoted WRF `configure -r8` build it would be the exact decimal 1.e-30; the difference is 3.2e-9 relative; only a threshold, and no |taud| on the reference set lies between the two values (FORTRAN_BUGS N103)."
},
"kgwdmin": {
"type": "parameter",
"units": "1",
"default": 2.0,
"description": "Lowest admissible wave-launch (reference) level, as a level index. `integer, parameter` in the Fortran; carried as a real here because esm variables are real-valued and every use is a comparison against a level index."
},
"pi": {
"type": "parameter",
"units": "1",
"default": 3.141592653,
"description": "The pi GWDO is actually given: WRF's driver passes the truncated inline literal `PI=3.141592653` to bl_gwdo_run (`phys/module_pbl_driver.F:2192`), not `piconst` = 3.141592653589793 of `lib/wrf_constants.esm` (FORTRAN_BUGS N102). bl_gwdo.F90 uses it in exactly two places, both in picking the wind-rose sector: `fdir = mdir/(2 pi_)` (line 212) and `wdir = atan2(ubar, vbar) + pi_` (line 352). The 5.9e-10 truncation moves a sector boundary by at most about 2e-9 rad, so it can change `nwd` only for a wind that close to a boundary; on the 140 dumped rows it changes nothing (gwdo_real/run_diag64p.py replays them with this value and with math.pi and gets bit-identical outputs). Carried at its decimal value: the reference replay supplies it as a binary64 argument (gwdo_real/mkflat64x.py), as it does g, cp, R_d, R_v and eps_1. In WRF's own real32 build the literal is rounded to binary32 (3.1415927410125732) on the way in."
},
"mdir": {
"type": "parameter",
"units": "1",
"default": 8.0,
"description": "Number of sectors of the wind rose used to pick the orographic statistics along the low-level wind."
}
},
"equations": []
}