Skip to content

Commit d2a9180

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 1b8986f commit d2a9180

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
@@ -378,9 +378,7 @@ def attrs_remove_section(obj, section):
378378
# by xBOUT, not by BOUT++
379379
ds.bout.fine_interpolation_factor = 8
380380

381-
if ("dump" in input_type or "restart" in input_type) and ds.metadata[
382-
"BOUT_VERSION"
383-
] < 4.0:
381+
if ("dump" in input_type or "restart" in input_type) and ("BOUT_VERSION" in ds.metadata and ds.metadata["BOUT_VERSION"] < 4.0):
384382
# Add workarounds for missing information or different
385383
# conventions in data saved by BOUT++ v3.x.
386384
for v in ds:

0 commit comments

Comments
 (0)