MODFLOW 6 IO pdf (mf6io.pdf) 的第 20 页描述了可在 BEGIN PERIOD / END PERIOD 块中用于列表输入的 OPEN/CLOSE 选项。我对软盘的测试发现我可以读取外部 ASCII 文件,但不能读取二进制文件。当我使用调试器进入代码时,我找不到任何可以处理“(BINARY)”选项的代码。有问题的代码似乎在“加载”方法中的 mfpackage.py 中(如下)。MODFLOW 6 软盘中是否实现了“OPEN/CLOSE [(BINARY)]”的二进制选项?
if arr_line[0].lower() == 'open/close':
# open block contents from external file
fd_block.readline()
fd_path, filename = os.path.split(
os.path.realpath(fd_block.name))
try:
if self._simulation_data.verbosity_level.value >= \
VerbosityLevel.verbose.value:
print(' opening external file "{}"..'
'.'.format(arr_line[1]))
self.external_file_name = arr_line[1]
fd_block = open(os.path.join(fd_path, self.external_file_name),
'r')
# read first line of external file
line = fd_block.readline()