Closed person0712 closed 6 years ago
Can you tell me the size of the file? And if the file is small, less than a megabyte, then you can paste it into this issue. You might also set verbose = True to see if that gives you some idea of the problem.
cbb = bf.CellBudgetFile('test.ccf', verbose=True)
The size of the file is 2.4 GB. Maybe it's the reason of the error?
Did you try the verbose argument?
Yes, I did. It showed some information for each stress period like below. But it stopped in stress period 56, the total stress period of the model is 67. Also, the error of obtaining file position failed is showed at the end.
kstp: 1 kper: 56 text: FLOW JA FACE ncol: 8415864 nrow: 1 nlay: -1 imeth: 1 delt: 1.0 pertim: 1.0 totim: 56.0 modelnam: paknam: modelnam2: paknam2: file position: 2126773140
That is a good clue. I might have an idea. Any chance you are using a 32-bit version of Windows?
I have a desktop with a 32-bit version of Windows 7, or I can install VirtualBox to use a 32-bit version of Windows.
This appears to be related to the large file size and the use of a 32-bit Windows OS. I'm not positive of that, but from what I can tell, that file position cannot be represented accurately enough. As mentioned here (https://stackoverflow.com/questions/7604966/maximum-and-minimum-values-for-ints), 2**31 is equal to 2147483648, which is similar to the file position value you report. I'd suggest that you save your values less frequently, or try reading this file on a 64-bit OS. Let me know if you discover otherwise, and I can take a deeper look.
I am learning to use flopy to read a cell budget binary file (test.ccf) output from MODFLOW-USG. I followed the tutorial (flopy.utils.binaryfile Module) to read the binary file. But I got an error showing obtaining file position failed. It seems like it's a different issue from the issue "no such file or directory". I tried to figure it out what's the reason causing this, but I didn't get it. Does anyone know what steps I miss so that I got the error? Thanks. The version of Python I use is 3.6.3.