#NEWLINE# def setmodflowvars( self , nlay , nrow , ncol , nper , laycon , delr , delc , htop , dz , perlen , nstp , tsmult ) : #NEWLINE# #INDENT# '\n        Set these variables from the MODFLOW model, if it exists\n        ' #NEWLINE# validmfdis = True #NEWLINE# try : #NEWLINE# #INDENT# dum = self . parent . mf . dis . nlay #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# validmfdis = False #NEWLINE# #UNINDENT# mfvarlist = [ nlay , nrow , ncol , nper , laycon , delr , delc , htop , dz , perlen , nstp , tsmult ] #NEWLINE# if ( not validmfdis ) : #NEWLINE# #INDENT# for v in mfvarlist : #NEWLINE# #INDENT# s = 'BTN error. Required input is None, but no modflow model.' #NEWLINE# s += ' If no modflow model is passed to Mt3dms, then values ' #NEWLINE# s += 'must be specified in the BTN constructor for: ' #NEWLINE# s += 'nlay, nrow, ncol, nper, laycon, delr, delc, htop, dz, ' #NEWLINE# s += 'perlen, nstp, and tsmult.' #NEWLINE# if ( v is None ) : #NEWLINE# #INDENT# raise Exception ( s ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( nlay is not None ) : #NEWLINE# #INDENT# self . nlay = nlay #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . nlay = self . parent . mf . dis . nlay #NEWLINE# #UNINDENT# if ( nrow is not None ) : #NEWLINE# #INDENT# self . nrow = nrow #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . nrow = self . parent . mf . dis . nrow #NEWLINE# #UNINDENT# if ( ncol is not None ) : #NEWLINE# #INDENT# self . ncol = ncol #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . ncol = self . parent . mf . dis . ncol #NEWLINE# #UNINDENT# if ( nper is not None ) : #NEWLINE# #INDENT# self . nper = nper #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . nper = self . parent . mf . dis . nper #NEWLINE# #UNINDENT# nlay = self . nlay #NEWLINE# nrow = self . nrow #NEWLINE# ncol = self . ncol #NEWLINE# nper = self . nper #NEWLINE# if ( delr is not None ) : #NEWLINE# #INDENT# self . delr = Util2d ( self . parent , ( ncol , ) , np . float32 , delr , name = 'delr' , locat = self . unit_number [ 0 ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . delr = Util2d ( self . parent , ( ncol , ) , np . float32 , self . parent . mf . dis . delr . get_value ( ) , name = 'delr' , locat = self . unit_number [ 0 ] ) #NEWLINE# #UNINDENT# if ( delc is not None ) : #NEWLINE# #INDENT# self . delc = Util2d ( self . parent , ( nrow , ) , np . float32 , delc , name = 'delc' , locat = self . unit_number [ 0 ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . delc = Util2d ( self . parent , ( nrow , ) , np . float32 , self . parent . mf . dis . delc . get_value ( ) , name = 'delc' , locat = self . unit_number [ 0 ] ) #NEWLINE# #UNINDENT# if ( htop is not None ) : #NEWLINE# #INDENT# self . htop = Util2d ( self . parent , ( nrow , ncol ) , np . float32 , htop , name = 'htop' , locat = self . unit_number [ 0 ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . htop = Util2d ( self . parent , ( nrow , ncol ) , np . float32 , self . parent . mf . dis . top . get_value ( ) , name = 'htop' , locat = self . unit_number [ 0 ] ) #NEWLINE# #UNINDENT# if ( dz is not None ) : #NEWLINE# #INDENT# self . dz = Util3d ( self . parent , ( nlay , nrow , ncol ) , np . float32 , dz , name = 'dz' , locat = self . unit_number [ 0 ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# thickness = self . parent . mf . dis . thickness . get_value ( ) #NEWLINE# self . dz = Util3d ( self . parent , ( nlay , nrow , ncol ) , np . float32 , thickness , name = 'dz' , locat = self . unit_number [ 0 ] ) #NEWLINE# #UNINDENT# if ( perlen is not None ) : #NEWLINE# #INDENT# self . perlen = Util2d ( self . parent , ( nper , ) , np . float32 , perlen , name = 'perlen' , locat = self . unit_number [ 0 ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . perlen = Util2d ( self . parent , ( nper , ) , np . float32 , self . parent . mf . dis . perlen . get_value ( ) , name = 'perlen' , locat = self . unit_number [ 0 ] ) #NEWLINE# #UNINDENT# if ( nstp is not None ) : #NEWLINE# #INDENT# self . nstp = Util2d ( self . parent , ( nper , ) , np . int , nstp , name = 'nstp' , locat = self . unit_number [ 0 ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . nstp = Util2d ( self . parent , ( nper , ) , np . int , self . parent . mf . dis . nstp . get_value ( ) , name = 'nstp' , locat = self . unit_number [ 0 ] ) #NEWLINE# #UNINDENT# if ( tsmult is not None ) : #NEWLINE# #INDENT# self . tsmult = Util2d ( self . parent , ( nper , ) , np . float32 , tsmult , name = 'tsmult' , locat = self . unit_number [ 0 ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . tsmult = Util2d ( nrow . parent , ( nper , ) , np . float32 , self . parent . mf . dis . tsmult . get_value ( ) , name = 'tsmult' , locat = self . unit_number [ 0 ] ) #NEWLINE# #UNINDENT# self . laycon = None #NEWLINE# if ( laycon is not None ) : #NEWLINE# #INDENT# self . laycon = Util2d ( self . parent , ( nlay , ) , np . int , laycon , name = 'laycon' , locat = self . unit_number [ 0 ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# flow_package = self . parent . mf . get_package ( 'BCF6' ) #NEWLINE# if ( flow_package is not None ) : #NEWLINE# #INDENT# self . laycon = Util2d ( self . parent , ( nlay , ) , np . int , flow_package . laycon . get_value ( ) , name = 'laycon' , locat = self . unit_number [ 0 ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# flow_package = self . parent . mf . get_package ( 'LPF' ) #NEWLINE# if ( flow_package is not None ) : #NEWLINE# #INDENT# self . laycon = Util2d ( self . parent , ( nlay , ) , np . int , flow_package . laytyp . get_value ( ) , name = 'laycon' , locat = self . unit_number [ 0 ] ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# s = 'BTN warning. Laycon has not been set.  A modflow model with a ' #NEWLINE# s += ' BCF or LPF package does not exist and laycon was not passed ' #NEWLINE# s += ' to the BTN constructor.  Setting laycon to 1 (convertible).' #NEWLINE# if ( self . laycon is None ) : #NEWLINE# #INDENT# warnings . warn ( s ) #NEWLINE# self . laycon = Util2d ( self . parent , ( nlay , ) , np . int , 1 , name = 'laycon' , locat = self . unit_number [ 0 ] ) #NEWLINE# #UNINDENT# return