From 6911f0cc9973b9fc4ead94eca708298216b55d21 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Thu, 21 May 2026 16:10:06 +0200 Subject: [PATCH] Fix C/A grid dimensions on peninsula_dataset --- src/parcels/_datasets/structured/generated.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/parcels/_datasets/structured/generated.py b/src/parcels/_datasets/structured/generated.py index 665bcaf0f..012901b99 100644 --- a/src/parcels/_datasets/structured/generated.py +++ b/src/parcels/_datasets/structured/generated.py @@ -214,17 +214,17 @@ def peninsula_dataset(xdim=100, ydim=50, mesh="flat", grid_type="A"): V[:, :] = -2 * u0 * R**2 * ((x - x0) * y) / (((x - x0) ** 2 + y**2) ** 2) U[landpoints] = 0.0 V[landpoints] = 0.0 - Udims = ["YC", "XG"] - Vdims = ["YG", "XC"] + Udims = ["YG", "XG"] + Vdims = ["YG", "XG"] elif grid_type == "C": U = np.zeros(P.shape) V = np.zeros(P.shape) V[:, 1:] = (P[:, 1:] - P[:, :-1]) / (La[1] - La[0]) U[1:, :] = -(P[1:, :] - P[:-1, :]) / (Wa[1] - Wa[0]) - Udims = ["YG", "XG"] - Vdims = ["YG", "XG"] + Udims = ["YC", "XG"] + Vdims = ["YG", "XC"] else: - raise RuntimeError(f"Grid_type {grid_type} is not a valid option") + raise ValueError(f"Grid_type {grid_type} is not a valid option") # Convert from m to lat/lon for spherical meshes lon = La / 1852.0 / 60.0 if mesh == "spherical" else La