Skip to content

Commit

Permalink
fix(binary file): Was writing binary file information twice to extern…
Browse files Browse the repository at this point in the history
…al files (#1925) (#1928)
  • Loading branch information
scottrp authored and wpbonelli committed Aug 25, 2023
1 parent 672d6be commit d1c6071
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion flopy/mf6/data/mffileaccess.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ def write_binary_file(
if data.size == modelgrid.nnodes:
write_multi_layer = False
if write_multi_layer:
# write data from each layer with a separate header
for layer, value in enumerate(data):
self._write_layer(
fd,
Expand All @@ -228,6 +229,7 @@ def write_binary_file(
layer + 1,
)
else:
# write data with a single header
self._write_layer(
fd,
data,
Expand All @@ -238,7 +240,6 @@ def write_binary_file(
text,
fname,
)
data.tofile(fd)
fd.close()

def _write_layer(
Expand Down

0 comments on commit d1c6071

Please sign in to comment.