Skip to content

Commit f49585e

Browse files
committed
Changes required to load output from a grid-free BOUT.0.nc file, necessary for MMS tests of the differential operators.
1 parent 0761754 commit f49585e

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

xbout/geometries.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def apply_geometry(ds, geometry_name, *, coordinates=None, grid=None):
214214
dz = updated_ds["dz"]
215215

216216
z0 = 2 * np.pi * updated_ds.metadata["ZMIN"]
217-
z1 = z0 + nz * dz.data[()]
217+
z1 = z0 + nz * dz.data[0,0]
218218
if not np.all(
219219
np.isclose(
220220
z1,

xbout/load.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,9 +372,7 @@ def attrs_remove_section(obj, section):
372372
# by xBOUT, not by BOUT++
373373
ds.bout.fine_interpolation_factor = 8
374374

375-
if ("dump" in input_type or "restart" in input_type) and ds.metadata[
376-
"BOUT_VERSION"
377-
] < 4.0:
375+
if ("dump" in input_type or "restart" in input_type) and ("BOUT_VERSION" in ds.metadata and ds.metadata["BOUT_VERSION"] < 4.0):
378376
# Add workarounds for missing information or different
379377
# conventions in data saved by BOUT++ v3.x.
380378
for v in ds:

0 commit comments

Comments
 (0)