From bd3029db9a735121968491fa995f6d0f9883bfdd Mon Sep 17 00:00:00 2001 From: Christian Langevin Date: Sun, 27 Oct 2019 07:00:49 -0500 Subject: [PATCH] refactor(dis): removed dis.read_from_cnf() method. * It's not used. It's broken. And it's not tested. * Closes #687 --- flopy/modflow/mfdis.py | 88 ------------------------------------------ 1 file changed, 88 deletions(-) diff --git a/flopy/modflow/mfdis.py b/flopy/modflow/mfdis.py index 4f1638336e..c54f108953 100644 --- a/flopy/modflow/mfdis.py +++ b/flopy/modflow/mfdis.py @@ -533,94 +533,6 @@ def get_layer(self, i, j, elev): """ return get_layer(self, i, j, elev) - def read_from_cnf(self, cnf_file_name, n_per_line=0): - """ - Read discretization information from an MT3D configuration file. - - """ - - def getn(ii, jj): - if (jj == 0): - n = 1 - else: - n = int(ii / jj) - if (ii % jj != 0): - n = n + 1 - - return n - - try: - f_cnf = open(cnf_file_name, 'r') - - # nlay, nrow, ncol - line = f_cnf.readline() - s = line.split() - cnf_nlay = int(s[0]) - cnf_nrow = int(s[1]) - cnf_ncol = int(s[2]) - - # ncol column widths delr[c] - line = '' - for dummy in range(getn(cnf_ncol, n_per_line)): - line = line + f_cnf.readline() - cnf_delr = [float(s) for s in line.split()] - - # nrow row widths delc[r] - line = '' - for dummy in range(getn(cnf_nrow, n_per_line)): - line = line + f_cnf.readline() - cnf_delc = [float(s) for s in line.split()] - - # nrow * ncol htop[r, c] - line = '' - for dummy in range(getn(cnf_nrow * cnf_ncol, n_per_line)): - line = line + f_cnf.readline() - cnf_top = [float(s) for s in line.split()] - cnf_top = np.reshape(cnf_top, (cnf_nrow, cnf_ncol)) - - # nlay * nrow * ncol layer thickness dz[l, r, c] - line = '' - for dummy in range( - getn(cnf_nlay * cnf_nrow * cnf_ncol, n_per_line)): - line = line + f_cnf.readline() - cnf_dz = [float(s) for s in line.split()] - cnf_dz = np.reshape(cnf_dz, (cnf_nlay, cnf_nrow, cnf_ncol)) - - # # read cinact and cdry - # # values are not used by dis so are not read - # line = f_cnf.readline() - # s = line.split() - # cinact, cdry = float(s[0]), float(s[1]) - - # close the MT3D configuration file - f_cnf.close() - finally: - self.nlay = cnf_nlay - self.nrow = cnf_nrow - self.ncol = cnf_ncol - - self.delr = Util2d(model, (self.ncol,), np.float32, cnf_delr, - name='delr', locat=self.unit_number[0]) - self.delc = Util2d(model, (self.nrow,), np.float32, cnf_delc, - name='delc', locat=self.unit_number[0]) - self.top = Util2d(model, (self.nrow, self.ncol), np.float32, - cnf_top, name='model_top', - locat=self.unit_number[0]) - - cnf_botm = np.empty((self.nlay + sum(self.laycbd), self.nrow, - self.ncol)) - - # First model layer - cnf_botm[0:, :, :] = cnf_top - cnf_dz[0, :, :] - # All other layers - for l in range(1, self.nlay): - cnf_botm[l, :, :] = cnf_botm[l - 1, :, :] - cnf_dz[l, :, :] - - self.botm = Util3d(model, (self.nlay + sum(self.laycbd), - self.nrow, self.ncol), np.float32, - cnf_botm, 'botm', - locat=self.unit_number[0]) - def gettop(self): """ Get the top array.