Since a few weeks i'm writing writing MODFLOW models with Flopy in Python. I chose to write models in Flopy because of the transparency of Python. However, once in a while my model doesn't run but it doesn't tell me where it goes wrong, that makes error handeling difficult.
At the moment my model gives an error at running the model. It raises the error with the message I added manually (and is common used):
success, mfoutput = mf.run_model(silent=False, pause=False)
if not success:
raise Exception('MODFLOW did not terminate normally.')
The error I got is:
FloPy is using the following executable to run the model: /usr/bin/mf2005
MODFLOW-2005
U.S. GEOLOGICAL SURVEY MODULAR FINITE-DIFFERENCE GROUND-WATER FLOW MODEL
Version 1.12.00 2/3/2017
Using NAME file: spangen_mod.nam
Run start date and time (yyyy/mm/dd hh:mm:ss): 2019/04/23 16:12:39
Traceback (most recent call last):
File "<ipython-input-85-c7ecca798eed>", line 1, in <module>
runfile('/Users/user/Desktop/modflow/model.py', wdir='/Users/user/Desktop/modflow')
File "/Users/user/anaconda3/lib/python3.7/site-packages/spyder_kernels/customize/spydercustomize.py", line 704, in runfile
execfile(filename, namespace)
File "/Users/user/anaconda3/lib/python3.7/site-packages/spyder_kernels/customize/spydercustomize.py", line 108, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "/Users/user/Desktop/modflow/model.py", line 223, in <module>
raise Exception('MODFLOW did not terminate normally.')
Exception: MODFLOW did not terminate normally.
Besides, all the MODFLOW files are created but .hds and .cbc file contain zero bytes.
My question: does someone have tips to track down these kind of errors efficient and smart.