Double Gyre Case
The Double Gyre case (problem_id = 4) is the primary benchmark configuration in NeuralPOM, simulating wind-driven ocean circulation in a closed rectangular basin. It is the main case used for training the CorrectorNet and evaluating hybrid AI-physics performance.
Physical Configuration
Domain
| Parameter | Value | Description |
|---|---|---|
| Domain size | ~1000 km x 1000 km | Mid-latitude rectangular basin |
| Coarse grid | im=90, jm=82 | Grid used for training (downsampled) |
| Fine grid | im=354, jm=322 | High-resolution reference simulation |
| Vertical levels | kb=21 | Sigma-coordinate layers |
| Depth | 2000 m (uniform) | Flat-bottom basin |
| Latitude | ~30°N | Mid-latitude beta-plane |
The basin is fully enclosed by lateral walls on all four sides. The grid uses an Arakawa-C staggered arrangement with velocity components defined on cell faces and scalar quantities at cell centers.
Wind Forcing
The wind stress
where
Stratification
The initial temperature and salinity profiles are prescribed analytically as functions of depth. Temperature decreases with depth following:
where
Coriolis Parameter
The beta-plane approximation is used:
with
Key Dynamics
The double gyre configuration produces a rich set of physical phenomena:
Western boundary currents: Intense, narrow currents along the western boundary where the subpolar and subtropical gyres converge, analogous to the Gulf Stream / Kuroshio. The inertial boundary layer width scales as
. Inertial recirculation: Strong recirculation cells east of the western boundary current separation point, driven by nonlinear advection.
Rossby waves: Long baroclinic Rossby waves propagate westward from the eastern boundary, setting the basin-scale adjustment time scale
where is the first baroclinic Rossby radius of deformation. Gyre exchange: Inter-gyre exchange of mass, heat, and tracers across the zero wind-stress-curl line, often mediated by eddy fluxes.
Mesoscale eddies: At sufficiently high resolution (
), the flow becomes eddying with rich variability in the separated jet and recirculation regions.
Simulation Parameters
Typical integration parameters for the NeuralPOM double gyre:
| Parameter | Value | Description |
|---|---|---|
External time step dte | 5.0 s | Barotropic (external) mode step |
Split ratio isplit | 30 | Internal steps per baroclinic step |
Internal time step dti | 150.0 s | Baroclinic step = dte * isplit |
| Total duration | 20 years (7300 days) | Spin-up and ensemble generation |
| Reference output interval | 20 min (first 4 h/day) | High-frequency segments |
| Checkpoint interval | 1 day | Daily restart files |
The time step satisfies the CFL condition for barotropic gravity waves:
Expected Flow Features
After spin-up (typically 5--10 years of integration), the double gyre exhibits:
A strong, narrow western boundary current with maximum speeds
near the surface. A separated eastward jet at the inter-gyre boundary with meandering and eddy formation.
A Sverdrup interior flow in approximate balance:
Quasi-steady gyre circulation with total transport on the order of 30--50 Sv (1 Sv =
m /s).
Diagnostic Outputs
During simulation, the following diagnostics are available:
- Instantaneous fields: u, v, T, S at all vertical levels
- Depth-averaged velocity: ua, va (barotropic mode)
- Free-surface elevation: el (instantaneous), et (time-filtered)
- Turbulence quantities: q2 (twice TKE), q2l (TKE
length scale), km (vertical eddy viscosity), kh (vertical eddy diffusivity) - Transport terms: utf, vtf (advective fluxes)
- Surface fluxes: wind stress, heat flux (if enabled)
Ensemble Data Generation
For training data, NeuralPOM runs an ensemble of 8 double gyre simulations, each perturbed with small-amplitude initial noise (
# Generate 8-member ensemble, 20 years each
NEURALPOM_NUM_MEMBERS=8 \
NEURALPOM_TOTAL_DAYS=$((20 * 365)) \
NEURALPOM_GENERATION_CORE=implicit \
python scripts/data_generation/generate_double_gyre_ensemble.pyThe ensemble members are distributed across 8 GPUs using PyTorch CUDA multiprocessing. Each member saves daily checkpoints and high-frequency reference data (12 segments at 20-minute intervals during the first 4 hours of each day).
Usage
Running a Single Simulation
from neuralpom.cases.catalog import get_case_settings
from neuralpom.cores.implicit import ImplicitPOM2KCore
settings = get_case_settings("double_gyre")
core = ImplicitPOM2KCore(im=settings.im, jm=settings.jm)
core.iproblem = settings.problem_id
core.run_initialization()
# Run 365 days with daily checkpointing
for day in range(365):
core.time0 = core.time
core.iend = int(24 * 3600 / core.dti)
core.run_time_loop()
core.save_checkpoint(f"checkpoint_Day{day:04d}.npz")Loading Pre-Generated Data
from neuralpom.data.dataset import POMCheckpointDataset
ds = POMCheckpointDataset(
mode='train',
target_seg_idx=3, # Load 4 reference segments per sample
start_day=100,
end_day=720
)
inputs, targets = ds[0]
print(f"u shape: {inputs['u'].shape}") # (jm, im, kb) or similar
print(f"Target u shape: {targets['u'].shape}") # (T, jm, im, kb)Core Variants
The double gyre case is available for both core variants:
# Explicit core -- leapfrog time stepping, shorter time steps
from neuralpom.cases.explicit.double_gyre import CASE_SETTINGS
from neuralpom.cores.explicit import ExplicitPOM2KCore
# Implicit core -- CG/PCG barotropic solver, longer time steps
from neuralpom.cases.implicit.double_gyre import CASE_SETTINGS
from neuralpom.cores.implicit import ImplicitPOM2KCoreBoth variants share the same problem_id = 4 and produce physically equivalent solutions, though the implicit core allows larger time steps due to its unconditionally stable barotropic treatment.
