def write_array(self, data, order='C', fmt='%s', sep=' ', linecount=0):
        shape = data.shape
        indices = [0 for i in shape]
        _item = data.item
        _write = self.file.write

        if order == 'C':
            # Row-major order.
            sequence = range(len(shape))
            sequence.reverse()
        elif order == 'Fortran':
            # Column-major order.
            sequence = range(len(shape))
        else:
            raise ValueError("order must be 'C' or 'Fortran'")

        count = 0
        while True:
            _write(fmt % _item(*indices))
            count += 1
            if linecount > 0:
                if count >= linecount:
                    _write('\n')
                    count = 0
            if count:
                _write(sep)

            for i in sequence:
                indices[i] += 1
                if indices[i] >= shape[i]:
                    indices[i] = 0
                else:
                    break
            else:
                break

        if count:
            _write('\n')
Writes array as text.
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.util/src/openmdao/util/stream.py/Stream.write_array