Search code examples
flopy

Has the binary option of "OPEN/CLOSE <fname> [(BINARY)]" been implemented in MODFLOW 6 flopy?


Page 20 of the MODFLOW 6 IO pdf (mf6io.pdf) describes the OPEN/CLOSE option which can be used in the BEGIN PERIOD / END PERIOD block for list input. My testing of flopy found that I could read an external ASCII file but not a binary file. When I stepped into the code with the debugger I couldn't find any code that would handle the '(BINARY)' option. The code in question seems to be in mfpackage.py in the 'load' method (below). Has the binary option of "OPEN/CLOSE [(BINARY)]" been implemented in MODFLOW 6 flopy?

        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()

Solution

  • This should now be implemented on the develop branch of flopy.