Skip to content

Commit

Permalink
Changes required to load output from a grid-free BOUT.0.nc file, nece…
Browse files Browse the repository at this point in the history
…ssary for MMS tests of the differential operators.
  • Loading branch information
mrhardman committed Jan 15, 2025
1 parent 1b8986f commit d2a9180
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion xbout/geometries.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def apply_geometry(ds, geometry_name, *, coordinates=None, grid=None):
dz = updated_ds["dz"]

z0 = 2 * np.pi * updated_ds.metadata["ZMIN"]
z1 = z0 + nz * dz.data[()]
z1 = z0 + nz * dz.data[0,0]
if not np.all(
np.isclose(
z1,
Expand Down
4 changes: 1 addition & 3 deletions xbout/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,7 @@ def attrs_remove_section(obj, section):
# by xBOUT, not by BOUT++
ds.bout.fine_interpolation_factor = 8

if ("dump" in input_type or "restart" in input_type) and ds.metadata[
"BOUT_VERSION"
] < 4.0:
if ("dump" in input_type or "restart" in input_type) and ("BOUT_VERSION" in ds.metadata and ds.metadata["BOUT_VERSION"] < 4.0):
# Add workarounds for missing information or different
# conventions in data saved by BOUT++ v3.x.
for v in ds:
Expand Down

0 comments on commit d2a9180

Please sign in to comment.