我正在尝试学习flopy,并且尝试加载MODFLOW-USG测试用例之一。测试用例是一个带有嵌套网格和GNC包的1层模型(示例01B)。我没有修改与MODFLOW-USG一起分发的测试用例文件,并且该测试用例在run.bat文件中运行良好。
首先,我尝试遵循使用flopy.modflow.mf module加载名称文件的示例:
m = flopy.modflow.Modflow.load('flow.nam', version='mfusg')
但是我得到了以下ValueError
:
File "C:\Users\Kent\Anaconda3\lib\site-packages\flopy\modflow\mf.py", line 758, in load
ml.check(f='{}.chk'.format(ml.name), verbose=ml.verbose, level=0)
File "C:\Users\Kent\Anaconda3\lib\site-packages\flopy\mbase.py", line 1121, in check
level=level - 1)
File "C:\Users\Kent\Anaconda3\lib\site-packages\flopy\modflow\mfbas.py", line 185, in check
neighbors = get_neighbors(self.ibound.array)
File "C:\Users\Kent\Anaconda3\lib\site-packages\flopy\utils\check.py", line 590, in get_neighbors
nk, ni, nj = a.shape
ValueError: not enough values to unpack (expected 3, got 1)
然后,我尝试按照flopy.modflow.mfdisu module的示例加载DISU软件包:
m = flopy.modflow.Modflow(version='mfusg')
disu = flopy.modflow.ModflowDisU.load('flow.disu', m)
但这给了我以下TypeError
:
File "C:\Users\Kent\Anaconda3\lib\site-packages\flopy\modflow\mfdisu.py", line 622, in load
fahl = Util2d.load(f, model, (n,), np.float32, 'fahl', ext_unit_dict)
File "C:\Users\Kent\Anaconda3\lib\site-packages\flopy\utils\util_array.py", line 2678, in load
ext_unit = ext_unit_dict[cr_dict['nunit']]
TypeError: 'NoneType' object is not subscriptable
用flopy加载现有MODFLOW-USG模型的正确方法是什么?