def add_output_file(self, unit, fname=None, extension='cbc', binflag=True, package=None):
    '\n        Add an ascii or binary output file for a package\n\n        Parameters\n        ----------\n        unit : int\n            unit number of external array\n        fname : str\n            filename of external array. (default is None)\n        extension : str\n            extension to use for the cell-by-cell file. Only used if fname\n            is None. (default is cbc)\n        binflag : bool\n            boolean flag indicating if the output file is a binary file.\n            Default is True\n        package : str\n            string that defines the package the output file is attached to.\n            Default is None\n\n        '
    add_cbc = False
    if (unit > 0):
        add_cbc = True
        if (abs(unit) in self.external_units):
            idx = self.external_units.index(abs(unit))
            if (fname is None):
                fname = os.path.basename(self.external_fnames[idx])
            binflag = self.external_binflag[idx]
            self.remove_external(unit=abs(unit))
        if (abs(unit) in self.output_units):
            add_cbc = False
            idx = self.output_units.index(abs(unit))
            if (binflag is not self.output_binflag[idx]):
                add_cbc = True
            if add_cbc:
                self.remove_output(unit=abs(unit))
            elif (package is not None):
                self.output_packages[idx].append(package)
    if add_cbc:
        if (fname is None):
            fname = f'{self.name}.{extension}'
            if (fname in self.output_fnames):
                idx = self.output_fnames.index(fname)
                iut = self.output_units[idx]
                if (iut != unit):
                    if (package is None):
                        fname = f'{self.name}.{unit}.{extension}'
                    else:
                        fname = f'{self.name}.{package}.{extension}'
        else:
            fname = os.path.basename(fname)
        self.add_output(fname, unit, binflag=binflag, package=package)
    return
Add an ascii or binary output file for a package

Parameters
----------
unit : int
    unit number of external array
fname : str
    filename of external array. (default is None)
extension : str
    extension to use for the cell-by-cell file. Only used if fname
    is None. (default is cbc)
binflag : bool
    boolean flag indicating if the output file is a binary file.
    Default is True
package : str
    string that defines the package the output file is attached to.
    Default is None
def add_output_file(self, unit, fname=None, extension='cbc', binflag=True, package=None):
    '\n        Add an ascii or binary output file for a package\n\n        Parameters\n        ----------\n        unit : int\n            unit number of external array\n        fname : str\n            filename of external array. (default is None)\n        extension : str\n            extension to use for the cell-by-cell file. Only used if fname\n            is None. (default is cbc)\n        binflag : bool\n            boolean flag indicating if the output file is a binary file.\n            Default is True\n        package : str\n            string that defines the package the output file is attached to.\n            Default is None\n\n        '
    add_cbc = False
    if (unit > 0):
        add_cbc = True
        if (abs(unit) in self.external_units):
            idx = self.external_units.index(abs(unit))
            if (fname is None):
                fname = os.path.basename(self.external_fnames[idx])
            binflag = self.external_binflag[idx]
            self.remove_external(unit=abs(unit))
        if (abs(unit) in self.output_units):
            add_cbc = False
            idx = self.output_units.index(abs(unit))
            if (binflag is not self.output_binflag[idx]):
                add_cbc = True
            if add_cbc:
                self.remove_output(unit=abs(unit))
            elif (package is not None):
                self.output_packages[idx].append(package)
    if add_cbc:
        if (fname is None):
            fname = f'{self.name}.{extension}'
            if (fname in self.output_fnames):
                idx = self.output_fnames.index(fname)
                iut = self.output_units[idx]
                if (iut != unit):
                    if (package is None):
                        fname = f'{self.name}.{unit}.{extension}'
                    else:
                        fname = f'{self.name}.{package}.{extension}'
        else:
            fname = os.path.basename(fname)
        self.add_output(fname, unit, binflag=binflag, package=package)
    return