@@ -333,23 +333,23 @@ def stommel_gyre_dataset(xdim=200, ydim=200, grid_type="A"):
333333 U [j , i ] = - (1 - math .exp (- xi / es ) - xi ) * math .pi ** 2 * np .cos (math .pi * yi ) * scalefac
334334 V [j , i ] = (math .exp (- xi / es ) / es - 1 ) * math .pi * np .sin (math .pi * yi ) * scalefac
335335 if grid_type == "C" :
336- V [:, 1 :] = (P [:, 1 :] - P [:, 0 :- 1 ]) / dx * a
337336 U [1 :, :] = - (P [1 :, :] - P [0 :- 1 , :]) / dy * b
338- Udims = ["YC" , "XG" ]
339- Vdims = ["YG" , "XC" ]
337+ V [:, 1 :] = (P [:, 1 :] - P [:, 0 :- 1 ]) / dx * a
338+ Udims = ["YG" , "XC" ]
339+ Vdims = ["YC" , "XG" ]
340340 else :
341- Udims = ["YG " , "XG " ]
342- Vdims = ["YG " , "XG " ]
341+ Udims = ["YC " , "XC " ]
342+ Vdims = ["YC " , "XC " ]
343343
344344 return xr .Dataset (
345345 {"U" : (Udims , U ), "V" : (Vdims , V ), "P" : (["YG" , "XG" ], P )},
346346 coords = {
347- "YC" : (["YC" ], np .arange (ydim ) + 0.5 , {"axis" : "Y" }),
348- "YG" : (["YG" ], np .arange (ydim ), {"axis" : "Y" , "c_grid_axis_shift" : - 0.5 }),
349- "XC" : (["XC" ], np .arange (xdim ) + 0.5 , {"axis" : "X" }),
350- "XG" : (["XG" ], np .arange (xdim ), {"axis" : "X" , "c_grid_axis_shift" : - 0.5 }),
351- "lat" : (["YG" ], lat , {"axis" : "Y" , "c_grid_axis_shift" : 0.5 }),
352- "lon" : (["XG" ], lon , {"axis" : "X" , "c_grid_axis_shift" : - 0.5 }),
347+ "YC" : (["YC" ], np .arange (ydim ) - 0.5 , {"axis" : "Y" , "c_grid_axis_shift" : + 0.5 }),
348+ "YG" : (["YG" ], np .arange (ydim ), {"axis" : "Y" }),
349+ "XC" : (["XC" ], np .arange (xdim ) - 0.5 , {"axis" : "X" , "c_grid_axis_shift" : + 0.5 }),
350+ "XG" : (["XG" ], np .arange (xdim ), {"axis" : "X" }),
351+ "lat" : (["YG" ], lat , {"axis" : "Y" }),
352+ "lon" : (["XG" ], lon , {"axis" : "X" }),
353353 },
354354 ).pipe (
355355 sgrid ._attach_sgrid_metadata ,
@@ -360,7 +360,7 @@ def stommel_gyre_dataset(xdim=200, ydim=200, grid_type="A"):
360360 node_coordinates = ("lon" , "lat" ),
361361 face_dimensions = (
362362 sgrid .FaceNodePadding ("XC" , "XG" , sgrid .Padding .LOW ),
363- sgrid .FaceNodePadding ("YC" , "YG" , sgrid .Padding .HIGH ),
363+ sgrid .FaceNodePadding ("YC" , "YG" , sgrid .Padding .LOW ),
364364 ),
365365 ),
366366 )
0 commit comments