modflowpy / flopy

A Python package to create, run, and post-process MODFLOW-based models.
https://flopy.readthedocs.io
Other
517 stars 313 forks source link

"flopy.utils.binaryfile" not working with "mf2005dbl" #181

Closed mrustl closed 7 years ago

mrustl commented 7 years ago

Using the mf2005dbl works running the MODFLOW model with flopy (on both Ubuntu and Windows 7) but using loading the results data with the class flopy.utils.binaryfile fails with the following error message (I am using the official flopy 3.2.5 release):

import flopy.utils.binaryfile as bf`

Get the headfile and budget file objects

headobj = bf.HeadFile(modelname+'.hds') times = headobj.get_times() cbb = bf.CellBudgetFile(modelname+'.cbc') Traceback (most recent call last):

File "", line 8, in headobj = bf.HeadFile(modelname+'.hds')

File "C:\WinPython-64bit-3.4.4.4Qt5\python-3.4.4.amd64\lib\site-packages\flopy\utils\binaryfile.py", line 334, in init super(HeadFile, self).__init__(filename, precision, verbose, kwargs)

File "C:\WinPython-64bit-3.4.4.4Qt5\python-3.4.4.amd64\lib\site-packages\flopy\utils\binaryfile.py", line 161, in init super(BinaryLayerFile, self).__init__(filename, precision, verbose, kwargs)

File "C:\WinPython-64bit-3.4.4.4Qt5\python-3.4.4.amd64\lib\site-packages\flopy\utils\datafile.py", line 124, in init np.ones(self.nrow), 0)

File "C:\WinPython-64bit-3.4.4.4Qt5\python-3.4.4.amd64\lib\site-packages\numpy\core\numeric.py", line 190, in ones a = empty(shape, dtype, order)

MemoryError

langevin-usgs commented 7 years ago

You need to tell the binary file reader that it is a double precision file:

headobj = bf.HeadFile(modelname+'.hds', precision='double')