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

Tutorial 1 error #458

Closed cerithm closed 5 years ago

cerithm commented 5 years ago

I'm currently working through tutorial 1. This is my code so far.

`import numpy as np import flopy

Assign name and create modflow model object

modelname = 'tutorial1' mf = flopy.modflow.Modflow(modelname, exe_name='mf2005')

Model domain and grid definition

Lx = 1000. Ly = 1000. ztop = 0. zbot = -50. nlay = 1 nrow = 10 ncol = 10 delr = Lx/ncol delc = Ly/nrow delv = (ztop - zbot) / nlay botm = np.linspace(ztop, zbot, nlay + 1)

Create the discretization object

dis = flopy.modflow.ModflowDis(mf, nlay, nrow, ncol, delr=delr, delc=delc,top=ztop, botm=botm[1:])

Variables for the BAS package

ibound = np.ones((nlay, nrow, ncol), dtype=np.int32) ibound[:, :, 0] = -1 ibound[:, :, -1] = -1 strt = np.ones((nlay, nrow, ncol), dtype=np.float32) strt[:, :, 0] = 10. strt[:, :, -1] = 0. bas = flopy.modflow.ModflowBas(mf, ibound=ibound, strt=strt)

Add LPF package to the MODFLOW model

lpf = flopy.modflow.ModflowLpf(mf, hk=10., vka=10., ipakcb=53)

Add OC package to the MODFLOW model

spd = {(0, 0): ['print head', 'print budget', 'save head', 'save budget']} oc = flopy.modflow.ModflowOc(mf, stress_period_data=spd, compact=True)

Add PCG package to the MODFLOW model

pcg = flopy.modflow.ModflowPcg(mf)

Write the MODFLOW model input files

mf.write_input()

Run the MODFLOW model

success, buff = mf.run_model() `

I've copied the code word for word from the tutorial, but when I run the code I get the following error message

`runfile('C:/Users/Asus/Documents/FloPy/tutorial 1.py', wdir='C:/Users/Asus/Documents/FloPy') Traceback (most recent call last):

File "", line 1, in runfile('C:/Users/Asus/Documents/FloPy/tutorial 1.py', wdir='C:/Users/Asus/Documents/FloPy')

File "C:\Users\Asus\Anaconda32\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 704, in runfile execfile(filename, namespace)

File "C:\Users\Asus\Anaconda32\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 108, in execfile exec(compile(f.read(), filename, 'exec'), namespace)

File "C:/Users/Asus/Documents/FloPy/tutorial 1.py", line 55, in success, buff = mf.run_model()

File "C:\Users\Asus\Anaconda32\lib\site-packages\flopy\mbase.py", line 970, in run_model normal_msg=normal_msg)

File "C:\Users\Asus\Anaconda32\lib\site-packages\flopy\mbase.py", line 1376, in run_model raise Exception(s)

Exception: The program mf2005 does not exist or is not executable.`

langevin-usgs commented 5 years ago

This is not a flopy error. This question should be asked on Stack Overflow according to the instructions shown on the main Github page for flopy. But to give you a hint, check here: https://github.com/modflowpy/flopy/blob/develop/examples/FAQ/mf2005_does_not_exist.ipynb.