Articles | Volume 19, issue 21
https://doi.org/10.5194/gmd-19-10433-2026
https://doi.org/10.5194/gmd-19-10433-2026
Development and technical paper
 | 
04 Nov 2026
Development and technical paper |  | 04 Nov 2026

Slope-Constrained Orography (SCO v1.0) for explicit discrete-slope control in terrain preprocessing: a case study with WRF-ARW (v4.6.1)

Yulong Ma, Xingwen Jiang, Lin Mu, and Zhiwei Heng
Abstract

Kilometre-scale Weather Research and Forecasting (WRF) simulations over terrain with steep slopes often require strong smoothing to prevent numerical instability, but conventional domain-wide filters alter terrain at every grid point, regardless of whether local slopes require reduction. Slope-Constrained Orography (SCO) is an offline terrain preprocessing method that prescribes a target slope angle θ and adjusts only those grid points whose eight-neighbour elevation differences exceed the implied bound, leaving the remaining terrain unchanged. By prescribing the slope constraint directly, SCO provides a geometrically interpretable primary user-facing parameter for terrain construction and stability testing. In a 1 km WRF case over the highly complex terrain of the southeastern Tibetan Plateau, the least-modified stable SCO member among those tested modifies 14 % of points with a mean elevation change of 8.2 m, compared with 100 % modification and 108.1 m for the corresponding WRF Preprocessing System (WPS) member. The successful SCO configuration produces lower near-surface wind and temperature errors in this case.

Share
1 Introduction

Complex terrain exerts strong control on boundary-layer flow, thermally driven circulations, and orographic precipitation (Raderschall et al., 2008; Cannon et al., 2017; Díaz-Fernández et al., 2025), motivating the use of kilometre-scale grids to resolve ridge–valley structure. In terrain-following coordinate models such as the Weather Research and Forecasting model (WRF; Skamarock et al., 2019), the large elevation differences that arise on kilometre-scale grids over complex terrain amplify horizontal pressure-gradient errors and can trigger numerical instability within a few time steps (Mahrer, 1984; Klemp et al., 2003; Zängl et al., 2004). Terrain preprocessing is therefore necessary, but the smoothing required to prevent instability routinely modifies terrain well beyond the grid points that actually govern stability.

In the standard WRF Preprocessing System (WPS) workflow, geogrid applies a single pass of smth-desmth_special smoothing to the terrain field across the entire domain. Over steep terrain at kilometre-scale grid spacing, one pass is often insufficient, and users must increase the pass count, an integer parameter with no direct geometric correspondence to the resulting slope field. The maximum discrete slope that emerges depends on the raw terrain, the grid spacing, and the number of passes, and can only be diagnosed after the smoothing is complete. Because the filter updates every grid point at each iteration, terrain changes propagate far from the locations that control stability. Successive iterations yield diminishing reductions in peak slope, and stability can only be verified by completing a trial integration.

Modifying the vertical coordinate offers an alternative path to accommodating steep slopes (Park et al., 2019; Ma and Liu, 2017), but localised terrain adjustments have also been explored within conventional preprocessing. Sheridan et al. (2023) blended lightly and heavily smoothed terrain across steep-slope regions; Raluy-López et al. (2026) applied a local Gaussian filter only to grid points exceeding a slope threshold; and Le Bouëdec et al. (2025) posed terrain adjustment as a constrained optimisation problem with prescribed slope bounds. Slope-Constrained Orography (SCO) follows a similar motivation: it prescribes a target slope angle θ as the primary user-facing parameter and adjusts only those grid points whose eight-neighbour elevation differences exceed the implied bound, leaving the rest of the terrain unchanged.

This study introduces SCO v1.0 and evaluates it against standard WPS smoothing in 1 km Advanced Research WRF (WRF-ARW) v4.6.1 simulations over the highly complex terrain of the southeastern Tibetan Plateau. Three questions guide the evaluation: (1) can a prescribed-slope approach produce stable 48 h integrations with substantially less terrain modification than domain-wide smoothing, (2) how do the two methods differ in slope-field structure near the stability boundary, and (3) how do near-surface forecast errors compare between their successful configurations in this case?

2 Method and WRF implementation

2.1 Overview

SCO adjusts terrain elevation on a structured grid using working bounds on eight-neighbour elevation differences derived from a prescribed slope angle θ. Water bodies and lateral boundaries remain fixed throughout. The adjustment proceeds through weighted pairwise projection. Whenever the elevation difference across a neighbour pair exceeds a local bound, the solver redistributes the excess between the two endpoints in proportion to their mobility weights. The bounds include a conservative geometric scaling, explained in Sect. 2.2. Inner stopping conditions and a separate outer acceptance test determine when iteration ends (Sect. 2.3). The implementation assumes uniform grid spacing (Δx=Δy).

Because SCO operates on the standard geo_em files produced by geogrid, it integrates easily into the existing WPS pipeline between geogrid and metgrid with no modifications to the WRF source code. Here, geogrid interpolates static geographical data, including terrain, to the model grids, while metgrid interpolates meteorological fields horizontally to the same grids. The Python implementation reads and writes geo_em.d0X.nc directly and is used here for both offline diagnostics and terrain construction. Source code, documentation, and a worked example are archived on Zenodo (see Code and data availability).

2.2 Discrete slope metric and constraint derivation

The target angle θ is the user-prescribed slope parameter. Let hi,j denote terrain height on a grid with spacing Δx. The local eight-neighbour discrete slope angle is

(1) S i , j = max ( m , n ) ∈ N 8 ( i , j ) arctan | h m , n - h i , j | d ( i , j ) , ( m , n ) ,

where d=Δx for cardinal neighbours and d=2Δx for diagonal neighbours. The eight neighbours comprise the four cardinal points (i±1,j), (i,j±1) and the four diagonal points (i±1,j±1). Taking the maximum detects an exceedance in any sampled direction; averaging could conceal a single steep pair. The maximum over the active interior is denoted Smax,int. This interior consists of land points with mobility weight w>0.5, excluding the frozen rim and the outer part of the boundary taper.

Cardinal and diagonal bounds of Δxtan θ and 2Δxtanθ each correspond to θ in their sampled direction. SCO multiplies both by cos(π/8), giving the initial cardinal bound

(2) Δ h max ( 0 ) = Δ x tan θ cos ( π / 8 ) .

The diagonal bound is 2Δhmax(0). This common factor is a conservative geometric scaling for a locally planar surface: the gradient direction is within π/8 of a sampled direction, so satisfaction of all scaled bounds implies |∇h|≤tanθ for that plane (Appendix A1). The scaling does not remove the directional anisotropy of the eight-neighbour stencil.

The angle corresponding to the initial working bounds is

(3) θ eff = arctan [ cos ( π / 8 ) tan θ ] ,

and the linear approximation θeff≈0.93 θ holds to within 0.1° over 18–26°. Local tightening can reduce the working bounds further. A field that fully satisfies the initial bounds has Smax,int≤θeff, apart from numerical tolerance, but acceptance at the nominal angle θ does not establish convergence to those bounds. The idealised example in Fig. 1 illustrates the basic contrast: SCO modifies only the cones whose slopes violate the working bounds, whereas WPS smoothing alters all four. RAW denotes the unsmoothed reference terrain.

https://gmd.copernicus.org/articles/19/10433/2026/gmd-19-10433-2026-f01

Figure 1Idealised terrain fields used to contrast SCO and WPS smoothing. Four Gaussian cones (σ=2.0 km) with peak slopes of 43, 24, 18, and 9° are placed on a flat plain at Δx=1 km. The angle of the initial working bounds corresponding to θ=22° is θeff=20.5°. (a) RAW terrain; the dashed line marks the cross-section in (d). (b) Absolute elevation change |Δh| after SCO with θ=22°. (c) Absolute elevation change |Δh| after 120 passes of WPS smth-desmth_special. (d) Cross-section through the cone centres.

Download

2.3 Iterative projection solver

Each grid point carries a mobility weight wi,j∈[0,1] that controls how freely the solver may adjust its elevation. Water points receive w=0 and are never modified. The outermost r rows and columns are likewise frozen at w=0; across the next t rows and columns inward, a cosine taper raises w smoothly from 0 to 1. All remaining interior land points carry w=1. The fixed settings used here are r=3 and t=5.

Grid points with w>0.5 define the active interior. This threshold coincides with the midpoint of the cosine taper and marks the region over which Smax,int is evaluated and the outer acceptance test is applied. Boundary points (w≤0.5) may retain residual slope violations, but do not enter the outer acceptance test or local tightening. The inner monitor includes all neighbour pairs with wp+wq>10-6, including pairs adjoining frozen points.

The solver sweeps four classes of neighbour pairs in sequence (horizontal, vertical, main diagonal, anti-diagonal) using a red–black decomposition for vectorised execution. For a neighbour pair (p,q), the working bound is Lpq=(dpq/Δx)min(fp,fq)Δhmax(0), where dpq=Δx for cardinal pairs and 2Δx for diagonal pairs. The local tightening factor f is initially 1. It changes the bound, whereas the mobility weight w determines how the correction is shared. When the height difference δ=hq-hp exceeds Lpq in magnitude and the pair is movable, the excess

(4) e = δ - sgn ( δ ) L p q

is redistributed according to the endpoint mobilities:

(5) h p ← h p + e w p w p + w q , h q ← h q - e w q w p + w q .

When both endpoints share the same mobility the pair mean is conserved. When they differ, as in the transition zone, the more mobile endpoint absorbs the larger share and the pair mean shifts toward the less mobile point. Frozen points (w=0) never move.

An outer loop progressively tightens the local bound at each active interior point through the factor fi,j:

(6) Δ h max , i , j = f i , j Δ h max ( 0 ) .

For sweep s, the monitored quantity Es is the largest positive pairwise exceedance max(|hq-hp|-Lpq,0) encountered over movable pairs during the sweep. The inner stopping conditions are Es<0.1 m, stagnation, or the limit of 500 sweeps. Stagnation means Es≥0.999Es-1 for three consecutive comparisons. Persistent exceedances beside the frozen boundary can trigger this exit before the active interior has fully converged.

After each inner solve, the outer acceptance test checks Smax,int≤θ+0.01°. If it is not met, the factors at active interior points with Si,j>θ are tightened as

(7) f i , j ← max f i , j β θ S i , j , f min ,

where β=0.97 and fmin=0.30 are fixed. The next inner solve uses the updated bounds. The outer loop ends on acceptance or after 10 rounds. The full pseudocode and parameter values are given in Appendix A2. All offline diagnostics and figures in this study use max_outer = 10, max_sweeps = 500, inner_tol = 0.1 m, and outer_tol_deg = 0.01°. These are also the module defaults in the released code, which users may adjust for other domains.

2.4 Offline diagnostics

The offline diagnostics quantify achieved slopes, the magnitude and extent of terrain modification, and retained small-scale terrain structure. The near-maximum count is the number of active interior points whose Si,j falls within ε=0.2° below the member's own Smax,int. It describes concentration in the slope distribution, not geographic clustering.

Terrain fidelity is characterised by the mean absolute elevation change, MAEh=〈|hnew-hraw|〉, over interior land points. The modified-area fraction is the proportion of those points where |hnew-hraw|>0.1 m. MAEh measures the typical magnitude of elevation change. The modified-area fraction measures how widely those changes spread. Retained small-scale terrain structure is quantified by the root-mean-square (RMS) over interior land points of the unnormalised five-point second difference

(8) L i , j = h i + 1 , j + h i - 1 , j + h i , j + 1 + h i , j - 1 - 4 h i , j

(in metres). On the uniform grid, this difference equals Δx2 times the discrete Laplacian. Because it responds to second-order terrain structure, it distinguishes terrain fields with similar Smax,int but different small-scale content. Ridge-to-valley relief retention along cross-sections is defined as the ratio of the peak-to-valley elevation difference in the processed field to that in RAW.

3 Experimental design

3.1 Study region and model configuration

The test region is the southeastern Tibetan Plateau (Fig. 2), where raw discrete slope angles on a 1 km grid exceed 40° (Table 1). Two one-way-nested WRF-ARW v4.6.1 domains are used. The outer domain (D01) covers the eastern Tibetan Plateau margin and the Sichuan Basin on a 360×360 grid at 3 km spacing; the inner domain (D02) spans the steep plateau–basin transition on a 420×420 grid at 1 km spacing. Both domains use 54 vertical levels with a model top at 50 hPa and the hybrid terrain-following coordinate. D01 supplies the lateral boundary conditions for D02, with no feedback from D02 to D01. D01 terrain is fixed after one WPS smth-desmth_special pass; all terrain-treatment differences are confined to D02. Time steps were reduced for the WPS configurations as needed for stability (Fig. 3). With the parent-to-nest time-step ratio fixed at 3, these reductions also change the parent-domain integration.

Table 1Terrain members with offline diagnostics and stability outcomes. The control parameter is the WPS pass count N or the SCO target angle θ. For SCO members, θeff is the angle corresponding to the initial working bounds (Sect. 2.2). “48 h” gives the reported integration outcome under the stated 48 h stability criterion and the member-specific configuration (Fig. 3). W1+SCO24 MAEh is measured relative to its WPS01-smoothed input rather than to RAW, and its modified-area fraction is not directly comparable to the RAW-referenced values of the other members; neither quantity enters the cross-method comparison.

a WPS100 MAEh is rounded to the nearest integer. b W1+SCO24 MAEh is measured relative to its WPS01-smoothed input, not relative to RAW; excluded from the cross-method comparison. n/a: not applicable.

Download Print Version | Download XLSX

https://gmd.copernicus.org/articles/19/10433/2026/gmd-19-10433-2026-f02

Figure 2Model domains and observation network. (a) D01 terrain elevation (3 km grid spacing) with the D02 boundary marked. (b) D02 terrain elevation (1 km grid spacing) with the 927 surface stations used for near-surface verification.

https://gmd.copernicus.org/articles/19/10433/2026/gmd-19-10433-2026-f03

Figure 3Terrain-member pathways in (MAEh, Smax,int) space. Filled symbols indicate stable members and open symbols indicate failed members. Shaded bands span the adjacent passing and failing candidates; the WPS interval also includes a change in time step. For W1+SCO24, MAEh is referenced to its WPS01 input rather than RAW. Reported D01/D02 time steps: SCO and W1+SCO24, 18/6 s; WPS100, 15/5 s; WPS120 and WPS150, 12/4 s. WPS120 failed at 18/6 s and passed at 12/4 s.

Download

All simulations are initialised at 00:00 UTC (Coordinated Universal Time) 18 July 2025 from the fifth-generation reanalysis (ERA5) of the European Centre for Medium-Range Weather Forecasts (Hersbach et al., 2020) and integrated for 48 h. Static terrain for the 1 km inner domain is built from the 30 m Advanced Spaceborne Thermal Emission and Reflection Radiometer (ASTER) Global Digital Elevation Model (GDEM; Tachikawa et al., 2011) by area averaging onto the model grid. The physics configuration is identical across all experiments: Thompson microphysics (Thompson et al., 2008), Rapid Radiative Transfer Model for general circulation models (RRTMG) radiation (Iacono et al., 2008), the Yonsei University (YSU) planetary boundary layer scheme (Hong et al., 2006), the revised Fifth-Generation Penn State/National Center for Atmospheric Research mesoscale model (MM5) Monin–Obukhov surface layer, Noah land surface model with multiparameterization options (Noah-MP) (Niu et al., 2011), and gravity-wave drag on D01 only. No cumulus parameterisation is used on either domain. A reference WRF namelist is provided in the code repository.

3.2 Terrain members and member selection

For the WPS pathway, smth-desmth_special is applied for N passes to the aggregated D02 terrain, and the member label gives the pass count. Five members are tested: WPS01, WPS60, WPS100, WPS120, and WPS150. SCO members are generated by applying the slope-constrained adjustment (Sect. 2.3) directly to the unsmoothed D02 terrain. Five members span θ=18 to 26° at 2° intervals, with the member label giving the target angle. All SCO members share the same solver settings (r=3, t=5, β=0.97, fmin=0.30); only θ varies. RAW is retained as an offline reference. A control experiment, W1+SCO24, applies one WPS pass before SCO at θ=24° to test whether light pre-smoothing changes the stability outcome at fixed Smax,int.

The cross-method comparison pairs the least-modified stable member from each method among the discrete candidates tested under their reported configurations and the same 48 h stability criterion. These selections are neither exact stability limits nor globally optimal terrain solutions. Members are not matched by slope or terrain cost, since neither method offers a natural counterpart at fixed values of these quantities. One additional stable member from each method enters the near-surface evaluation to gauge within-method sensitivity.

3.3 Observations and verification protocol

Near-surface verification uses hourly 10 m wind speed and 2 m temperature from 927 China Meteorological Administration (CMA) surface stations within the D02 interior (Fig. 2b). The denser local network improves spatial sampling in interior valleys, where terrain effects are expected to be strongest.

Stations within 30 grid points of the lateral boundaries are excluded to avoid relaxation-zone contamination, and each retained time series must contain at least 20 % valid observations during the 48 h window. At any given station, the terrain-height difference between members is much smaller than the model-minus-observation elevation offset, so systematic elevation bias largely cancels in the paired comparison. Model fields are bilinearly interpolated to station locations without elevation correction.

The final sample contains 44 200 wind pairs and 44 115 temperature pairs. Inter-member root-mean-square error (RMSE) differences are tested with a two-sided paired t-test across stations, each contributing one time-averaged RMSE value. The test does not account for spatial correlation among nearby stations, so the reported p values should be interpreted as approximate.

4 Results

4.1 Terrain modification and retained structure

Under the common 48 h stability criterion, SCO22 and WPS120 are the least-modified stable members among those tested for the two methods (Table 1). Their terrain costs differ by an order of magnitude. SCO22 modifies 14.0 % of interior land points with MAEh=8.2 m; WPS120 modifies the entire domain and has MAEh=108.1 m (Fig. 3).

SCO22 also retains far more small-scale terrain structure. Its RMS of the five-point second difference reaches 279.8 m, nearly six times the 47.9 m of WPS120. Cross-sections confirm the same pattern: SCO22 retains 97 %–99 % of the RAW ridge-to-valley relief along two representative transects, compared with 79 %–86 % for WPS120 (Fig. 4).

https://gmd.copernicus.org/articles/19/10433/2026/gmd-19-10433-2026-f04

Figure 4Terrain modification footprint and retained relief. (a) RAW terrain elevation with cross-section locations marked. (b) Absolute elevation change |Δh| for WPS120 and (c) for SCO22, shown on the same colour scale (0–1000 m). (d) West–east cross-section along Line-A (j=339) and (e) south–north cross-section along Line-B (i=346). Annotated percentages denote ridge-to-valley relief retained relative to RAW.

All SCO members attain the nominal target θ over the active interior (Fig. 5). The maxima for SCO24 and SCO26 lie close to θeff, whereas those for SCO18–SCO22 remain above it (Table 1; Fig. 5c). The latter fields pass the outer acceptance test without fully satisfying the tighter internal working bounds, consistent with the stagnation exit described in Sect. 2.3.

https://gmd.copernicus.org/articles/19/10433/2026/gmd-19-10433-2026-f05

Figure 5Target θ versus achieved Smax,int for SCO18–SCO26. (a) The solid line marks θeff and the dashed line θ; filled triangles indicate stable members and open triangles indicate failed members. (b) Total sweep count. (c) Angular difference Smax,int-θeff after the final outer round. The positive differences for SCO18–SCO22 distinguish attainment of the nominal target from convergence to the internal working bounds.

Download

4.2 Diagnostics near the stability boundary

The WRF integrations with the unstable members terminated prematurely. Along the WPS pathway, WPS100 (Smax,int=24.44°) fails while WPS120 (24.13°) completes the full 48 h integration under the reported configurations (Table 1; Fig. 3). Along the SCO pathway, SCO24 (22.36°) fails and SCO22 (21.12°) passes, a sampled passing–failing gap of 1.24°. The selected stable members, SCO22 and WPS120, differ by 3.0° in peak slope.

At the domain scale, the slope fields of SCO22, SCO24, WPS100 and WPS120 differ sharply. Of the active interior points in SCO24, 15 359 fall within ε=0.2° below its own Smax,int; WPS120 has only 4 (Table 2). The exceedance counts (Fig. 6b) illustrate the same contrast: SCO members drop steeply near their diagnosed maxima, whereas the WPS tail decays gradually over several degrees. Because repeated smoothing progressively lowers slopes, few WPS grid points remain near the residual peak. In the slope probability density functions (PDFs; Fig. 6a), the contrast takes a different form: the WPS distribution falls off gradually in the upper tail, with most grid points well below the peak, while SCO24 has a concentrated population near its working bound.

https://gmd.copernicus.org/articles/19/10433/2026/gmd-19-10433-2026-f06

Figure 6Slope distributions for members near the stability boundary. (a) Probability density functions for WPS100, WPS120, SCO22, SCO24, and W1+SCO24. (b) Exceedance counts: number of active interior grid points with discrete slope exceeding S, shown on a logarithmic vertical axis. The sharp drop-off in the SCO members reflects the slope-constrained adjustment; the gradual tail in the WPS members reflects the progressive nature of domain-wide smoothing.

Download

Table 2Diagnostics for selected members near the sampled passing–failing intervals. Near-maximum count is the number of active interior points within ε=0.2° below each member's own Smax,int; it describes the slope distribution, not geographic clustering. Second-difference RMS is the RMS of the unnormalised five-point second difference in Eq. (8). Spectral retention is defined relative to RAW at the indicated wavelengths. Outcomes refer to the configurations in Fig. 3.

Download Print Version | Download XLSX

Figure 7 compares the local terrain around the reported failure site. Within this 41×41 neighbourhood, SCO24 retains small-scale ridge–valley structure and has 604 grid points above 22°. By contrast, WPS100 presents a narrow band of steep slopes against a smooth background, with only 23 grid points above 22°.

https://gmd.copernicus.org/articles/19/10433/2026/gmd-19-10433-2026-f07

Figure 7Local slope and elevation fields near the shared crash location (41×41 neighbourhood centred on i=50, j=291, 1-based). (a, b) Discrete slope Si,j for WPS100 and SCO24. (c, d) Terrain elevation for the same members. The cross marks the failure site.

Download

W1+SCO24 tests whether removing small-scale terrain structure at fixed Smax,int can produce a stable integration. One WPS pass applied before SCO at θ=24° lowers the second-difference RMS from 289.6 to 186.7 m and approximately halves the near-maximum count (from 15 359 to 7681), while holding Smax,int at 22.36° (Table 2). Row-mean spectra confirm that about 70 % of the power near 2 km wavelength is removed, while the 10 km band remains largely intact (Fig. 8). SCO24 and W1+SCO24 both fail. The tested pre-smoothing was therefore insufficient to restore stability under these settings.

https://gmd.copernicus.org/articles/19/10433/2026/gmd-19-10433-2026-f08

Figure 8Row-mean terrain power normalised by RAW at each wavenumber for RAW, WPS120, SCO22, SCO24 and W1+SCO24. Wavelength is shown on a logarithmic horizontal axis. Vertical dotted lines mark 2 and 10 km.

Download

Figure 8 shows SCO22 and SCO24 because they bracket the sampled SCO passing–failing interval; it also compares WPS120 and W1+SCO24. SCO22 and SCO24 retain most of the RAW power near 2 and 10 km, and SCO24 retains more than SCO22; WPS120 removes most of the power in those bands (Table 2). SCO is a nonlinear local adjustment, so its spectral response depends on terrain amplitude and structure, grid spacing and θ rather than on a fixed transfer function. In the tested sequence, lower θ increases terrain modification (Table 1). The slope distributions and second-order diagnostics show that the methods produce different terrain structures beyond the maximum slope. Those properties may influence numerical behaviour, but the present experiments do not isolate their effects.

4.3 Near-surface verification

Four stable members (WPS120, WPS150, SCO20, and SCO22) are evaluated against the 927-station network over the full 48 h period (Table 3). Comparing the two least-modified stable members, SCO22 produces lower errors for both variables: wind RMSE is lower by about 0.15 m s−1 with a weaker positive bias, and 2 m temperature RMSE is lower by about 0.16 K (Table 3). The error differences between these successful configurations cannot be attributed to D02 terrain alone. The 2 m temperature bias reverses sign between the two members (±0.17 K) but at this magnitude it is too small to diagnose a systematic difference.

Table 3Forty-eight-hour near-surface verification. RMSE denotes root-mean-square error. SCO20 and SCO22 show no detectable difference in wind RMSE (p=0.97) or in 2 m temperature RMSE (p=0.32) under the approximate two-sided paired t-test across stations (Sect. 3.3).

Download Print Version | Download XLSX

Within-method differences are much smaller. SCO20 and SCO22 show no detectable difference in wind and temperature RMSE under the approximate stationwise paired test (Sect. 3.3). The step from WPS120 to WPS150 changes scores only modestly. Because the comparison rests on a single 48 h case, these numbers are specific to the present domain and period.

5 Discussion

SCO meets the stability criterion on this domain with far less terrain alteration than WPS. WPS120 has a higher Smax,int than SCO24, and the two members' slope fields differ markedly in how many grid points lie near their respective maxima. The W1+SCO24 control shows that removing much of the small-scale structure while holding Smax,int fixed does not recover stability under the tested settings. The diagnostics examined here may not capture all terrain differences relevant to stability.

The diminishing returns of repeated smth-desmth_special passes compound the terrain-cost asymmetry between the two methods (Fig. 3). Small-scale terrain is removed much faster than the residual peak slope declines. Among the evaluated stable SCO members, SCO20 and SCO22 yield nearly identical forecast scores. A filter-based approach requires the user to choose a pass count, blending factor, or filter width and then inspect the resulting slope field. SCO prescribes θ first and uses the same variable to generate candidates, diagnose them offline, test for stability, and select the final member. On the 420×420 D02 grid used here, each SCO member is generated in under 10 s on a single central processing unit (CPU) core, so the entire five-member θ sweep completes in under a minute.

A practical workflow begins by diagnosing the raw terrain and generating a coarse sequence of θ values. Each field is checked offline for Smax,int, residuals relative to its internal working bounds, and the magnitude and extent of terrain modification. Stability integrations with a fixed model configuration and time step then bracket the sampled passing–failing interval. The interval can be refined if needed, and the least-modified passing member is selected from those tested. The selection must be reassessed when the model configuration changes.

The focus of this study is not on forecast improvement through terrain modification, but on preserving terrain fidelity as far as possible while maintaining numerical stability. Greater retention of ridge–valley relief and terrain spectral content (Figs. 4 and 8) preserves more of the lower-boundary structure available to force local atmospheric flows. The hourly station evaluation quantifies bulk errors, whereas assessing the realism of resolved flow variability requires complementary diagnostics, as illustrated by Sheridan et al. (2023). Such variability was not evaluated here.

6 Conclusions

SCO prescribes the target slope angle θ as its primary user-facing parameter and applies local eight-neighbour terrain adjustments between geogrid and metgrid. The parameter provides a geometrically interpretable way to generate terrain candidates and organise stability tests. On the highly complex terrain of the southeastern Tibetan Plateau at 1 km grid spacing, the least-modified stable SCO member among those tested (SCO22) completes a 48 h integration with MAEh=8.2 m and 86 % of interior land points unmodified, compared with MAEh=108.1 m and 100 % modification for the least-modified stable WPS member (WPS120). SCO22 retains substantially more small-scale terrain structure than WPS120, while the near-boundary candidates show distinct upper-tail slope distributions. The sampled passing range is specific to the tested case and model configuration.

For the successful configurations, SCO22 also produces lower near-surface wind and temperature errors in this 48 h case. Whether this advantage holds across other domains and seasons remains to be tested. With each candidate terrain generated in seconds, SCO provides an efficient way to explore the balance between terrain retention and numerical stability. Curvature constraints and packaging SCO as an optional WPS component are possible extensions. The current implementation assumes uniform grid spacing, and extending the projection geometry to variable-resolution or unstructured meshes is a natural next step toward broader applicability.

Appendix A: Geometric scaling and algorithm summary

A1 Conservative scaling for locally planar terrain

For a locally planar surface with gradient g=∇h, the neighbour-pair ratio in a unit direction u is |hq-hp|/dpq=|g⋅u|. Let 𝒰8 contain the unit vectors along the eight sampled directions. They are separated by π/4, so one lies within π/8 of the gradient direction. Hence

(A1) max u ∈ U 8 | g ⋅ u | ≥ | g | cos ( π / 8 ) .

If all sampled ratios are bounded by tanθcos(π/8), then |g|≤tanθ. The corresponding elevation-difference bounds are Δxtanθcos(π/8) for cardinal pairs and 2 times this value for diagonal pairs. The common scaling tightens both sets of bounds conservatively for any orientation of a plane; it does not remove the stencil's directional anisotropy. The angle of the initial pairwise bounds is θeff in Eq. (3).

A2 Pseudocode

The pseudocode below summarises the algorithm with the parameter values used for the terrain members analysed in this paper.

Algorithm A1SCO v1.0.

Input: h(nx,ny) terrain elevation (m); landmask(nx,ny); Δx grid spacing (m); θ target slope angle (°); r=3,t=5 frozen-rim and transition widths; β=0.97, fmin=0.30, max_outer=10, max_sweeps=500, inner_tol=0.1 m, outer_tol_deg=0.01°
Output: h(nx,ny) adjusted terrain elevation; nominal-target acceptance flag
1. Compute base cardinal bound: Δhmax(0)←Δx⋅tan(θ)⋅cos(π/8)
2. Build mobility-weight field w(nx,ny):
w=0 where landmask<0.5
[water]
w=0 in outermost r rows and columns
[frozen rim]
w=cosine taper across next t rows and columns
[transition zone]
w=1 elsewhere
[interior land]
3. Initialise tightening factors: f(i,j)←1 for all (i,j)
4. Define active interior mask: interior←(w>0.5); set acceptance flag to false
5. for round =1 to max_outer do
5a. Update local bounds: Δhmax(i,j)←f(i,j)⋅Δhmax(0)
Initialise Eprev←∞, c←0
5b. for sweep s=1 to max_sweeps do
Set Es←0
for each pair class (horiz., vert., main diag., anti-diag.) do
for each red–black subset of pairs (p,q) do (vectorised)
Lpq←min(Δhmax(p),Δhmax(q)) [×2 for diag.]
δ←h(q)-h(p)
if |δ|>Lpq and w(p)+w(q)>10-6 then
e←δ-sgn(δ)⋅Lpq
Es←max(Es,max|e|)
h(p)←h(p)+e⋅w(p)/(w(p)+w(q))
h(q)←h(q)-e⋅w(q)/(w(p)+w(q))
if Es≥0.999Eprev then c←c+1; else c←0
Set Eprev←Es
if Es<inner_tol or c≥3 then exit sweep loop
5c. Diagnose S(i,j) and Smax,int from updated h over interior points
5d. if Smax,int≤θ+outer_tol_deg then set acceptance flag to true and exit outer loop
5e. for each interior point where S(i,j)>θ do
f(i,j)←max[f(i,j)⋅β⋅θ/S(i,j),fmin]
6. return h and acceptance flag

Within each red–black subset, pairwise differences are evaluated before the endpoint contributions are accumulated. Pairs adjoining frozen points enter the inner monitor when at least one endpoint is movable; points outside the active interior do not enter the outer acceptance test or local tightening.

Code and data availability

The SCO v1.0 source code is archived on Zenodo at https://doi.org/10.5281/zenodo.19501184 (Ma, 2026) under the GNU General Public License v3.0 or later. The archive includes the reference solver (sco_terrain.py), the unit-test suite (test_sco_terrain.py), the WRF namelist (namelist.input), and a worked example comprising a Fig. 1 generation script (fig1_idealized.py), a sample geo_em.d02.nc file, and a driver script (run_example.py) that demonstrates the full offline preprocessing workflow.

The simulations were performed with the Weather Research and Forecasting Model version 4.6.1 (Skamarock et al., 2019); the exact WRF-ARW v4.6.1 source code and the WPS used for terrain preprocessing are archived on Zenodo at https://doi.org/10.5281/zenodo.20809210 (WRF Community and NCAR, 2026). ERA5 reanalysis data used for initial and boundary conditions are available from the Copernicus Climate Data Store under the Creative Commons Attribution licence: hourly data on pressure levels at https://doi.org/10.24381/cds.bd0915c6 (Hersbach et al., 2023a) and on single levels at https://doi.org/10.24381/cds.adbb2d47 (Hersbach et al., 2023b); the corresponding ERA5 domain subset is included in the reproducibility archive. The static terrain for the 1 km inner domain is the 30 m ASTER Global Digital Elevation Model version 3, distributed by the NASA Land Processes Distributed Active Archive Center (LP DAAC) and available at https://doi.org/10.5067/ASTER/ASTGTM.003 (NASA/METI/AIST/Japan Spacesystems and U.S./Japan ASTER Science Team, 2019); the corresponding ASTER tile subset is likewise included in the reproducibility archive.

Near-surface verification uses hourly 10 m wind speed and 2 m temperature from the China Meteorological Administration (CMA) hourly multi-element surface observation dataset (product SURF_CHN_MUL_HOR), provided by the CMA National Meteorological Information Center. These raw observations are not publicly available, but can be obtained from the CMA Meteorological Data Service Centre (https://data.cma.cn/en, last access: 29 October 2026) on reasonable request, including for the purposes of peer review.

The reproducibility archive on Zenodo at https://doi.org/10.5281/zenodo.20809228 (Ma et al., 2026) bundles the ERA5 domain subset and ASTER tile subset noted above with everything else needed to reproduce the near-surface verification without the raw observations: the geo_em static-terrain fields for all members and both domains, the WPS and WRF namelists, the derived verification statistics (per-station, per-member time-averaged RMSE and bias for 10 m wind and 2 m temperature, anonymized so that no raw observation values, station coordinates, or station identifiers are included), and a reproduction script (make_table3.py) that regenerates the Table 3 values and the Sect. 4.3 paired t-tests.

Author contributions

YM designed the SCO algorithm, developed the Python implementation, carried out the offline diagnostics, and wrote the manuscript. XJ configured the WRF simulations and performed the integrations using high-performance computing (HPC) resources. LM supervised the project and contributed to the experimental design. ZH contributed to station-data processing and quality control. All authors reviewed and edited the manuscript.

Competing interests

The contact author has declared that none of the authors has any competing interests.

Disclaimer

Publisher's note: Copernicus Publications remains neutral with regard to jurisdictional claims made in the text, published maps, institutional affiliations, or any other geographical representation in this paper. The authors bear the ultimate responsibility for providing appropriate place names. Views expressed in the text are those of the authors and do not necessarily reflect the views of the publisher.

Financial support

This work was supported by the Sichuan Science and Technology Program (grant nos. 2025YFNH0006 and 2024YFFK0110), the National Natural Science Foundation of China (grant no. 42375160), the National Key Research and Development Program of China (grant no. 2023YFC3007501), the Guangdong Basic and Applied Basic Research Foundation (grant no. 2022A1515110841), the Shenzhen Fundamental Research Program (grant no. JCYJ20220530164400001), and the Southwest Sichuan (Ya'an) Rainstorm Laboratory (grant no. CXNBYSYSZD202401).

Review statement

This paper was edited by Lluís Fita and reviewed by two anonymous referees.

References

Cannon, F., Carvalho, L. M. V., Jones, C., Norris, J., Bookhagen, B., and Kiladis, G. N.: Effects of topographic smoothing on the simulation of winter precipitation in High Mountain Asia, J. Geophys. Res.-Atmos., 122, 1456–1474, https://doi.org/10.1002/2016JD026038, 2017. a

Díaz-Fernández, J., Calvo-Sancho, C., Bolgiani, P., Sastre, M., López-Reyes, M., Fernández-González, S., and Martín, M. L.: Effect of complex orography on numerical simulations of a downburst event in Spain, Atmos. Res., 314, 107821, https://doi.org/10.1016/j.atmosres.2024.107821, 2025. a

Hersbach, H., Bell, B., Berrisford, P., Hirahara, S., Horányi, A., Muñoz-Sabater, J., Nicolas, J., Peubey, C., Radu, R., Schepers, D., Simmons, A., Soci, C., Abdalla, S., Abellan, X., Balsamo, G., Bechtold, P., Biavati, G., Bidlot, J., Bonavita, M., De Chiara, G., Dahlgren, P., Dee, D., Diamantakis, M., Dragani, R., Flemming, J., Forbes, R., Fuentes, M., Geer, A., Haimberger, L., Healy, S., Hogan, R. J., Hólm, E., Janisková, M., Keeley, S., Laloyaux, P., Lopez, P., Lupu, C., Radnoti, G., de Rosnay, P., Rozum, I., Vamborg, F., Villaume, S., and Thépaut, J.-N.: The ERA5 global reanalysis, Q. J. Roy. Meteor. Soc., 146, 1999–2049, https://doi.org/10.1002/qj.3803, 2020. a

Hersbach, H., Bell, B., Berrisford, P., Biavati, G., Horányi, A., Muñoz Sabater, J., Nicolas, J., Peubey, C., Radu, R., Rozum, I., Schepers, D., Simmons, A., Soci, C., Dee, D., and Thépaut, J.-N.: ERA5 hourly data on pressure levels from 1940 to present, Copernicus Climate Change Service (C3S) Climate Data Store (CDS) [data set], https://doi.org/10.24381/cds.bd0915c6, 2023a. a

Hersbach, H., Bell, B., Berrisford, P., Biavati, G., Horányi, A., Muñoz Sabater, J., Nicolas, J., Peubey, C., Radu, R., Rozum, I., Schepers, D., Simmons, A., Soci, C., Dee, D., and Thépaut, J.-N.: ERA5 hourly data on single levels from 1940 to present, Copernicus Climate Change Service (C3S) Climate Data Store (CDS) [data set], https://doi.org/10.24381/cds.adbb2d47, 2023b. a

Hong, S. Y., Noh, Y., and Dudhia, J.: A new vertical diffusion package with an explicit treatment of entrainment processes, Mon. Weather Rev., 134, 2318–2341, https://doi.org/10.1175/mwr3199.1, 2006. a

Iacono, M. J., Delamere, J. S., Mlawer, E. J., Shephard, M. W., Clough, S. A., and Collins, W. D.: Radiative forcing by long-lived greenhouse gases: Calculations with the AER radiative transfer models, J. Geophys. Res., 113, D13103, https://doi.org/10.1029/2008JD009944, 2008. a

Klemp, J. B., Skamarock, W. C., and Fuhrer, O.: Numerical consistency of metric terms in terrain-following coordinates, Mon. Weather Rev., 131, 1229–1239, https://doi.org/10.1175/1520-0493(2003)131<1229:NCOMTI>2.0.CO;2, 2003. a

Le Bouëdec, E., Chemel, C., and Staquet, C.: Dealing with steep slopes when modeling stable boundary-layer flow in Alpine terrain, Q. J. Roy. Meteor. Soc., 151, e4835, https://doi.org/10.1002/qj.4835, 2025. a

Ma, Y.: SCO v1.0: Slope-Constrained Orography for WRF terrain preprocessing (v1.0), Zenodo [code], https://doi.org/10.5281/zenodo.19501184, 2026. a

Ma, Y., Jiang, X., Mu, L., and Heng, Z.: Reproducibility archive for “Slope-Constrained Orography (SCO v1.0) for explicit discrete-slope control in terrain preprocessing”, Zenodo [data set], https://doi.org/10.5281/zenodo.20809228, 2026. a

Ma, Y. and Liu, H.: Large-eddy simulations of atmospheric flows over complex terrain using the immersed-boundary method in the Weather Research and Forecasting Model, Bound.-Lay. Meteorol., 165, 421–445, https://doi.org/10.1007/s10546-017-0283-9, 2017. a

Mahrer, Y.: An improved numerical approximation of the horizontal gradients in a terrain-following coordinate system, Mon. Weather Rev., 112, 918–922, https://doi.org/10.1175/1520-0493(1984)112<0918:AINAOT>2.0.CO;2, 1984. a

NASA/METI/AIST/Japan Spacesystems and U.S./Japan ASTER Science Team: ASTER Global Digital Elevation Model V003, NASA EOSDIS Land Processes DAAC [data set], https://doi.org/10.5067/ASTER/ASTGTM.003, 2019. a

Niu, G.-Y., Yang, Z.-L., Mitchell, K. E., Chen, F., Ek, M. B., Barlage, M., Kumar, A., Manning, K., Niyogi, D., Rosero, E., Tewari, M., and Xia, Y.: The community Noah land surface model with multiparameterization options (Noah-MP): 1. Model description and evaluation with local-scale measurements, J. Geophys. Res., 116, D12109, https://doi.org/10.1029/2010JD015139, 2011. a

Park, S. H., Klemp, J. B., and Kim, J. H.: Hybrid mass coordinate in WRF-ARW and its impact on upper-level turbulence forecasting, Mon. Weather Rev., 147, 971–985, https://doi.org/10.1175/MWR-D-18-0334.1, 2019. a

Raderschall, N., Lehning, M., and Schär, C.: Fine-scale modeling of the boundary layer wind field over steep topography, Water Resour. Res., 44, W09425, https://doi.org/10.1029/2007WR006544, 2008. a

Raluy-López, E., Muñoz-Esparza, D., and Montávez, J. P.: A local terrain smoothing approach for stabilizing microscale and high-resolution mesoscale simulations: a case study using FastEddy® (v3.0) and WRF (v4.6.0), Geosci. Model Dev., 19, 5139–5154, https://doi.org/10.5194/gmd-19-5139-2026, 2026. a

Sheridan, P., Xu, A., Li, J., and Furtado, K.: Use of targeted orographic smoothing in very high resolution simulations of a downslope windstorm and rotor in a sub-tropical highland location, Adv. Atmos. Sci., 40, 2043–2062, https://doi.org/10.1007/s00376-023-2298-0, 2023. a, b

Skamarock, W. C., Klemp, J. B., Dudhia, J., Gill, D. O., Liu, Z., Berner, J., Wang, W., Powers, J. G., Duda, M. G., Barker, D. M., and Huang, X.-Y.: A description of the advanced research WRF version 4, NCAR Tech. Note NCAR/TN-556+STR, https://doi.org/10.5065/1dfh-6p97, 2019. a, b

Tachikawa, T., Hato, M., Kaku, M., and Iwasaki, A.: Characteristics of ASTER GDEM version 2, in: 2011 IEEE International Geoscience and Remote Sensing Symposium, Vancouver, BC, Canada, 3657–3660, https://doi.org/10.1109/IGARSS.2011.6050017, 2011. a

Thompson, G., Field, P. R., Rasmussen, R. M., and Hall, W. D.: Explicit forecasts of winter precipitation using an improved bulk microphysics scheme. Part II: Implementation of a new snow parameterization, Mon. Weather Rev., 136, 5095–5115, https://doi.org/10.1175/2008mwr2387.1, 2008. a

WRF Community and NCAR: Weather Research and Forecasting (WRF) Model and WRF Preprocessing System (WPS) (WRF-ARW v4.6.1), Zenodo [code], https://doi.org/10.5281/zenodo.20809210, 2026. a

Zängl, G., Gantner, L., Hartjenstein, G., and Noppel, H.: Numerical errors above steep topography: A model intercomparison, Meteorol. Z., 13, 69–76, https://doi.org/10.1127/0941-2948/2004/0013-0069, 2004. a

Download
Short summary
High-resolution weather models over mountains need terrain smoothing to avoid crashing, but standard methods smooth everywhere regardless of need. We developed Slope-Constrained Orography, a tool that uses one slope-angle setting to adjust only the points that are too steep. Tested over the southeastern Tibetan Plateau, stable simulations were achieved while modifying far less terrain than standard smoothing, offering a simpler approach to running weather models over steep terrain.
Share
Altmetrics
Final-revised paper
Preprint