Note
This page was generated from FAQ/load_existing_mf2005.ipynb.
Loading an existing MODFLOW-2005 model
[1]:
import os
import sys
try:
import flopy
except:
fpth = os.path.abspath(os.path.join("..", ".."))
sys.path.append(fpth)
import flopy
print(sys.version)
print("flopy version: {}".format(flopy.__version__))
3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:08:06) [GCC 11.3.0]
flopy version: 3.3.7
Load an existing MODFLOW-2005 model
verbose=True
writes diagnostic information during the load and can be used to troubleshoot issues encountered during in the.load()
method.check=False
disables basic FloPy error checking.
[2]:
model_ws = os.path.join("..", "..", "examples", "data", "mf2005_test")
ml = flopy.modflow.Modflow.load(
"bcf2ss.nam",
model_ws=model_ws,
verbose=True,
version="mf2005",
check=False,
)
Creating new model with name: bcf2ss
--------------------------------------------------
Parsing the namefile --> /home/runner/work/flopy/flopy/.docs/FAQ/../../examples/data/mf2005_test/bcf2ss.nam
could not set filehandle to bcf2ss.lst
--------------------------------------------------
External unit dictionary:
{7: filename:/home/runner/work/flopy/flopy/.docs/FAQ/../../examples/data/mf2005_test/bcf2ss.lst, filetype:LIST, 8: filename:/home/runner/work/flopy/flopy/.docs/FAQ/../../examples/data/mf2005_test/bcf2ss.ba6, filetype:BAS6, 11: filename:/home/runner/work/flopy/flopy/.docs/FAQ/../../examples/data/mf2005_test/bcf2ss.bc6, filetype:BCF6, 12: filename:/home/runner/work/flopy/flopy/.docs/FAQ/../../examples/data/mf2005_test/bcf2ss.wel, filetype:WEL, 14: filename:/home/runner/work/flopy/flopy/.docs/FAQ/../../examples/data/mf2005_test/bcf2ss.riv, filetype:RIV, 18: filename:/home/runner/work/flopy/flopy/.docs/FAQ/../../examples/data/mf2005_test/bcf2ss.rch, filetype:RCH, 19: filename:/home/runner/work/flopy/flopy/.docs/FAQ/../../examples/data/mf2005_test/bcf2ss.pcg, filetype:PCG, 20: filename:/home/runner/work/flopy/flopy/.docs/FAQ/../../examples/data/mf2005_test/bcf2ss.oc, filetype:OC, 10: filename:/home/runner/work/flopy/flopy/.docs/FAQ/../../examples/data/mf2005_test/bcf2ss.dis, filetype:DIS}
--------------------------------------------------
ModflowBas6 free format:True
loading dis package file...
Loading dis package with:
2 layers, 10 rows, 15 columns, and 2 stress periods
loading laycbd...
loading delr...
loading delc...
loading top...
loading botm...
for 2 layers and 1 confining beds
loading stress period data...
for 2 stress periods
adding Package: DIS
DIS package load...success
LIST package load...skipped
loading bas6 package file...
adding Package: BAS6
BAS6 package load...success
loading bcf package file...
loading ipakcb, HDRY, IWDFLG, WETFCT, IWETIT, IHDWET...
loading LAYCON...
loading TRPY...
loading hy layer 1...
loading vcont layer 1...
loading sf2 layer 1...
loading tran layer 2...
Adding bcf2ss.cbc (unit=30) to the output list.
adding Package: BCF6
BCF6 package load...success
loading wel package file...
loading <class 'flopy.modflow.mfwel.ModflowWel'> for kper 1
loading <class 'flopy.modflow.mfwel.ModflowWel'> for kper 2
adding Package: WEL
WEL package load...success
loading riv package file...
loading <class 'flopy.modflow.mfriv.ModflowRiv'> for kper 1
loading <class 'flopy.modflow.mfriv.ModflowRiv'> for kper 2
adding Package: RIV
RIV package load...success
loading rch package file...
loading rech stress period 1...
adding Package: RCH
RCH package load...success
loading pcg package file...
explicit ihcofadd in file
adding Package: PCG
PCG package load...success
loading oc package file...
head file name will be generated by flopy
drawdown file name will be generated by flopy
adding Package: OC
OC package load...success
WARNING:
External file unit 30 does not exist in ext_unit_dict.
WARNING:
External file unit 50 does not exist in ext_unit_dict.
WARNING:
External file unit 0 does not exist in ext_unit_dict.
The following 8 packages were successfully loaded.
bcf2ss.dis
bcf2ss.ba6
bcf2ss.bc6
bcf2ss.wel
bcf2ss.riv
bcf2ss.rch
bcf2ss.pcg
bcf2ss.oc
The following 1 packages were not loaded.
bcf2ss.lst
[ ]: