From 97da3961f531b26001e8cf55db0de45fc41befad Mon Sep 17 00:00:00 2001 From: scottrp <45947939+scottrp@users.noreply.github.com> Date: Wed, 17 Jan 2024 08:45:37 -0800 Subject: [PATCH] fix(data storage): added numpy type check for consistent integer and float sizes (32-bit vs 64-bit) (#2062) * fix(data storage): added numpy type check for consistent integer and float sizes * fix(numpy type check) --- flopy/mf6/data/mfdatastorage.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/flopy/mf6/data/mfdatastorage.py b/flopy/mf6/data/mfdatastorage.py index 8fef1c2b7e..eaf916d4ab 100644 --- a/flopy/mf6/data/mfdatastorage.py +++ b/flopy/mf6/data/mfdatastorage.py @@ -1407,6 +1407,16 @@ def store_internal( message, self._simulation_data.debug, ) + data_type = self.data_dimensions.structure.get_datum_type(True) + dt = self.layer_storage[layer].internal_data.dtype + if dt != data_type: + self.layer_storage[ + layer + ].internal_data = self.layer_storage[ + layer + ].internal_data.astype( + data_type + ) if not preserve_record: self.layer_storage[layer].factor = multiplier self.layer_storage[layer].iprn = print_format