WRF V4.8.0 Bug Report: Geographic Coordinate Corruption When Using Two Automatic Vortex-Following Moving Nests with Mixed Refinement Ratios

William.Hatheway

Well-known member
## Describe the bug

WRF V4.8.0 exhibits geographic coordinate discontinuities in the innermost moving domain (d03) when running a three-domain tropical cyclone simulation with two automatic vortex-following nests and different parent-grid refinement ratios.

The simulation uses the following configuration:

- **d01:** 20 km, stationary outer domain
- **d02:** 4 km, automatic moving nest, 5:1 refinement
- **d03:** 1.333 km, automatic vortex-following nest, 3:1 refinement

The model initializes and integrates successfully, and both moving nests can relocate. However, when d02 begins moving, d03 develops discontinuities in its geographic coordinate arrays (`XLAT` and `XLONG`).

These discontinuities appear as sharp vertical seams, stepped pressure contours, distorted eyewall structures, and irregular domain boundaries in post-processed tropical cyclone charts.

The configured d03 grid resolution remains approximately 1.333 km, but the geographic coordinates of neighboring cells can become separated by more than 8–9 km. Subsequent movements appear to accumulate the displacement.

The issue is reproducible with the original WRF V4.8.0 moving-nest source code and appears associated with the compensation applied to a nested child domain when its moving parent relocates.

A possible refinement-ratio inconsistency has been identified in `share/mediation_nest_move.F`.

## To Reproduce

### 1. Compiler and WRF version

- **WRF version:** 4.8.0
- **Operating system:** Ubuntu Linux
- **Compiler:** Intel oneAPI Fortran `ifx` 2026.2.0
- **MPI compiler:** `mpiifx`
- **Parallel configuration:** DM parallel, 8 MPI processes
- **Nesting configuration:** Automatic vortex following

WRF is compiled with:

- `-DMOVE_NESTS`
- `-DVORTEX_CENTER`

The simulation is launched with `ulimit -s unlimited` to prevent unrelated Fortran stack-overflow segmentation faults during nested-domain initialization.

### 2. Namelist configuration

The important `namelist.input` settings are:

**Domain configuration**

```fortran
&domains
max_dom = 3,
time_step = 90,
e_we = 200, 161, 100,
e_sn = 200, 136, 100,
e_vert = 45, 45, 45,
dx = 20000, 4000, 1333.33,
dy = 20000, 4000, 1333.33,
parent_id = 1, 1, 2,
i_parent_start = 1, 115, 67,
j_parent_start = 1, 64, 57,
parent_grid_ratio = 1, 5, 3,
parent_time_step_ratio = 1, 5, 3,
feedback = 1,
smooth_option = 0,
/
```

**Time configuration**

```fortran
&time_control
run_hours = 48,
start_year = 2026, 2026, 2026,
start_month = 10, 10, 10,
start_day = 19, 19, 19,
start_hour = 12, 12, 12,
end_year = 2026, 2026, 2026,
end_month = 10, 10, 10,
end_day = 21, 21, 21,
end_hour = 12, 12, 12,
interval_seconds = 10800,
input_from_file = .true., .false., .false.,
history_interval = 60, 60, 60,
frames_per_outfile = 1, 1, 1,
io_form_history = 11,
/
```

The simulation uses the Tropical physics suite with WSM6 microphysics, RRTMG radiation, YSU PBL, and Noah-MP land surface physics.

WPS is configured with `max_dom=1`, while WRF generates the moving nested domains from their parent domains.

### 3. Run the model

Initialize the simulation at 12:00 UTC on October 19, 2026, using the original WRF V4.8.0 moving-nest implementation.

Run the model through at least 17:00 UTC, retaining hourly history output for all three domains.

Track the geographic coordinates, domain center positions, and parent-start indices for d02 and d03.

### 4. Observed behavior

At 12Z and 13Z, the d03 coordinate arrays are regular, with adjacent grid spacing near 1.34 km.

At 14Z, d02 first relocates northward:

| UTC | d02 `I_PARENT_START` | d02 `J_PARENT_START` | d03 condition |
|---|---|---|---|
| 12Z | 115 | 64 | Normal |
| 13Z | 115 | 64 | Normal |
| 14Z | 115 | 65 | First coordinate discontinuity |
| 15Z | 115 | 65 | Discontinuities persist |
| 16Z | 115 | 66 | Additional displacement |
| 17Z | 115 | 66 | Distorted geographic grid |

Direct inspection of the NetCDF coordinate arrays reveals the following abnormal distances between adjacent d03 grid cells:

| Diagnostic | Original run, 17Z |
|---|---|
| Expected adjacent spacing | Approximately 1.34 km |
| Maximum east–west adjacent spacing | 8.181 km |
| Maximum north–south adjacent spacing | 9.415 km |
| Adjacent-cell pairs exceeding 2 km | 312 |

Affected geographic-coordinate strips also exhibit systematic positional offsets of approximately 8 km, increasing in multiples of that distance following additional parent-nest movements.

The underlying meteorological fields, including `PSFC`, `U10`, and `V10`, remain comparatively continuous across many of the affected grid-index boundaries. This suggests that coordinate handling is a significant component of the observed plotting artifacts.

The model does not necessarily produce a fatal error when these geographic-coordinate discontinuities appear.

## Expected behavior

Both nested domains should move automatically while maintaining consistent geographic coordinates.

When d02 relocates within d01, d03 should retain its correct geographic position relative to the parent domain, with its placement and coordinate arrays updated consistently.

Specifically:

- d03 should maintain approximately 1.333-km horizontal grid spacing.
- `XLAT` and `XLONG` should remain geographically continuous.
- Parent-domain relocations should not introduce artificial coordinate offsets or discontinuities.
- Surface pressure contours, wind fields, and the tropical cyclone eyewall should remain geographically consistent.
- Repeated movements of d02 should not accumulate coordinate displacement errors in d03.



### Possible source-code issue identified

Investigation of the WRF V4.8.0 source identified a potentially incorrect refinement-ratio reference in `share/mediation_nest_move.F`, near lines 911–927.

Within the logic that compensates an intermediate nested domain when its parent moves, the code obtains a refinement ratio using the child-domain identifier.

The resulting `pgr` value corresponds to the child's refinement ratio, which is 3 in this configuration.

However, the moving parent domain, d02, uses a refinement ratio of 5 relative to d01.

The original compensation uses expressions such as:

`-move_cd_x*pgr` and `-move_cd_y*pgr`

For a one-cell movement of d02 relative to d01, the proposed mismatch corresponds to:

- Expected compensation: 5 × 4 km = 20 km
- Compensation using ratio 3: 3 × 4 km = 12 km
- Difference: 8 km

This matches the approximately 8-km displacement observed in the affected geographic-coordinate arrays.

### Experimental source modification

A minimal source modification was tested by replacing the four affected compensation expressions with references to the moving parent's refinement ratio:

`-move_cd_x*grid%parent_grid_ratio`

`-move_cd_y*grid%parent_grid_ratio`

The changes were applied to the calls to `wrf_dm_move_nest` and `adjust_domain_dims_for_move`, as well as the updates to `i_parent_start` and `j_parent_start`.

The modified `mediation_nest_move.F` compiled successfully using Intel oneAPI `mpiifx`, and WRF V4.8.0 linked successfully.

### Preliminary post-patch results

A separate simulation using the experimental source modification produced a regular d03 coordinate grid through 17Z.

| Diagnostic | Original 17Z | Patched 17Z |
|---|---:|---:|
| Maximum east–west spacing | 8.181 km | 1.348 km |
| Maximum north–south spacing | 9.415 km | 1.345 km |
| Adjacent-cell jumps exceeding 2 km | 312 | 0 |
| Visible geographic seams | Yes | No |

However, **d02 had not yet relocated in the patched simulation through 17Z**. Therefore, the experimental results are encouraging but do not conclusively validate the correction under the exact parent-movement conditions that triggered the original problem.

A longer controlled comparison, including an actual d02 relocation, is needed before considering the proposed modification a confirmed fix.

### Documentation and compatibility

The WRF community documentation and UCAR support discussions indicate that multiple automatic moving nests are supported, with the innermost domain following the vortex and intermediate domains moving as required.

Relevant discussion:


The moving-nest documentation recommends a 3:1 grid refinement ratio, while general WRF nesting supports other odd refinement ratios, including 5:1.

It is currently unclear whether mixed 5:1 and 3:1 refinement ratios are an intended supported configuration for multiple automatic moving nests in WRF V4.8.0.

**This report seeks clarification on whether the observed behavior is a source-code defect in the intermediate moving-nest compensation logic or a limitation of supported refinement-ratio combinations.**

The primary questions for the WRF developers are whether the ratio used in the intermediate-nest movement correction should refer to the moving parent, and whether multiple moving nests with differing refinement ratios should be supported without coordinate discontinuities.

Files uploaded to NCAR drive, pre_post_patch.zip
 
Just letting you know I'm looking into this. It's just taking me a while to try to repeat what you're seeing. Can you let me know how you noticed this? Is there a specific variable I can look at with ncview to see it visually? Thanks.
 
Back
Top