Skip to content

Commit

Permalink
update(read_binary_data_from_file): update for binary layer files wit…
Browse files Browse the repository at this point in the history
…h multiple layers

Previously code read the entire file without stripping headers after first layer. Enforce read_multi_layer=True if data_size != ncpl
  • Loading branch information
jlarsen-usgs committed Feb 10, 2022
1 parent 8ac31dd commit c2556ad
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions flopy/mf6/data/mffileaccess.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,9 @@ def read_binary_data_from_file(
):
import flopy.utils.binaryfile as bf

if data_size != modelgrid.ncpl:
read_multi_layer = True

fd = self._open_ext_file(fname, True)
numpy_type, name = self.datum_to_numpy_type(data_type)
header_dtype = bf.BinaryHeader.set_dtype(
Expand Down

0 comments on commit c2556ad

Please sign in to comment.